/* ============================================
   NBA VAULT - Premium Card Collection Manager
   8K Cinematic Dark Theme with Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Core palette - deeper, richer darks */
    --bg-deep: #04060c;
    --bg-surface: #0a0e18;
    --bg-card: rgba(15, 20, 30, 0.7);
    --bg-elevated: rgba(22, 28, 42, 0.75);
    --bg-hover: rgba(30, 38, 56, 0.8);

    /* NBA identity */
    --nba-red: #c8102e;
    --nba-blue: #1d428a;
    --nba-white: #ffffff;
    --orange: #ff6b35;
    --orange-soft: #ff8c5a;
    --gold: #fdb927;
    --gold-dim: rgba(253, 185, 39, 0.15);

    /* Gradients */
    --grad-fire: linear-gradient(135deg, #ff6b35 0%, #fdb927 100%);
    --grad-blue: linear-gradient(135deg, #1d428a 0%, #2d6bcf 100%);
    --grad-royal: linear-gradient(135deg, #c8102e 0%, #ff6b35 100%);
    --grad-surface: linear-gradient(180deg, rgba(10, 14, 24, 0.95) 0%, rgba(15, 20, 30, 0.9) 100%);
    --grad-glass: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 100%);

    /* Glassmorphism */
    --glass-bg: rgba(15, 20, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    --glass-blur-strong: blur(24px);

    /* Text */
    --text: #f0f2f5;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --text-inverse: #06080f;

    /* Accents */
    --success: #3fb950;
    --danger: #f85149;
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);

    /* Effects */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
    --shadow-glow-orange: 0 0 40px rgba(255, 107, 53, 0.2), 0 0 80px rgba(255, 107, 53, 0.08);
    --shadow-glow-gold: 0 0 30px rgba(253, 185, 39, 0.15), 0 0 60px rgba(253, 185, 39, 0.06);

    --font-display: 'Bebas Neue', Impact, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
html::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

body {
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Real basketball texture background - fixed, subtle */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        /* Dark overlay to keep it subtle */
        linear-gradient(180deg, rgba(4, 6, 12, 0.92) 0%, rgba(4, 6, 12, 0.88) 50%, rgba(4, 6, 12, 0.94) 100%),
        url('https://images.unsplash.com/photo-1504450758481-7338bbe7b8db?w=1920&q=80') center/cover no-repeat fixed;
    pointer-events: none;
    z-index: 0;
}

/* Subtle noise texture overlay for premium matte feel */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* Animated ambient light */
.ambient-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(29, 66, 138, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(200, 16, 46, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(253, 185, 39, 0.03) 0%, transparent 50%);
    animation: bgShift 25s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgShift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-2%, 1%) scale(1.03); }
    66% { transform: translate(1%, -1%) scale(1.02); }
    100% { transform: translate(-3%, 2%) scale(1.05); }
}

/* ============ BACKGROUND CAROUSEL ============ */
.bg-carousel {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.86;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 0;
    padding: 3vh 0;
    mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
}

.bg-carousel-line {
    display: flex;
    align-items: center;
    /* ~6 items visible: 100vw / 6 ≈ 16vw per item, minus the item itself leaves gap */
    gap: calc((100vw / 6) - 120px);
    width: max-content;
    white-space: nowrap;
    will-change: transform;
    animation: carouselLeft 500s linear infinite;
}

.bg-carousel-line-reverse {
    animation: carouselRight 550s linear infinite;
}

.bg-carousel-line img {
    height: 120px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    filter: grayscale(0.4) brightness(0.7);
}

@keyframes carouselLeft {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes carouselRight {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-carousel-line { animation: none; }
    .bg-carousel { opacity: 0.1; }
}

/* ============ VIEW TRANSITIONS ============ */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.35s;
}

::view-transition-old(root) {
    animation: fadeOut 0.17s ease-in forwards;
}

::view-transition-new(root) {
    animation: fadeIn 0.17s ease-out 0.17s backwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: scale(0.98); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(1.02); }
}

