/**
 * Lapa Card Upgrader Stylesheet - upgrade.css
 * Precision Case-Battle Wheel & Official TCG Collector Cards Layout
 * Subpixel Stability, Zero Jitter / Shaking, Clean Uniform Geometry
 */

:root {
    --upg-bg-card: rgba(255, 255, 255, 0.94);
    --upg-border: rgba(15, 23, 42, 0.08);
    --upg-border-hover: rgba(168, 85, 247, 0.35);
    --upg-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.10), 0 8px 20px -4px rgba(15, 23, 42, 0.04);
    --upg-green: #10b981;
    --upg-green-glow: rgba(16, 185, 129, 0.35);
    --upg-purple: #a855f7;
    --upg-purple-glow: rgba(168, 85, 247, 0.35);
    --upg-text-dark: #0f172a;
    --upg-text-muted: #64748b;
}

/* Page Body & Wrapper */
.upgrade-body {
    background-color: #f8fafc;
    color: var(--upg-text-dark);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.upgrade-page-wrapper,
.upgrade-layout-container {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px 80px;
    box-sizing: border-box;
}



/* Confetti Canvas */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* --------------------------------------------------------------------------
   Top Controls Bar (Clean space-between layout, center pill removed)
   -------------------------------------------------------------------------- */
.upgrade-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 20px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 9999px;
    box-shadow: 
        0 14px 34px -6px rgba(15, 23, 42, 0.06),
        0 4px 12px -2px rgba(15, 23, 42, 0.02);
}

.top-bar-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-ctrl-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--upg-border);
    background: #ffffff;
    color: var(--upg-text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-ctrl-icon:hover {
    transform: translateY(-2px);
    border-color: var(--upg-purple);
    color: var(--upg-purple);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.18);
}

.btn-ctrl-icon.is-active {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.35);
}

.btn-ctrl-icon.is-muted {
    opacity: 0.65;
    background: #f1f5f9;
}

.ctrl-icon {
    width: 18px;
    height: 18px;
}

.top-bar-controls-right {
    display: flex;
    align-items: center;
}