/* ============ NAVIGATION ============ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(4, 6, 12, 0.7);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 2rem;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 2rem;
    /* Subtle bottom glow line */
    box-shadow:
        0 1px 0 0 rgba(255, 107, 53, 0.05),
        0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Nav bottom glow accent */
.nav::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 107, 53, 0.15) 20%,
        rgba(253, 185, 39, 0.2) 50%,
        rgba(255, 107, 53, 0.15) 80%,
        transparent 100%
    );
    pointer-events: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-brand svg { width: 32px; height: 32px; }

.nav-brand-text {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 4px;
    line-height: 1;
}

.nav-brand-text .nba { color: var(--nba-red); }
.nav-brand-text .vault {
    color: var(--text);
    text-shadow: 0 0 20px rgba(240, 242, 245, 0.1);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin-left: auto;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* Nav hover underline grows from center */
.nav-links a:not(.nav-add)::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--grad-fire);
    border-radius: 2px;
    transition: width 0.3s ease, left 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}

.nav-links a:not(.nav-add):hover::before {
    width: 60%;
    left: 20%;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--text);
    background: rgba(255, 107, 53, 0.08);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--grad-fire);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

.nav-links a.nav-add {
    background: var(--grad-fire);
    color: var(--text-inverse);
    font-weight: 700;
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    margin-left: 0.5rem;
    position: relative;
    overflow: hidden;
}

/* Glass reflection on nav add button */
.nav-links a.nav-add::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
    border-radius: 50px 50px 0 0;
    pointer-events: none;
}

.nav-links a.nav-add:hover {
    box-shadow: var(--shadow-glow-orange);
    transform: translateY(-1px);
}

/* ============ LAYOUT ============ */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

/* ============ HERO / PAGE HEADER ============ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    letter-spacing: 4px;
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.15));
}

/* Hero banner on dashboard - cinematic with real basketball image */
.hero {
    background:
        linear-gradient(135deg, rgba(4, 6, 12, 0.85) 0%, rgba(10, 14, 24, 0.75) 40%, rgba(4, 6, 12, 0.9) 100%),
        url('https://images.unsplash.com/photo-1546519638-68e109498ffc?w=1920&q=80') center/cover no-repeat;
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    backdrop-filter: blur(2px);
}

/* Warm cinematic light leak top-right */
.hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.18) 0%, rgba(253, 185, 39, 0.08) 40%, transparent 70%);
    pointer-events: none;
    animation: heroGlow 6s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { opacity: 0.7; transform: translate(0, 0) scale(1); }
    100% { opacity: 1; transform: translate(-20px, 10px) scale(1.1); }
}

/* Cool blue light leak bottom-left */
.hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(29, 66, 138, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: heroGlowBlue 8s ease-in-out infinite alternate;
}

@keyframes heroGlowBlue {
    0% { opacity: 0.6; transform: translate(0, 0); }
    100% { opacity: 1; transform: translate(15px, -10px); }
}

/* Court pattern hero */
.hero-court {
    background-image:
        /* Center circle */
        radial-gradient(circle at 50% 50%, transparent 58px, rgba(255,255,255,0.03) 58px, rgba(255,255,255,0.03) 60px, transparent 60px),
        /* Center line */
        linear-gradient(90deg, transparent 49.8%, rgba(255,255,255,0.03) 49.8%, rgba(255,255,255,0.03) 50.2%, transparent 50.2%),
        /* Free throw areas */
        linear-gradient(0deg, transparent 35%, rgba(255,255,255,0.02) 35%, rgba(255,255,255,0.02) 35.5%, transparent 35.5%),
        linear-gradient(0deg, transparent 65%, rgba(255,255,255,0.02) 65%, rgba(255,255,255,0.02) 65.5%, transparent 65.5%),
        linear-gradient(135deg, rgba(4, 6, 12, 0.88) 0%, rgba(10, 14, 24, 0.78) 40%, rgba(4, 6, 12, 0.92) 100%),
        url('https://images.unsplash.com/photo-1546519638-68e109498ffc?w=1920&q=80') center/cover no-repeat;
}

.hero-content { position: relative; z-index: 1; flex: 1; }

.hero-title {
    font-family: var(--font-display);
    font-size: 3.4rem;
    letter-spacing: 5px;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.3);
}

.hero-title .accent {
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.3));
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

/* ============ FAN SPREAD SHOWCASE ============ */
.fan-spread-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    min-width: 280px;
    height: 200px;
    flex-shrink: 0;
}

.fan-card {
    width: 120px;
    aspect-ratio: 2.5/3.5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    position: absolute;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.fan-card:hover {
    transform: rotate(0deg) translateY(-20px) scale(1.1) !important;
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold), 0 0 40px rgba(253, 185, 39, 0.15);
    z-index: 10 !important;
    border-color: rgba(253, 185, 39, 0.3);
}

.fan-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fan-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 16px 6px 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.fan-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    font-size: 2rem;
    backdrop-filter: var(--glass-blur);
}

/* ============ STAT BLOCKS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-block {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.stat-block:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(255, 107, 53, 0.06);
}

.stat-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.stat-block:nth-child(1)::before { background: var(--grad-fire); }
.stat-block:nth-child(2)::before { background: var(--gold); }
.stat-block:nth-child(3)::before { background: var(--grad-blue); }
.stat-block:nth-child(4)::before { background: var(--nba-red); }

/* Stat icons - sleek gradient circles with inner shadows */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
    position: relative;
}

.stat-block:hover .stat-icon {
    transform: scale(1.15);
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.3); }
}

.stat-icon.fire {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25) 0%, rgba(253, 185, 39, 0.15) 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 107, 53, 0.1);
}

.stat-icon.gold {
    background: linear-gradient(135deg, rgba(253, 185, 39, 0.25) 0%, rgba(255, 152, 0, 0.15) 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.2), 0 0 15px rgba(253, 185, 39, 0.1);
}

.stat-icon.blue {
    background: linear-gradient(135deg, rgba(29, 66, 138, 0.3) 0%, rgba(45, 107, 207, 0.15) 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.2), 0 0 15px rgba(29, 66, 138, 0.1);
}

.stat-icon.red {
    background: linear-gradient(135deg, rgba(200, 16, 46, 0.25) 0%, rgba(255, 77, 106, 0.15) 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.2), 0 0 15px rgba(200, 16, 46, 0.1);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: 2px;
    line-height: 1;
    color: var(--text);
    text-shadow: 0 0 30px rgba(240, 242, 245, 0.05);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ============ SECTION ============ */
.section-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 3px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    display: inline-block;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

/* ============ CARD GRID ============ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* ============ CARD ENTRANCE ANIMATION ============ */
.card-entrance {
    animation: cardEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: calc(var(--i, 0) * 0.06s);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(4px);
    }
    to {
        filter: blur(0);
    }
}

/* ============ CARD TILE ============ */
.card-tile {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.card-tile:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        var(--shadow-lg),
        0 0 40px rgba(255, 107, 53, 0.1),
        0 0 80px rgba(253, 185, 39, 0.05);
    border-color: rgba(255, 107, 53, 0.2);
}

/* Team color tint on card tiles - glassmorphism */
.card-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--team-primary, transparent) 0%, var(--team-secondary, transparent) 100%);
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
    border-radius: var(--radius);
    transition: opacity 0.4s;
}

.card-tile:hover::before {
    opacity: 0.18;
}

/* Subtle glass sheen on hover */
.card-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    z-index: 3;
    pointer-events: none;
    transition: left 0.6s ease;
}

.card-tile:hover::after {
    left: 100%;
}

.card-tile-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2.5/3.5;
    background: var(--bg-elevated);
}

.card-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-tile:hover .card-tile-img { transform: scale(1.06); }

.card-tile-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--text-muted);
    width: 100%;
    height: 100%;
}