.btn-reset-selection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid var(--upg-border);
    background: #ffffff;
    color: var(--upg-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-selection:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #e11d48;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   The Main Upgrade Arena
   -------------------------------------------------------------------------- */
.upgrade-arena {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.12fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 28px;
}

/* Common Upgrade Box */
.upgrade-box {
    background: var(--upg-bg-card);
    border: 1px solid var(--upg-border);
    border-radius: 28px;
    padding: 20px 22px;
    box-shadow: var(--upg-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 490px;
    box-sizing: border-box;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.upgrade-box:hover {
    border-color: rgba(15, 23, 42, 0.14);
}

.box-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.box-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.box-title {
    font-family: 'Shantell Sans', cursive, sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--upg-text-dark);
    margin: 0;
    line-height: 1.3;
}

.box-title sup {
    font-size: 11px;
    color: var(--upg-purple);
}

.box-subtitle {
    font-size: 12px;
    color: var(--upg-text-muted);
}

.box-header-badge {
    padding: 4px 10px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: var(--upg-text-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.target-status-badge {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.target-status-badge.has-target {
    background: #ecfdf5;
    color: #047857;
    border-color: rgba(16, 185, 129, 0.3);
}

/* 6 Slots Grid in Left Box */
.upgrade-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    flex: 1;
    margin-bottom: 16px;
    min-height: 335px;
}

.upgrade-slot-item {
    position: relative;
    border-radius: 18px;
    border: 2px dashed rgba(15, 23, 42, 0.14);
    background: rgba(248, 250, 252, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 160px;
    min-height: 160px;
    max-height: 160px;
    overflow: visible;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upgrade-slot-item.is-empty:hover {
    border-color: rgba(217, 131, 134, 0.45);
    background: rgba(255, 241, 242, 0.55);
}

.slot-empty-num {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.slot-empty-icon {
    width: 20px;
    height: 20px;
    color: #cbd5e1;
    opacity: 0.8;
}

/* Filled Slot Card Item - Uses Full TCG Collector Card */
.upgrade-slot-item.is-filled {
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}

.upgrade-slot-item.is-filled .collector-card-item {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 160px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
    border-radius: 18px;
    animation: slotCardPop 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform: none !important;
}

@keyframes slotCardPop {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

.upgrade-slot-item.is-filled .collector-card-item .art-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 5px;
    border-radius: 18px;
    background: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 
        0 8px 20px -3px rgba(15, 23, 42, 0.10),
        0 2px 6px -1px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.upgrade-slot-item.is-filled:hover .collector-card-item .art-card-inner {
    transform: translate3d(0, -4px, 0);
    box-shadow: 
        0 14px 28px -4px rgba(15, 23, 42, 0.18),
        0 0 16px -2px var(--rarity-glow, rgba(217, 131, 134, 0.35));
    border-color: rgba(15, 23, 42, 0.18);
}

.upgrade-slot-item.is-filled .collector-card-item .card-ref-top-tab {
    top: 0;
    padding: 3px 8px 4px;
    font-size: 8.5px;
    font-weight: 700;
    border-radius: 0 0 8px 8px;
    z-index: 8;
}

.upgrade-slot-item.is-filled .collector-card-item .card-rarity-limited .card-ref-top-tab {
    min-width: 65px;
    padding: 3px 10px 4px;
}

.upgrade-slot-item.is-filled .collector-card-item .art-img-wrap {
    width: 100%;
    height: 100%;
    border-radius: 13px;
    overflow: hidden;
    position: relative;
    background: #0f172a;
}

.upgrade-slot-item.is-filled .collector-card-item .art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
    transition: transform 0.3s ease;
}

.upgrade-slot-item.is-filled:hover .collector-card-item .art-img {
    transform: scale(1.05);
}

.upgrade-slot-item.is-filled .collector-card-item .card-art-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 22px 6px 18px;
    background: linear-gradient(
        to top,
        rgba(10, 15, 26, 0.95) 0%,
        rgba(10, 15, 26, 0.70) 55%,
        transparent 100%
    );
    z-index: 6;
    border-radius: 0 0 13px 13px;
    pointer-events: none;
}

.upgrade-slot-item.is-filled .collector-card-item .card-art-title {
    font-family: 'Shantell Sans', cursive, sans-serif;
    font-size: 9.5px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.upgrade-slot-item.is-filled .collector-card-item .card-art-desc {
    display: none;
}

.upgrade-slot-item.is-filled .collector-card-item .card-bottom-left-tab {
    position: absolute;
    bottom: -1px;
    left: -1px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2.5px 7px 3.5px;
    border-radius: 0 8px 0 0;
    font-family: 'Fira Code', monospace;
    font-size: 8.5px;
    font-weight: 800;
    background: var(--badge-bg, #2563eb);
    color: #ffffff;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.25);
    line-height: 1;
    pointer-events: none;
}

/* Remove Button floating on top-right of the slot */
.upgrade-slot-item .btn-slot-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 30;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.upgrade-slot-item.is-filled:hover .btn-slot-remove {
    opacity: 1;
    transform: scale(1);
}

.upgrade-slot-item .btn-slot-remove:hover {
    background: #e11d48;
    transform: scale(1.18);
}

/* Box Footer */
.box-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.box-footer-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--upg-text-muted);
}

.stat-val {
    font-family: 'Fira Code', monospace;
    font-size: 18px;
    font-weight: 800;
}

.stat-val-source {
    color: var(--upg-purple);
}

.stat-val-target {
    color: var(--upg-green);
}

.stat-hint {
    font-size: 11px;
    color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Target Card Box (Right Side)
   -------------------------------------------------------------------------- */
.target-card-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 16px;
    min-height: 335px;
}

.target-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
}

.empty-silhouette-icon {
    width: 90px;
    height: 130px;
    margin-bottom: 16px;
    color: #cbd5e1;
    animation: silhouetteFloat 3s ease-in-out infinite alternate;
}

@keyframes silhouetteFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

.empty-silhouette-text {
    font-size: 13px;
    line-height: 1.5;
    max-width: 220px;
    margin: 0;
}

/* Target card container rendered via .collector-card-item */
.target-card-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.target-card-preview .collector-card-item {
    width: 235px;
    height: 335px;
    animation: targetCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    cursor: default;
}

@keyframes targetCardPop {
    0% { opacity: 0; transform: scale(0.93); }
    100% { opacity: 1; transform: scale(1); }
}

.target-card-preview .collector-card-item:hover .art-card-inner {
    transform: none;
}

.btn-clear-target {
    padding: 4px 10px;
    border-radius: 9999px;
    background: #fee2e2;
    border: none;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-target:hover {
    background: #fecdd3;
    transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   CENTER: Circular Roulette Wheel Arena (Sleek Red/Coral Luxury Theme)
   -------------------------------------------------------------------------- */
.upgrade-wheel-box {
    position: relative;
    background: var(--upg-bg-card);
    border: 1px solid var(--upg-border);
    border-radius: 28px;
    padding: 24px 20px 20px;
    box-shadow: 
        0 18px 42px -6px rgba(15, 23, 42, 0.08),
        0 4px 14px -2px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}

/* Atmospheric Ambient Glow behind wheel */
.upgrade-wheel-box::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 131, 134, 0.14) 0%, rgba(225, 29, 72, 0.04) 50%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.wheel-stage-container {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

/* Wheel Dial Wrapper (320px circle) */
.wheel-dial-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.wheel-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* 0 angle starts at top */
}

.wheel-track-bg {
    fill: none;
    stroke: rgba(15, 23, 42, 0.06);
    stroke-width: 14;
}

.wheel-win-arc {
    fill: none;
    stroke: url(#wheelWinGrad);
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s ease;
    filter: drop-shadow(0 0 12px rgba(225, 29, 72, 0.65));
}

.wheel-percentage-marks {
    transform: rotate(90deg); /* Counter-rotate text so it stays upright */
    transform-origin: 170px 170px;
}

.wheel-mark-text {
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    fill: #94a3b8;
    text-anchor: middle;
    dominant-baseline: central;
    letter-spacing: 0.02em;
}

/* The Needle Track and Rotating Pointer */
.wheel-needle-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: rotate(0deg);
    transition: transform 0.1s linear;
}

.wheel-needle-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.wheel-needle-svg {
    display: block;
    overflow: visible;
    filter: drop-shadow(0 4px 10px rgba(225, 29, 72, 0.45));
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Wheel Center Hub */
.wheel-center-hub {
    position: relative;
    z-index: 5;
    width: 194px;
    height: 194px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 
        0 18px 36px -6px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(15, 23, 42, 0.04),
        inset 0 2px 6px rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

.hub-paw-icon {
    color: #cbd5e1;
    margin-bottom: 4px;
    transition: color 0.3s ease, filter 0.3s ease;
}

.wheel-center-hub.is-active .hub-paw-icon {
    color: #e11d48;
    animation: pawGlowPulse 2s ease-in-out infinite;
}

@keyframes pawGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(225, 29, 72, 0.4)); }
    50% { filter: drop-shadow(0 0 14px rgba(225, 29, 72, 0.85)); }
}

.hub-chance-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chance-number {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 4px;
}

.chance-label {
    font-family: 'Outfit', sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #64748b;
    text-transform: uppercase;
}

.hub-status-text {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 6px;
    transition: color 0.25s ease;
}

.hub-status-text.status-ready {
    color: #10b981;
}

.hub-status-text.status-spinning {
    color: #e11d48;
}

/* Quick Multipliers & Presets Bar */
.wheel-quick-presets {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.btn-preset {
    padding: 7px 13px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #334155;
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-preset:hover {
    background: #ffffff;
    border-color: #d98386;
    color: #bd4953;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 131, 134, 0.28);
}

.btn-preset.is-active {
    background: linear-gradient(135deg, #d98386 0%, #bd4953 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(217, 131, 134, 0.4);
}

/* Double-Frame Bezel Chassis for Signature Red/Coral Action Button */
.btn-upgrade-chassis {
    width: 100%;
    display: block;
    padding: 4px;
    background: rgba(217, 131, 134, 0.12);
    border: 1px solid rgba(217, 131, 134, 0.3);
    border-radius: 22px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.btn-upgrade-chassis:has(.btn-upgrade-action:not(:disabled):hover) {
    border-color: rgba(217, 131, 134, 0.55);
    background: rgba(217, 131, 134, 0.18);
    box-shadow: 0 8px 24px -4px rgba(217, 131, 134, 0.35);
}

/* Signature Red/Coral Upgrade Button */
.btn-upgrade-action {
    position: relative;
    width: 100%;
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #d98386 0%, #bd4953 100%);
    color: #ffffff;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        0 8px 22px -3px rgba(217, 131, 134, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.45);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease,
                background 0.3s ease,
                opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shimmer gloss sheen light sweep */
.btn-upgrade-action::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
    transform: translateX(-150%) skewX(-15deg);
    transition: transform 0.75s ease;
    pointer-events: none;
}

.btn-upgrade-action:not(:disabled):hover::after {
    transform: translateX(180%) skewX(-15deg);
}

.btn-upgrade-action:not(:disabled):hover {
    transform: translateY(-2px) scale(1.01);
    background: linear-gradient(135deg, #e11d48 0%, #bd4953 60%, #d98386 100%);
    box-shadow: 
        0 16px 36px -4px rgba(217, 131, 134, 0.7),
        0 0 20px rgba(217, 131, 134, 0.35),
        inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.btn-upgrade-action:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

.btn-upgrade-action:disabled {
    background: #e2e8f0;
    border-color: rgba(15, 23, 42, 0.06);
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none !important;
}

.btn-upgrade-action.is-spinning {
    background: linear-gradient(135deg, #e11d48 0%, #bd4953 100%);
    animation: upgradeSpinGlow 1.6s ease-in-out infinite alternate;
}

@keyframes upgradeSpinGlow {
    0% { box-shadow: 0 8px 20px rgba(217, 131, 134, 0.45); }
    100% { box-shadow: 0 16px 36px rgba(217, 131, 134, 0.75), 0 0 25px rgba(225, 29, 72, 0.5); }
}

.btn-bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-upgrade-action:not(:disabled):hover .btn-bg-glow {
    opacity: 1;
}

.btn-content {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.btn-action-icon {
    width: 20px;
    height: 20px;
    animation: chevronBob 1.5s ease-in-out infinite;
}

@keyframes chevronBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* --------------------------------------------------------------------------
   5. Bottom Selection Drawers (My Cards & Catalog)
   -------------------------------------------------------------------------- */
.upgrade-drawers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: flex-start;
    margin-top: 8px;
}

.drawer-column {
    background: var(--upg-bg-card);
    border: 1px solid var(--upg-border);
    border-radius: 28px;
    padding: 22px 24px;
    box-shadow: var(--upg-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-sizing: border-box;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.drawer-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-icon {
    color: var(--upg-purple);
}

.drawer-title {
    font-family: 'Shantell Sans', cursive, sans-serif;
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    color: var(--upg-text-dark);
}

.drawer-counter {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--upg-text-muted);
}


/* Luxury Drawer Search Box */
.drawer-search-wrap {
    flex: 1;
    max-width: 210px;
    min-width: 130px;
}

.drawer-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 9999px;
    padding: 0 10px 0 11px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    height: 36px;
}

.drawer-search-box:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.12);
}

.drawer-search-box:focus-within {
    border-color: var(--upg-purple);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18), 0 4px 14px rgba(15, 23, 42, 0.08);
}

.search-lens-icon {
    color: #94a3b8;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
    margin-right: 6px;
}

.drawer-search-box:focus-within .search-lens-icon {
    color: var(--upg-purple);
    transform: scale(1.1);
}

.drawer-search-input {
    width: 100%;
    padding: 6px 0;
    border: none !important;
    background: transparent !important;
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--upg-text-dark);
    outline: none !important;
    box-shadow: none !important;
}

.drawer-search-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.search-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: #64748b;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    margin-left: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.search-clear-btn:hover {
    background: #e11d48;
    color: #ffffff;
    transform: scale(1.1);
}

.search-clear-btn.is-hidden {
    display: none !important;
}

.drawer-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Custom Luxury Sort Dropdown (Centered & Vector SVG Icons) */
.custom-sort-dropdown {
    position: relative;
    user-select: none;
    z-index: 50;
    min-width: 175px;
}

.custom-sort-trigger {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 14px 7px 12px;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--upg-text-dark);
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.custom-sort-trigger:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.12);
}

.custom-sort-dropdown.is-open .custom-sort-trigger {
    border-color: var(--upg-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18), 0 4px 14px rgba(15, 23, 42, 0.08);
}

.sort-icon-decor {
    color: var(--upg-purple);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sort-chevron-icon {
    color: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.custom-sort-dropdown.is-open .sort-chevron-icon {
    transform: rotate(180deg);
    color: var(--upg-purple);
}

.custom-sort-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    min-width: 185px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 6px;
    box-shadow: 
        0 18px 40px -6px rgba(15, 23, 42, 0.14),
        0 6px 14px -2px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: dropdownOpen 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top center;
    box-sizing: border-box;
}

@keyframes dropdownOpen {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.custom-sort-menu.is-hidden {
    display: none !important;
}

.custom-sort-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    color: #334155;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.custom-sort-item:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateX(2px);
}

.custom-sort-item.is-selected {
    background: rgba(168, 85, 247, 0.10);
    color: #7c3aed;
    font-weight: 700;
}

.custom-sort-item.is-selected .sort-check-icon {
    opacity: 1;
    color: #7c3aed;
    transform: scale(1);
}

.sort-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sort-svg-icon {
    display: block;
    transition: transform 0.2s ease;
}

.custom-sort-item:hover .sort-svg-icon {
    transform: scale(1.15);
}

.icon-sort-up {
    color: #10b981;
}

.icon-sort-down {
    color: #e11d48;
}

.icon-sort-rarity {
    color: #d97706;
}

.sort-item-label {
    flex: 1;
    text-align: left;
}

.sort-check-icon {
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    transform: scale(0.6);
    flex-shrink: 0;
}

.is-hidden-select {
    display: none !important;
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Filter Pills & Rarity Categories in Drawers (Exact Match to Category Card)
   -------------------------------------------------------------------------- */
.drawer-filter-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px 8px;
    padding: 2px 0 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100%;
    box-sizing: border-box;
}

/* Row break forcing Legendary & Limited onto centered Row 2 */
.drawer-filter-pills .filter-row-break {
    flex-basis: 100%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* Base Filter Button - Pure Category Card (.btn-filter in cards.css) */
.drawer-filter-pills .btn-filter,
.drawer-filter-pills .pill-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9999px;
    border: none !important;
    background: transparent !important;
    color: #475569 !important;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    user-select: none;
    box-shadow: none !important;
    transition: transform 0.25s cubic-bezier(0.16, 1.25, 0.35, 1),
                background 0.2s ease,
                color 0.2s ease,
                box-shadow 0.25s cubic-bezier(0.16, 1.25, 0.35, 1);
}

/* Hover state - identical to cards.css */
.drawer-filter-pills .btn-filter:hover,
.drawer-filter-pills .pill-filter:hover {
    color: #0f172a !important;
    background: rgba(15, 23, 42, 0.06) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}

.drawer-filter-pills .btn-filter:active,
.drawer-filter-pills .pill-filter:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

/* Active State for buttons - Signature Deep Slate #0f172a with white text & white icon */
.drawer-filter-pills .btn-filter.is-active,
.drawer-filter-pills .btn-filter.active,
.drawer-filter-pills .pill-filter.is-active,
.drawer-filter-pills .pill-filter.active {
    background: #0f172a !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25) !important;
    transform: translateY(-1px);
}

.drawer-filter-pills .btn-filter.is-active .filter-rarity-icon,
.drawer-filter-pills .btn-filter.active .filter-rarity-icon,
.drawer-filter-pills .pill-filter.is-active .filter-rarity-icon,
.drawer-filter-pills .pill-filter.active .filter-rarity-icon {
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   Dalmatian Coat Theme for Limited Filter Button (Exact Copy from cards.css)
   -------------------------------------------------------------------------- */
.drawer-filter-pills .btn-filter[data-rarity="limited"],
.drawer-filter-pills .btn-filter[data-filter="limited"],
.drawer-filter-pills .pill-filter[data-rarity="limited"],
.drawer-filter-pills .pill-filter[data-filter="limited"] {
    background-color: #ffffff !important;
    background-image: url('../assets/dalmatian-spots.svg') !important;
    background-size: 110px 55px !important;
    background-position: center !important;
    border: none !important;
    color: #0f172a !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
}

.drawer-filter-pills .btn-filter[data-rarity="limited"]:hover,
.drawer-filter-pills .btn-filter[data-filter="limited"]:hover,
.drawer-filter-pills .pill-filter[data-rarity="limited"]:hover,
.drawer-filter-pills .pill-filter[data-filter="limited"]:hover {
    border: none !important;
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2) !important;
}

.drawer-filter-pills .btn-filter[data-rarity="limited"] .filter-rarity-icon,
.drawer-filter-pills .btn-filter[data-filter="limited"] .filter-rarity-icon,
.drawer-filter-pills .pill-filter[data-rarity="limited"] .filter-rarity-icon,
.drawer-filter-pills .pill-filter[data-filter="limited"] .filter-rarity-icon {
    color: #0f172a !important;
    filter: drop-shadow(0 0 2px #ffffff);
}

.drawer-filter-pills .btn-filter[data-rarity="limited"] span,
.drawer-filter-pills .btn-filter[data-filter="limited"] span,
.drawer-filter-pills .pill-filter[data-rarity="limited"] span,
.drawer-filter-pills .pill-filter[data-filter="limited"] span {
    color: #0f172a !important;
    text-shadow: 0 0 4px #ffffff, 0 0 2px #ffffff, 0 1px 2px #ffffff;
}

.drawer-filter-pills .btn-filter.is-active[data-rarity="limited"],
.drawer-filter-pills .btn-filter.active[data-rarity="limited"],
.drawer-filter-pills .btn-filter.is-active[data-filter="limited"],
.drawer-filter-pills .btn-filter.active[data-filter="limited"],
.drawer-filter-pills .pill-filter.is-active[data-rarity="limited"],
.drawer-filter-pills .pill-filter.active[data-rarity="limited"],
.drawer-filter-pills .pill-filter.is-active[data-filter="limited"],
.drawer-filter-pills .pill-filter.active[data-filter="limited"] {
    background-color: #ffffff !important;
    background-image: url('../assets/dalmatian-spots.svg') !important;
    background-size: 110px 55px !important;
    background-position: center !important;
    border: 2px solid #0f172a !important;
    color: #0f172a !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.25) !important;
}

.drawer-filter-pills .btn-filter.is-active[data-rarity="limited"]:hover,
.drawer-filter-pills .btn-filter.active[data-rarity="limited"]:hover,
.drawer-filter-pills .pill-filter.is-active[data-rarity="limited"]:hover,
.drawer-filter-pills .pill-filter.active[data-rarity="limited"]:hover {
    border: 2px solid #0f172a !important;
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.32) !important;
}

.drawer-filter-pills .btn-filter.is-active[data-rarity="limited"] .filter-rarity-icon,
.drawer-filter-pills .btn-filter.active[data-rarity="limited"] .filter-rarity-icon,
.drawer-filter-pills .pill-filter.is-active[data-rarity="limited"] .filter-rarity-icon,
.drawer-filter-pills .pill-filter.active[data-rarity="limited"] .filter-rarity-icon {
    color: #0f172a !important;
    filter: drop-shadow(0 0 2px #ffffff);
}

.drawer-filter-pills .btn-filter.is-active[data-rarity="limited"] span,
.drawer-filter-pills .btn-filter.active[data-rarity="limited"] span,
.drawer-filter-pills .pill-filter.is-active[data-rarity="limited"] span,
.drawer-filter-pills .pill-filter.active[data-rarity="limited"] span {
    color: #0f172a !important;
    text-shadow: 0 0 4px #ffffff, 0 0 2px #ffffff, 0 1px 2px #ffffff;
}

/* Filter icon styling */
.drawer-filter-pills .filter-rarity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1.25, 0.35, 1);
}

.drawer-filter-pills .btn-filter:hover .filter-rarity-icon,
.drawer-filter-pills .pill-filter:hover .filter-rarity-icon {
    transform: scale(1.15) rotate(-2deg);
}

.drawer-filter-pills .filter-rarity-icon svg {
    display: block;
}

/* --------------------------------------------------------------------------
   DRAWER CARDS GRID - 100% UNIFORM, ZERO JITTER / SHAKING
   -------------------------------------------------------------------------- */
.drawer-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px 14px;
    box-sizing: border-box;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    contain: paint layout;
}

/* Base Collector Card Item in Drawer */
.drawer-cards-grid .collector-card-item {
    position: relative;
    width: 100%;
    height: 228px;
    min-height: 228px;
    max-height: 228px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: pointer;
    outline: none;
    animation: none !important; /* Zero spawning jitter inside drawer */
    transform: none !important; /* Outer container NEVER moves inside CSS grid */
    contain: layout style;
}

/* Inner Art Card Container */
.drawer-cards-grid .collector-card-item .art-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 
        0 10px 24px -4px rgba(15, 23, 42, 0.08),
        0 2px 6px -1px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
    will-change: transform;
}

/* Smooth Hardware-Accelerated Lift on Hover */
.drawer-cards-grid .collector-card-item:hover .art-card-inner {
    transform: translate3d(0, -6px, 0);
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 
        0 22px 42px -6px rgba(15, 23, 42, 0.20),
        0 0 20px -2px var(--rarity-glow, rgba(217, 131, 134, 0.3));
}

/* Active / Selected Target State (Zero layout reflow) */
.drawer-cards-grid .collector-card-item.is-target-selected .art-card-inner {
    border-color: #10b981;
    box-shadow: 
        0 0 0 3px rgba(16, 185, 129, 0.45),
        0 20px 40px -4px rgba(16, 185, 129, 0.35);
}

/* Top Tab for Drawer Cards */
.drawer-cards-grid .card-ref-top-tab {
    top: 0;
    padding: 4px 12px 5px;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    z-index: 8;
}

.drawer-cards-grid .card-rarity-limited .card-ref-top-tab {
    padding: 4px 14px 5px;
    min-width: 80px;
}

/* Artwork Image Frame */
.drawer-cards-grid .art-img-wrap {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    background: #0f172a;
}

.drawer-cards-grid .art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-cards-grid .collector-card-item:hover .art-img {
    transform: scale(1.05);
}

/* Bottom Card Overlay: Title & PTS */
.drawer-cards-grid .card-art-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 26px 8px 24px;
    background: linear-gradient(
        to top,
        rgba(10, 15, 26, 0.95) 0%,
        rgba(10, 15, 26, 0.75) 55%,
        transparent 100%
    );
    z-index: 6;
    border-radius: 0 0 15px 15px;
    pointer-events: none;
}

.drawer-cards-grid .card-art-title {
    font-family: 'Shantell Sans', cursive, sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.drawer-cards-grid .card-art-desc {
    display: none; /* Hide lore snippet in mini grid cards for clean look */
}

/* Bottom-Left Attached Rarity Tab */
.drawer-cards-grid .card-bottom-left-tab {
    position: absolute;
    bottom: -1px;
    left: -1px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 4px;
    border-radius: 0 10px 0 0;
    font-family: 'Fira Code', monospace;
    font-size: 9.5px;
    font-weight: 800;
    background: var(--badge-bg, #2563eb);
    color: #ffffff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
    line-height: 1;
    pointer-events: none;
}

/* Quantity Badge (Top-Right of Card) */
.card-qty-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 12;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 9999px;
    font-family: 'Fira Code', monospace;
    font-size: 10.5px;
    font-weight: 800;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* Dynamic Chance Badge (Bottom-Right of Card in Catalog) */
.card-chance-tab {
    position: absolute;
    bottom: -1px;
    right: -1px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px 4px;
    border-radius: 10px 0 0 0;
    font-family: 'Fira Code', monospace;
    font-size: 9.5px;
    font-weight: 800;
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* In-Upgrade Selection Overlay */
.card-selected-overlay {
    position: absolute;
    inset: 0;
    border-radius: 15px;
    background: rgba(168, 85, 247, 0.82);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.collector-card-item.is-in-upgrade .card-selected-overlay {
    opacity: 1;
}

/* Guest Banner */
.drawer-guest-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
}

.btn-guest-login {
    padding: 6px 14px;
    border-radius: 9999px;
    background: #5865F2;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   6. Victory Modal Screen
   -------------------------------------------------------------------------- */
.upgrade-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease both;
}

.upgrade-modal-box {
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3);
    padding: 32px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: modalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalPop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-badge-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.modal-victory-title {
    font-family: 'Shantell Sans', cursive, sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--upg-text-dark);
    margin: 0 0 16px;
}

.modal-card-stage {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-card-stage .collector-card-item {
    width: 235px;
    height: 335px;
    animation: none;
    cursor: default;
}

.modal-card-stage .collector-card-item:hover .art-card-inner {
    transform: none;
}

.modal-victory-lore {
    font-size: 13px;
    color: var(--upg-text-muted);
    line-height: 1.5;
    margin: 0 0 20px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-modal-claim {
    flex: 1;
    padding: 12px 20px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-modal-again {
    padding: 12px 20px;
    border-radius: 9999px;
    background: #f1f5f9;
    border: 1px solid var(--upg-border);
    color: var(--upg-text-dark);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   7. Failure Toast
   -------------------------------------------------------------------------- */
.failure-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #fecdd3;
    border-left: 5px solid #e11d48;
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: 0 20px 48px -10px rgba(225, 29, 72, 0.25);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toastSlideIn {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.toast-icon {
    font-size: 22px;
}

.toast-title {
    font-weight: 800;
    font-size: 14px;
    color: #9f1239;
}

.toast-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   8. Rules Info Modal
   -------------------------------------------------------------------------- */
.info-box {
    text-align: left;
    max-width: 520px;
}

.info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.info-title {
    font-family: 'Shantell Sans', cursive, sans-serif;
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.info-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
}

.info-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.info-rule-card {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 12px 14px;
}

.info-rule-card h4 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--upg-text-dark);
}

.info-rule-card p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.info-rule-card code {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    margin-top: 6px;
    color: #7e22ce;
}

.info-rule-card ul {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 12px;
    font-family: 'Fira Code', monospace;
    line-height: 1.8;
}

.btn-info-understood {
    width: 100%;
    padding: 12px;
    border-radius: 9999px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

/* Helpers */
.is-hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .upgrade-arena {
        grid-template-columns: 1fr;
    }
    .upgrade-wheel-box {
        order: -1;
    }
    .upgrade-drawers {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .upgrade-page-wrapper {
        padding: 10px 14px 60px;
    }
    .wheel-dial-wrapper {
        width: 280px;
        height: 280px;
    }
    .wheel-center-hub {
        width: 160px;
        height: 160px;
    }
    .chance-number {
        font-size: 30px;
    }
    .upgrade-top-bar {
        border-radius: 20px;
    }
    .drawer-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}