/* Gradient overlay on card image */
.card-tile-img-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(15, 20, 30, 0.95) 0%, rgba(15, 20, 30, 0.4) 50%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.card-tile-info { padding: 0.9rem 1rem 1rem; position: relative; z-index: 2; }

.card-tile-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.card-tile-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tile-price {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 1px;
    margin-top: 0.4rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(253, 185, 39, 0.2));
}

.card-tile-badges {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Favorite icon on tiles */
.card-tile-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    line-height: 1;
}

.card-tile-fav:hover {
    transform: scale(1.25);
    color: #ff4d6a;
    filter: drop-shadow(0 0 8px rgba(255, 77, 106, 0.4));
}

.card-tile-fav.active {
    color: #ff4d6a;
    animation: heartPop 0.4s ease;
    filter: drop-shadow(0 0 12px rgba(255, 77, 106, 0.5));
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Checkbox for select mode */
.card-tile-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    cursor: pointer;
}

.card-tile-checkbox input { display: none; }

.card-tile-checkbox .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: block;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-tile-checkbox input:checked + .checkmark {
    background: var(--grad-fire);
    border-color: var(--orange);
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.3);
}

.card-tile-checkbox input:checked + .checkmark::after {
    content: '\2713';
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============ RARITY TIERS ============ */
.rarity-legendary {
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(15, 20, 30, 0.7), rgba(15, 20, 30, 0.7)),
        linear-gradient(135deg, #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 300% 300%;
    animation: legendaryGlow 3s ease-in-out infinite, legendaryBorderRotate 4s linear infinite;
    box-shadow:
        0 0 25px rgba(253, 185, 39, 0.35),
        0 0 60px rgba(255, 107, 53, 0.2),
        0 0 100px rgba(253, 185, 39, 0.1);
}

@keyframes legendaryGlow {
    0%, 100% {
        box-shadow:
            0 0 25px rgba(253, 185, 39, 0.35),
            0 0 60px rgba(255, 107, 53, 0.2),
            0 0 100px rgba(253, 185, 39, 0.1);
    }
    50% {
        box-shadow:
            0 0 35px rgba(253, 185, 39, 0.5),
            0 0 80px rgba(255, 107, 53, 0.3),
            0 0 120px rgba(253, 185, 39, 0.15);
    }
}

@keyframes legendaryBorderRotate {
    0% { background-position: 100% 100%, 0% 50%; }
    50% { background-position: 100% 100%, 100% 50%; }
    100% { background-position: 100% 100%, 200% 50%; }
}

.rarity-legendary .card-tile-img-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), transparent 40%, rgba(255, 107, 53, 0.12));
    z-index: 3;
    pointer-events: none;
    animation: legendaryShimmer 3s ease-in-out infinite;
}

@keyframes legendaryShimmer {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.rarity-epic {
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(15, 20, 30, 0.7), rgba(15, 20, 30, 0.7)),
        linear-gradient(135deg, #7c3aed, #a78bfa, #c084fc, #7c3aed);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.25), 0 0 50px rgba(124, 58, 237, 0.08);
}

.rarity-epic:hover {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.4), 0 0 60px rgba(124, 58, 237, 0.15), var(--shadow-lg);
}

.rarity-rare {
    border: 2px solid rgba(253, 185, 39, 0.35);
    box-shadow: 0 0 15px rgba(253, 185, 39, 0.05);
}

.rarity-rare:hover {
    border-color: rgba(253, 185, 39, 0.6);
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
}

/* ============ BADGES ============ */
.badge {
    font-size: 0.62rem;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(8px);
}

.badge:hover {
    transform: scale(1.08);
}

.badge-rc {
    background: rgba(200, 16, 46, 0.15);
    color: #ff4d6a;
    border: 1px solid rgba(200, 16, 46, 0.25);
    box-shadow: 0 0 8px rgba(200, 16, 46, 0.08);
}

.badge-auto {
    background: rgba(29, 66, 138, 0.15);
    color: #5b8def;
    border: 1px solid rgba(29, 66, 138, 0.25);
    box-shadow: 0 0 8px rgba(29, 66, 138, 0.08);
}

.badge-patch {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.25);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.08);
}

.badge-numbered {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid rgba(253, 185, 39, 0.25);
    box-shadow: 0 0 8px rgba(253, 185, 39, 0.08);
}

.badge-graded {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.25);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.08);
}

.badge-gem-mint {
    background: linear-gradient(135deg, rgba(253, 185, 39, 0.2), rgba(255, 107, 53, 0.2));
    color: var(--gold);
    border: 1px solid rgba(253, 185, 39, 0.4);
    animation: gemShine 2s ease-in-out infinite;
}

@keyframes gemShine {
    0%, 100% { box-shadow: 0 0 6px rgba(253, 185, 39, 0.3); }
    50% { box-shadow: 0 0 16px rgba(253, 185, 39, 0.5), 0 0 30px rgba(253, 185, 39, 0.15); }
}

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.filter-bar input,
.filter-bar select {
    background: rgba(4, 6, 12, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: blur(8px);
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 0 20px rgba(255, 107, 53, 0.05);
    animation: focusPulse 1.5s ease-in-out;
}

@keyframes focusPulse {
    0% { box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1); }
    50% { box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.05); }
    100% { box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1); }
}

.filter-bar input {
    flex: 1;
    min-width: 220px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    padding-left: 2.4rem;
}

.filter-bar select { cursor: pointer; }

.filter-bar .btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.2);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

/* Glass reflection effect on all buttons */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50px 50px 0 0;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.btn:hover::before {
    opacity: 1;
}

/* Button press effect */
.btn:active {
    transform: scale(0.97) !important;
}

.btn-primary {
    background: var(--grad-fire);
    color: #fff;
    font-weight: 700;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-orange);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-sm);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e5443c; box-shadow: 0 0 25px rgba(248, 81, 73, 0.25); transform: translateY(-1px); }

.btn-gold {
    background: linear-gradient(135deg, #fdb927 0%, #ff9800 100%);
    color: var(--text-inverse);
    font-weight: 700;
}
.btn-gold:hover { box-shadow: var(--shadow-glow-gold); transform: translateY(-2px); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }

.btn-pulse {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255, 107, 53, 0); }
}

/* ============ UPLOAD ZONE ============ */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.upload-label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.3px;
}

.upload-label .required { color: var(--nba-red); font-weight: 800; }
.upload-label .optional { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }

.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--orange);
    background: rgba(255, 107, 53, 0.05);
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.08), inset 0 0 30px rgba(255, 107, 53, 0.03);
}

.upload-zone.has-file {
    border-color: var(--success);
    border-style: solid;
    box-shadow: 0 0 20px rgba(63, 185, 80, 0.1);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.upload-text { color: var(--text-secondary); font-size: 0.85rem; }
.upload-text strong { color: var(--orange); }

.upload-preview {
    max-height: 180px;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    display: none;
    object-fit: contain;
}

.upload-preview.visible { display: block; }

/* ============ 3D CARD FLIP ============ */
.card-flip-container {
    perspective: 1200px;
    width: 360px;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.card-flip {
    position: relative;
    width: 100%;
    aspect-ratio: 2.5/3.5;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    cursor: pointer;
}

.card-flip.flipped { transform: rotateY(180deg); }

.card-flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.3);
}

.card-flip-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-flip-back { transform: rotateY(180deg); }

.flip-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Light reflection overlay */
.light-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
    border-radius: var(--radius);
}

/* ============ GRADING SLABS ============ */
/* PSA - Red slab case glow */
.slab-psa .card-flip-face {
    border: 3px solid #c8102e;
    box-shadow:
        var(--shadow-lg),
        0 0 20px rgba(200, 16, 46, 0.3),
        0 0 50px rgba(200, 16, 46, 0.1),
        inset 0 0 20px rgba(200, 16, 46, 0.05);
}

.slab-psa .card-flip-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* BGS - Blue slab case glow */
.slab-bgs .card-flip-face {
    border: 3px solid #1d428a;
    box-shadow:
        var(--shadow-lg),
        0 0 20px rgba(29, 66, 138, 0.3),
        0 0 50px rgba(29, 66, 138, 0.1),
        inset 0 0 20px rgba(29, 66, 138, 0.05);
}

.slab-bgs .card-flip-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* SGC - Green slab case glow */
.slab-sgc .card-flip-face {
    border: 3px solid #00874a;
    box-shadow:
        var(--shadow-lg),
        0 0 20px rgba(0, 135, 74, 0.3),
        0 0 50px rgba(0, 135, 74, 0.1),
        inset 0 0 20px rgba(0, 135, 74, 0.05);
}

.slab-sgc .card-flip-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.slab-gem-mint .card-flip-face {
    animation: gemMintShimmer 3s ease-in-out infinite;
}

@keyframes gemMintShimmer {
    0%, 100% {
        box-shadow:
            var(--shadow-lg),
            0 0 25px rgba(253, 185, 39, 0.35),
            0 0 60px rgba(253, 185, 39, 0.1);
    }
    50% {
        box-shadow:
            var(--shadow-lg),
            0 0 40px rgba(253, 185, 39, 0.5),
            0 0 80px rgba(255, 107, 53, 0.2),
            0 0 120px rgba(253, 185, 39, 0.08);
    }
}

/* ============ DETAIL PAGE ============ */
.detail-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.detail-fields { display: grid; gap: 0; }

.detail-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s;
}

.detail-field:hover {
    background: rgba(255, 255, 255, 0.02);
}

.detail-field:last-child { border-bottom: none; }

.detail-field-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.detail-field-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============ GRADING SECTION ============ */
.grading-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.grading-form .form-row {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ============ PRICE BOX ============ */
.price-box {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(253, 185, 39, 0.15);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    margin-top: 1.25rem;
    position: relative;
    overflow: hidden;
}

.price-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--orange), var(--gold));
    background-size: 200% 100%;
    animation: priceBarShine 3s linear infinite;
}

@keyframes priceBarShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Price glow behind the number */
.price-box::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(253, 185, 39, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.price-main {
    font-family: var(--font-display);
    font-size: 3.2rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 50%, var(--gold) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: priceGradient 4s ease-in-out infinite;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 20px rgba(253, 185, 39, 0.2));
}

@keyframes priceGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.price-range {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
}

/* ============ PRICE SOURCE BREAKDOWN ============ */
.source-bar-group {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: border-color 0.3s;
}

.source-bar-group:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.source-bar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.source-bar-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.source-name {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 80px;
    letter-spacing: 0.3px;
}

.source-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(4, 6, 12, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.source-bar-fill {
    height: 100%;
    background: var(--grad-fire);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}

.source-median {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    min-width: 70px;
    text-align: right;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.source-toggle {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.source-bar-group.expanded .source-toggle {
    transform: rotate(180deg);
}

.source-sales-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-top: 1px solid var(--border-subtle);
}

.source-bar-group.expanded .source-sales-list {
    max-height: 500px;
}

.source-sale-entry {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s;
}

.source-sale-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.source-sale-entry a {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s;
}

.source-sale-entry a:hover {
    color: var(--gold);
}

/* ============ PORTFOLIO CHANGE INDICATOR ============ */
.change-up {
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(63, 185, 80, 0.2);
}

.change-down {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(248, 81, 73, 0.2);
}

/* ============ CHARTS ============ */
.chart-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container canvas { max-height: 300px; }

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ============ FORMS ============ */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    background: rgba(4, 6, 12, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: blur(4px);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 0 20px rgba(255, 107, 53, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
    cursor: pointer;
}

/* ============ ANALYSIS RESULT ============ */
.analysis-result {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    display: none;
}

.analysis-result.visible {
    display: block;
    animation: analysisReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes analysisReveal {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ SKELETON LOADING ============ */
.skeleton-card {
    pointer-events: none;
}

.skeleton-shimmer {
    background: linear-gradient(90deg,
        rgba(15, 20, 30, 0.6) 25%,
        rgba(30, 38, 56, 0.5) 50%,
        rgba(15, 20, 30, 0.6) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ LOADING SPINNER ============ */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 12, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner-overlay.visible { display: flex; }

.basketball-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--grad-fire);
    position: relative;
    animation: spin-bounce 1s infinite ease-in-out;
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.4), 0 0 80px rgba(255, 107, 53, 0.15);
}

.basketball-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.basketball-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 70%;
    background: rgba(0, 0, 0, 0.2);
}

@keyframes spin-bounce {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.spinner-text {
    color: var(--text-secondary);
    margin-top: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 84px;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.2rem;
    min-width: 280px;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: toastIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.success {
    border-left: 3px solid var(--success);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(63, 185, 80, 0.08);
}

.toast.error {
    border-left: 3px solid var(--danger);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(248, 81, 73, 0.08);
}

.toast.info {
    border-left: 3px solid var(--nba-blue);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(29, 66, 138, 0.08);
}

@keyframes toastIn {
    from { transform: translateX(120%) scale(0.8); opacity: 0; }
    60% { transform: translateX(-5%); }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.empty-state p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

/* Enhanced empty state */
.empty-state-enhanced {
    padding: 4rem 2rem;
}

.empty-basketball-bounce {
    animation: emptyBounce 2s ease-in-out infinite;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
}

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

.onboarding-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.onboarding-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.onboarding-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.onboarding-icon:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-glow-orange), 0 0 40px rgba(255, 107, 53, 0.1);
}

.onboarding-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    letter-spacing: 0.3px;
}

.onboarding-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
    margin-top: -1.5rem;
}

/* Collection empty state */
.empty-card-outline {
    width: 120px;
    height: 170px;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius);
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cardOutlinePulse 2.5s ease-in-out infinite;
    backdrop-filter: blur(4px);
}

.empty-card-plus {
    font-size: 3rem;
    color: var(--text-muted);
    font-weight: 200;
}

@keyframes cardOutlinePulse {
    0%, 100% { border-color: var(--glass-border); transform: scale(1); }
    50% { border-color: rgba(255, 107, 53, 0.25); transform: scale(1.03); box-shadow: 0 0 20px rgba(255, 107, 53, 0.05); }
}

/* ============ INLINE EDIT ============ */
.editable {
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xs);
    transition: background 0.2s, box-shadow 0.2s;
}

.editable:hover {
    background: var(--bg-hover);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.edit-input {
    background: rgba(4, 6, 12, 0.8);
    border: 1px solid var(--orange);
    color: var(--text);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: inherit;
    font-family: var(--font-body);
    width: 100%;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 0 15px rgba(255, 107, 53, 0.05);
    backdrop-filter: blur(4px);
}

/* ============ ACTIONS BAR ============ */
.actions-bar {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ============ BATCH ACTION BAR ============ */
.batch-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.3);
    z-index: 200;
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.batch-bar.visible {
    bottom: 24px;
}

.batch-count {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--orange);
    margin-right: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

/* ============ SUCCESS OVERLAY ============ */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 12, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.success-overlay.visible { display: flex; }

.success-content {
    text-align: center;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    from { transform: scale(0.7); opacity: 0; filter: blur(8px); }
    to { transform: scale(1); opacity: 1; filter: blur(0); }
}

.success-checkmark {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #2ea043);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1.5rem;
    animation: checkBounce 0.6s ease 0.3s;
    box-shadow: 0 0 40px rgba(63, 185, 80, 0.3), 0 0 80px rgba(63, 185, 80, 0.1);
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.success-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(240, 242, 245, 0.1);
}

.success-card-img {
    width: 200px;
    aspect-ratio: 2.5/3.5;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--glass-border);
    margin: 1rem auto;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.3);
    animation: cardReveal 0.6s ease 0.2s backwards;
}

@keyframes cardReveal {
    from { transform: translateY(30px) rotateY(90deg); opacity: 0; }
    to { transform: translateY(0) rotateY(0); opacity: 1; }
}

.success-card-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.session-counter {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.success-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 12, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.modal-overlay.visible { display: flex; }

.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 440px;
    width: 90%;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.modal p { color: var(--text-secondary); }

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    .hero { flex-direction: column; text-align: center; }
    .hero-subtitle { max-width: 100%; }
    .fan-spread-container { display: none !important; }
    .grading-form .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .nav { padding: 0 1rem; gap: 1rem; }
    .nav-brand-text { font-size: 1.4rem; letter-spacing: 3px; }
    .container { padding: 1.25rem 1rem 3rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .form-row { grid-template-columns: 1fr; }
    .filter-bar {
        flex-direction: column;
        padding: 0.75rem;
    }
    .filter-bar input { min-width: 0; width: 100%; }
    .upload-grid { grid-template-columns: 1fr; }
    .hero {
        padding: 2rem 1.5rem;
        background-size: cover;
    }
    .hero-title { font-size: 2.2rem; letter-spacing: 3px; }
    .page-header h1 { font-size: 2rem; }
    .onboarding-steps { flex-wrap: wrap; }
    .batch-bar { border-radius: var(--radius); width: calc(100% - 2rem); }
    .price-main { font-size: 2.5rem; }
    .stat-value { font-size: 2rem; }
}

/* ============ SELECTION / UTILITY ============ */
::selection {
    background: rgba(255, 107, 53, 0.3);
    color: var(--text);
}

/* Smooth focus outlines */
:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Link defaults */
a {
    transition: color 0.2s ease;
}

/* ============ DREAM LIST ============ */
.dream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dream-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dream-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Priority accent bar */
.dream-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.dream-card.priority-must::before {
    background: linear-gradient(90deg, #ff6b35, #fdb927);
}
.dream-card.priority-want::before {
    background: linear-gradient(90deg, #1d428a, #2d6bcf);
}
.dream-card.priority-nice::before {
    background: linear-gradient(90deg, #3fb950, #2ea043);
}

/* Priority label */
.dream-card-priority {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

.priority-must .dream-card-priority {
    background: rgba(255, 107, 53, 0.2);
    color: #ff8c5a;
    border: 1px solid rgba(255, 107, 53, 0.3);
}
.priority-want .dream-card-priority {
    background: rgba(29, 66, 138, 0.2);
    color: #5b9aff;
    border: 1px solid rgba(29, 66, 138, 0.3);
}
.priority-nice .dream-card-priority {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.2);
}

/* Image */
.dream-card-img-wrap {
    height: 200px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-subtle);
}

.dream-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dream-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

/* Info */
.dream-card-info {
    padding: 1rem;
}

.dream-card-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.dream-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.dream-card-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    letter-spacing: 0.5px;
    margin-top: 0.4rem;
}

.dream-card-badges {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.dream-card-notes {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 2px solid var(--gold-dim);
}

/* Actions */
.dream-card-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0 1rem 1rem;
}

/* Acquired state */
.dream-acquired {
    opacity: 0.55;
    position: relative;
}

.dream-acquired::after {
    content: 'OBTENUE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 4px;
    color: var(--success);
    border: 3px solid var(--success);
    padding: 0.3rem 1.5rem;
    border-radius: 8px;
    pointer-events: none;
    z-index: 3;
}

/* Dream modal specific */
.dream-modal {
    max-width: 560px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.dream-modal textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    resize: vertical;
}

.dream-modal textarea:focus {
    outline: none;
    border-color: var(--gold);
}

/* Dream filter buttons */
.dream-filter {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
}

.dream-filter.active {
    background: var(--gold-dim);
    color: var(--gold);
    border-color: rgba(253, 185, 39, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .dream-grid {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html { scroll-behavior: auto; }
}
