/* ============================================
   Trading Card Game - Main Stylesheet
   LAMP Stack Implementation
   ============================================ */

/* ============================================
   CSS Variables & Theme
   ============================================ */
:root {
    /* Colors */
    --color-bg: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-card: #1a1a24;
    --color-text: #e5e5e5;
    --color-text-muted: #888;
    --color-border: #2a2a3a;
    --color-accent: #6366f1;
    --color-accent-hover: #818cf8;

    /* Rarity Colors */
    --rarity-common: #9CA3AF;
    --rarity-uncommon: #10B981;
    --rarity-rare: #3B82F6;
    --rarity-epic: #8B5CF6;
    --rarity-legendary: #F59E0B;
    --rarity-mythic: #EC4899;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ============================================
   Background Layers
   ============================================ */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.background-texture {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    opacity: 1;
    animation: background-pulse 20s ease-in-out infinite;
}

@keyframes background-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.background-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center top, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        linear-gradient(
            180deg,
            rgba(8, 8, 12, 0.95) 0%,
            rgba(10, 10, 15, 0.98) 50%,
            rgba(12, 12, 18, 1) 100%
        );
}

/* ============================================
   Header
   ============================================ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-xl);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    animation: pulse 2s ease-in-out infinite;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-muted);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.nav-link.active {
    color: var(--color-accent);
    background: rgba(99, 102, 241, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.balance-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow:
        0 2px 10px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.balance-amount {
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 1.1rem;
    background: linear-gradient(135deg, #FEF3C7 0%, #F59E0B 50%, #D97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info .username {
    font-weight: 500;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    min-height: 100vh;
    padding-top: 80px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    min-height: calc(100vh - 80px);
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.hero-description {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Rainbow Text Animation */
.rainbow-text {
    background: linear-gradient(
        90deg,
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-shift 3s linear infinite;
}

/* Rainbow Scrolling Text - Continuous Left-to-Right Animation */
.rainbow-scroll {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-scroll 3s linear infinite;
}

@keyframes rainbow-scroll {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.rainbow-gradient-bg {
    background: linear-gradient(
        90deg,
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   Glass Card Effect
   ============================================ */
.glass-card {
    background: linear-gradient(165deg, rgba(35, 35, 50, 0.8) 0%, rgba(20, 20, 30, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
}

.glass-card-glow {
    background: linear-gradient(165deg, rgba(35, 35, 50, 0.8) 0%, rgba(20, 20, 30, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Glass Header */
.main-header.glass-header {
    background: linear-gradient(180deg, rgba(20, 20, 30, 0.9) 0%, rgba(10, 10, 15, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.main-header.glass-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

/* Glass Button */
.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Glass Input */
.glass-input {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.glass-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Floating Cards Visual */
.hero-visual {
    position: relative;
    height: 320px;
    perspective: 1000px;
}

.floating-card {
    position: absolute;
    width: 180px;
    height: 250px;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.floating-cards {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 250px;
}

.floating-card.card-1 {
    top: 0;
    left: 0;
    transform: rotate(0deg);
    transform-origin: 50% 95%;
    z-index: 3;
    animation: floatCard1 5s ease-in-out infinite;
}

.floating-card.card-2 {
    top: 0;
    left: 0;
    transform: rotate(-6deg);
    transform-origin: 50% 95%;
    z-index: 2;
    animation: floatCard2 6s ease-in-out infinite;
}

.floating-card.card-3 {
    top: 0;
    left: 0;
    transform: rotate(6deg);
    transform-origin: 50% 95%;
    animation-delay: -4s;
    z-index: 1;
}

.floating-card[data-rarity="mythic"] {
    border: 2px solid var(--rarity-mythic);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.4);
}

.floating-card[data-rarity="legendary"] {
    border: 2px solid var(--rarity-legendary);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}

.floating-card[data-rarity="epic"] {
    border: 2px solid var(--rarity-epic);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.floating-card .card-inner {
    padding: var(--space-md);
    text-align: center;
}

.floating-card .card-face {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.floating-card .card-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #818CF8 0%, #6366F1 50%, #7C3AED 100%);
    color: white;
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #A5B4FC 0%, #818CF8 50%, #8B5CF6 100%);
}

.btn-accent {
    background: linear-gradient(135deg, #9333EA 0%, #7C3AED 50%, #6D28D9 100%);
    color: white;
    box-shadow:
        0 4px 15px rgba(147, 51, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(147, 51, 234, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #A855F7 0%, #9333EA 50%, #7C3AED 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-small {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
}

.btn-buy {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    box-shadow:
        0 4px 15px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.btn-buy:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 8px 25px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #4ADE80 0%, #10B981 100%);
}

.btn-buy:active {
    transform: translateY(0) scale(1);
}

.btn-buy:disabled,
.btn-buy.btn-disabled {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
    box-shadow: none;
}

.cta-button {
    position: relative;
}

.cta-button .btn-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg,
        var(--rarity-mythic),
        var(--rarity-legendary),
        var(--rarity-epic),
        var(--rarity-rare)
    );
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(8px);
    transition: opacity var(--transition-normal);
}

.cta-button:hover .btn-glow {
    opacity: 0.6;
    animation: glow-pulse 1.5s ease-in-out infinite;
}

/* ============================================
   Features Section
   ============================================ */
.features {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    color: var(--color-accent);
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.feature-description {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* ============================================
   Rarity Showcase
   ============================================ */
.rarity-showcase {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.rarity-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

.rarity-item {
    flex: 0 1 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.rarity-item:hover {
    border-color: var(--rarity-color);
    box-shadow: 0 0 15px color-mix(in srgb, var(--rarity-color) 30%, transparent);
}

.rarity-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.rarity-badge.common {
    background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
    color: #1a1a24;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.rarity-badge.uncommon {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.rarity-badge.rare {
    background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}
.rarity-badge.epic {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.5);
}
.rarity-badge.legendary {
    background: linear-gradient(135deg, #FCD34D 0%, #D97706 100%);
    color: #1a1a24;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 15px rgba(245, 158, 11, 0.5);
    animation: legendary-pulse 2s ease-in-out infinite;
}
.rarity-badge.mythic {
    background: linear-gradient(135deg, #F472B6 0%, #DB2777 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 18px rgba(236, 72, 153, 0.6);
    animation: mythic-glow 1.5s ease-in-out infinite alternate;
}

@keyframes legendary-pulse {
    0%, 100% { box-shadow: 0 2px 15px rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 2px 25px rgba(245, 158, 11, 0.7); }
}

@keyframes mythic-glow {
    0% { box-shadow: 0 2px 18px rgba(236, 72, 153, 0.6); }
    100% { box-shadow: 0 2px 30px rgba(236, 72, 153, 0.8), 0 0 40px rgba(236, 72, 153, 0.4); }
}

.rarity-rate {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ============================================
   Marketplace Page
   ============================================ */
.marketplace {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
}

.page-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

/* Low Balance Banner */
.low-balance-banner {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
    border-color: var(--rarity-legendary);
}

.low-balance-banner .banner-icon {
    font-size: 2rem;
}

.low-balance-banner .banner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.low-balance-banner .banner-content strong {
    color: var(--rarity-legendary);
}

.low-balance-banner .banner-content span {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

@media (max-width: 600px) {
    .low-balance-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: var(--color-accent);
    color: var(--color-text);
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.filter-select,
.filter-input {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.875rem;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.agent-count {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label .checkmark {
    width: 18px;
    height: 18px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.checkbox-label:hover .checkmark {
    border-color: var(--color-accent);
}

/* ============================================
   Agent Cards Grid
   ============================================ */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.agent-card {
    position: relative;
    background: linear-gradient(165deg, rgba(30, 30, 45, 0.9) 0%, rgba(20, 20, 30, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.agent-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.agent-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.agent-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    /* Base hover - JS overrides with tilt */
    transform: translateY(-8px) scale(1.02);
}

.agent-card[data-rarity="common"] {
    border-color: rgba(156, 163, 175, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(156, 163, 175, 0.1);
}
.agent-card[data-rarity="uncommon"] {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(16, 185, 129, 0.1);
}
.agent-card[data-rarity="rare"] {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 25px rgba(59, 130, 246, 0.15);
}
.agent-card[data-rarity="epic"] {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 30px rgba(139, 92, 246, 0.2);
}
.agent-card[data-rarity="legendary"] {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 35px rgba(245, 158, 11, 0.25);
}
.agent-card[data-rarity="mythic"] {
    border-color: rgba(236, 72, 153, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 40px rgba(236, 72, 153, 0.3);
    background: linear-gradient(165deg, rgba(40, 25, 45, 0.95) 0%, rgba(25, 15, 30, 0.98) 100%);
}

.agent-card[data-rarity="common"]:hover {
    border-color: var(--rarity-common);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(156, 163, 175, 0.3);
}
.agent-card[data-rarity="uncommon"]:hover {
    border-color: var(--rarity-uncommon);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(16, 185, 129, 0.35);
}
.agent-card[data-rarity="rare"]:hover {
    border-color: var(--rarity-rare);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(59, 130, 246, 0.4);
}
.agent-card[data-rarity="epic"]:hover {
    border-color: var(--rarity-epic);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(139, 92, 246, 0.45);
}
.agent-card[data-rarity="legendary"]:hover {
    border-color: var(--rarity-legendary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 70px rgba(245, 158, 11, 0.5);
}
.agent-card[data-rarity="mythic"]:hover {
    border-color: var(--rarity-mythic);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 80px rgba(236, 72, 153, 0.55);
}

/* Holographic Effect - Premium */
.card-holographic {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            125deg,
            transparent 0%,
            rgba(255, 0, 0, 0.03) 10%,
            rgba(255, 154, 0, 0.05) 20%,
            rgba(208, 222, 33, 0.05) 30%,
            rgba(79, 220, 74, 0.05) 40%,
            rgba(63, 218, 216, 0.05) 50%,
            rgba(47, 201, 226, 0.05) 60%,
            rgba(28, 127, 238, 0.05) 70%,
            rgba(95, 21, 242, 0.05) 80%,
            rgba(186, 12, 248, 0.03) 90%,
            transparent 100%
        );
    background-size: 300% 300%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

.card-holographic::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.agent-card:hover .card-holographic {
    opacity: 1;
    animation: holographic-rainbow 3s ease-in-out infinite;
}

.agent-card:hover .card-holographic::after {
    opacity: 1;
    animation: holographic-shine 2s ease-in-out infinite;
}

@keyframes holographic-rainbow {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

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

/* Rarity-specific holographic intensity */
.agent-card[data-rarity="epic"] .card-holographic,
.agent-card[data-rarity="legendary"] .card-holographic,
.agent-card[data-rarity="mythic"] .card-holographic {
    background:
        linear-gradient(
            125deg,
            transparent 0%,
            rgba(255, 0, 0, 0.06) 10%,
            rgba(255, 154, 0, 0.08) 20%,
            rgba(208, 222, 33, 0.08) 30%,
            rgba(79, 220, 74, 0.08) 40%,
            rgba(63, 218, 216, 0.08) 50%,
            rgba(47, 201, 226, 0.08) 60%,
            rgba(28, 127, 238, 0.08) 70%,
            rgba(95, 21, 242, 0.08) 80%,
            rgba(186, 12, 248, 0.06) 90%,
            transparent 100%
        );
    background-size: 300% 300%;
}

/* Legendary+ cards: always-on holographic shine */
.agent-card[data-rarity="legendary"] .card-holographic,
.agent-card[data-rarity="mythic"] .card-holographic {
    opacity: 1;
    animation: holographic-rainbow 4s ease-in-out infinite;
    background:
        linear-gradient(
            125deg,
            transparent 0%,
            rgba(255, 50, 50, 0.1) 10%,
            rgba(255, 180, 0, 0.14) 20%,
            rgba(220, 240, 50, 0.12) 30%,
            rgba(50, 240, 80, 0.12) 40%,
            rgba(50, 220, 240, 0.14) 50%,
            rgba(50, 130, 255, 0.12) 60%,
            rgba(130, 50, 255, 0.12) 70%,
            rgba(220, 30, 255, 0.1) 80%,
            rgba(255, 50, 150, 0.08) 90%,
            transparent 100%
        );
    background-size: 300% 300%;
}

.agent-card[data-rarity="legendary"] .card-holographic::after,
.agent-card[data-rarity="mythic"] .card-holographic::after {
    opacity: 1;
    animation: holographic-gloss 3s ease-in-out infinite;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.06) 35%,
        rgba(255, 255, 255, 0.18) 42%,
        rgba(255, 255, 255, 0.06) 49%,
        transparent 65%
    );
    background-size: 250% 100%;
}

@keyframes holographic-gloss {
    0% { background-position: 250% 0; }
    100% { background-position: -250% 0; }
}

/* Mythic gets extra intense */
.agent-card[data-rarity="mythic"] .card-holographic {
    background:
        linear-gradient(
            125deg,
            transparent 0%,
            rgba(255, 50, 100, 0.15) 10%,
            rgba(255, 200, 0, 0.18) 20%,
            rgba(100, 255, 100, 0.16) 35%,
            rgba(50, 200, 255, 0.18) 50%,
            rgba(150, 50, 255, 0.16) 65%,
            rgba(255, 50, 200, 0.15) 80%,
            transparent 100%
        );
    background-size: 300% 300%;
    animation: holographic-rainbow 3s ease-in-out infinite;
}

.agent-card .rarity-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 5;
}

.card-content {
    padding: var(--space-lg);
    position: relative;
    z-index: 3;
}

.card-face-container {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.agent-card:hover .card-face-container {
    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.agent-card[data-rarity="epic"] .card-face-container {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 92, 246, 0.2);
}

.agent-card[data-rarity="legendary"] .card-face-container {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 25px rgba(245, 158, 11, 0.25);
}

.agent-card[data-rarity="mythic"] .card-face-container {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 30px rgba(236, 72, 153, 0.3);
}

.face-canvas {
    border-radius: 50%;
}

.agent-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-xs);
    background: linear-gradient(180deg, #ffffff 0%, #c0c0c0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.agent-card[data-rarity="legendary"] .agent-name {
    background: linear-gradient(180deg, #FEF3C7 0%, #F59E0B 50%, #D97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.agent-card[data-rarity="mythic"] .agent-name {
    background: linear-gradient(180deg, #FBCFE8 0%, #EC4899 50%, #DB2777 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.agent-type {
    font-size: 0.8rem;
    color: var(--color-accent);
    text-align: center;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.agent-description {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Agent Stats */
.agent-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.agent-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    min-width: 50px;
}

.agent-stats .stat-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.agent-stats .stat-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text);
    font-family: var(--font-display);
}

.agent-ability {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.agent-ability .ability-label {
    color: var(--rarity-rare);
    font-weight: 600;
}

/* World Stats Display */
.agent-world-stats {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.world-stat {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-family: var(--font-display);
}

.world-stat.power {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.world-stat.defense {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.world-stat.gather {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Ability Info Display */
.agent-ability-info {
    text-align: center;
    margin-bottom: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.03));
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.ability-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rarity-rare);
    margin-bottom: 0.125rem;
}

.ability-benefit {
    display: block;
    font-size: 0.65rem;
    color: var(--color-text);
    font-weight: 500;
}

/* Power Badge for Elite Agents */
.power-badge {
    position: absolute;
    top: 2.5rem;
    right: 0.5rem;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.4rem;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: elitePulse 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes elitePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(255, 215, 0, 0.7); }
}

/* Quantity Remaining Badge */
.quantity-remaining {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.9) 0%, rgba(20, 20, 30, 0.95) 100%);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text);
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.quantity-remaining.depleted {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(185, 28, 28, 0.95) 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* Sold Out Card State */
.agent-card.sold-out {
    opacity: 0.7;
}

.agent-card.sold-out::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    pointer-events: none;
    z-index: 1;
}

.agent-card.sold-out .card-holographic {
    display: none;
}

/* Enhanced Holographic Effect - Faint */
.card-holographic {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 15%,
        rgba(147, 197, 253, 0.05) 30%,
        rgba(196, 181, 253, 0.05) 45%,
        rgba(252, 211, 77, 0.05) 60%,
        rgba(255, 255, 255, 0.03) 75%,
        transparent 100%
    );
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    z-index: 1;
}

.agent-card:hover .card-holographic {
    opacity: 1;
    animation: holographic-faint 4s linear infinite;
}

@keyframes holographic-faint {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Card Hover Float Effect */
.agent-card {
    transition: all var(--transition-normal), transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.agent-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
    margin-left: calc(-1 * var(--space-lg));
    margin-right: calc(-1 * var(--space-lg));
    margin-bottom: calc(-1 * var(--space-lg));
    padding: var(--space-md) var(--space-lg);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.agent-price {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FEF3C7 0%, #F59E0B 50%, #D97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ============================================
   Card Packs
   ============================================ */
.packs-intro {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2xl);
}

.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-xl);
}

.pack-card {
    position: relative;
    background: linear-gradient(165deg, rgba(35, 35, 55, 0.9) 0%, rgba(20, 20, 35, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pack-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.pack-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 50px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.pack-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    animation: pack-glow-rotate 10s linear infinite;
}

.pack-card:hover .pack-glow {
    opacity: 1;
}

@keyframes pack-glow-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pack-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--color-accent), var(--rarity-epic));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow:
        0 8px 25px rgba(99, 102, 241, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.pack-card:hover .pack-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow:
        0 15px 40px rgba(99, 102, 241, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.pack-icon::before {
    content: "📦";
}

.pack-card[data-pack="starter"] .pack-icon {
    background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
    box-shadow: 0 8px 25px rgba(156, 163, 175, 0.3);
}
.pack-card[data-pack="standard"] .pack-icon {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}
.pack-card[data-pack="premium"] .pack-icon {
    background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}
.pack-card[data-pack="elite"] .pack-icon {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}
.pack-card[data-pack="legendary"] .pack-icon {
    background: linear-gradient(135deg, #FCD34D 0%, #D97706 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    animation: legendary-icon-pulse 2s ease-in-out infinite;
}

@keyframes legendary-icon-pulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 8px 35px rgba(245, 158, 11, 0.6), 0 0 50px rgba(245, 158, 11, 0.3); }
}

.pack-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.pack-description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.pack-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    font-size: 0.8125rem;
}

.pack-cards-count {
    color: var(--color-text);
}

.pack-guaranteed {
    color: var(--rarity-rare);
}

.pack-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    margin-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
    gap: var(--space-md);
}

.pack-price {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FEF3C7 0%, #F59E0B 50%, #D97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-buy-pack {
    background: linear-gradient(135deg, #818CF8 0%, #6366F1 50%, #7C3AED 100%);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-buy-pack:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 8px 25px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #A5B4FC 0%, #818CF8 50%, #8B5CF6 100%);
}

/* ============================================
   Wallet Page
   ============================================ */
.wallet-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.stat-icon {
    font-size: 2rem;
    color: var(--color-accent);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Rarity Breakdown */
.rarity-breakdown {
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.breakdown-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.breakdown-bars {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
}

.breakdown-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Collection Section */
.collection-section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.collection-filters {
    display: flex;
    gap: var(--space-md);
}

.owned-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.owned-agent-card {
    position: relative;
    background: linear-gradient(165deg, rgba(30, 30, 45, 0.9) 0%, rgba(20, 20, 30, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    will-change: transform;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.owned-agent-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.owned-agent-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.2);
}

.owned-agent-card .card-holographic {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            125deg,
            transparent 0%,
            rgba(255, 0, 0, 0.03) 10%,
            rgba(255, 154, 0, 0.05) 20%,
            rgba(208, 222, 33, 0.05) 30%,
            rgba(79, 220, 74, 0.05) 40%,
            rgba(63, 218, 216, 0.05) 50%,
            rgba(47, 201, 226, 0.05) 60%,
            rgba(28, 127, 238, 0.05) 70%,
            rgba(95, 21, 242, 0.05) 80%,
            rgba(186, 12, 248, 0.03) 90%,
            transparent 100%
        );
    background-size: 300% 300%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

.owned-agent-card:hover .card-holographic {
    opacity: 1;
    animation: holographic-rainbow 3s ease-in-out infinite;
}

.owned-agent-card[data-rarity="common"]:hover { border-color: var(--rarity-common); }
.owned-agent-card[data-rarity="uncommon"]:hover { border-color: var(--rarity-uncommon); }
.owned-agent-card[data-rarity="rare"]:hover { border-color: var(--rarity-rare); }
.owned-agent-card[data-rarity="epic"]:hover { border-color: var(--rarity-epic); }
.owned-agent-card[data-rarity="legendary"]:hover { border-color: var(--rarity-legendary); }
.owned-agent-card[data-rarity="mythic"]:hover { border-color: var(--rarity-mythic); }

/* Legendary+ owned cards: always-on holo */
.owned-agent-card[data-rarity="legendary"] .card-holographic,
.owned-agent-card[data-rarity="mythic"] .card-holographic {
    opacity: 1;
    animation: holographic-rainbow 4s ease-in-out infinite;
}

.owned-agent-card[data-rarity="legendary"] {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 25px rgba(245, 158, 11, 0.15);
}

.owned-agent-card[data-rarity="mythic"] {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 30px rgba(236, 72, 153, 0.2);
}

.quantity-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.owned-agent-card .rarity-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    z-index: 2;
    font-size: 0.65rem;
    padding: 2px 8px;
}

.owned-agent-card .card-content {
    padding: var(--space-md);
}

.owned-agent-card .card-face-container {
    width: 80px;
    height: 80px;
}

.owned-agent-card .agent-name {
    font-size: 0.9375rem;
}

.card-value {
    text-align: center;
    font-size: 0.875rem;
    color: var(--rarity-legendary);
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

/* Transactions */
.transactions-section {
    margin-bottom: var(--space-2xl);
}

.transactions-list {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.transaction-type {
    font-weight: 600;
    text-transform: capitalize;
}

.transaction-description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.transaction-amount {
    font-family: var(--font-display);
    font-weight: 700;
}

.transaction-amount.negative {
    color: #ef4444;
}

.transaction-amount.positive {
    color: var(--rarity-uncommon);
}

.transaction-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ============================================
   Profile Page
   ============================================ */
.profile-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-2xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 100px;
    height: 100px;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-accent), var(--rarity-epic));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.profile-info {
    text-align: center;
}

.profile-username {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.profile-email {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.profile-member-since {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.profile-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
}

.profile-balance .balance-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.profile-balance .balance-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rarity-legendary);
}

.profile-placeholder {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.profile-placeholder h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.profile-placeholder p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.upcoming-features {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
}

.upcoming-features li {
    padding: var(--space-xs) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.quick-links {
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.quick-links h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.quick-link-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--color-accent);
}

.link-icon {
    font-size: 1.5rem;
}

.link-text {
    font-weight: 500;
    color: var(--color-text);
}

/* ============================================
   Loading States
   ============================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-md);
}

/* ============================================
   Notifications
   ============================================ */
.notification {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.notification.hidden {
    display: none;
}

.notification.success {
    border-color: var(--rarity-uncommon);
}

.notification.error {
    border-color: #ef4444;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: var(--space-xl);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

/* Pack Opening Animation */
#pack-modal .modal-content {
    max-width: 720px;
    max-height: 95vh;
    background: radial-gradient(ellipse at center, #1a1835 0%, #0f0d1a 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

#pack-modal .modal-content::-webkit-scrollbar {
    width: 4px;
}

#pack-modal .modal-content::-webkit-scrollbar-track {
    background: transparent;
}

#pack-modal .modal-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.pack-opening-animation {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pack-opening-animation.hidden { display: none; }

.pack-opening-animation.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Pack Wrapper */
.pack-wrapper {
    perspective: 1200px;
    position: relative;
}

/* Glow orb behind pack */
.pack-glow-orb {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: orbPulse 3s ease-in-out infinite;
}

.pack-glow-orb.pulse-intense {
    animation: orbPulseIntense 0.8s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

@keyframes orbPulseIntense {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
}

/* Pack Foil */
.pack-foil {
    width: 200px;
    height: 290px;
    position: relative;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1647 20%, #302b63 40%, #24243e 60%, #0f0c29 100%);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    z-index: 1;
}

.pack-foil:hover {
    transform: scale(1.04) rotateY(-3deg) rotateX(2deg);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(99, 102, 241, 0.35);
}

.pack-front {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    gap: 4px;
}

.pack-emblem {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 50%;
    margin-bottom: 8px;
    position: relative;
}

.pack-emblem::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 50%;
}

.pack-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    background: linear-gradient(180deg, #fff9e6 0%, #fbbf24 40%, #d97706 80%, #92400e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.6));
}

.pack-subtitle {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.pack-edition {
    font-size: 0.55rem;
    color: rgba(251, 191, 36, 0.5);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Pack border glow */
.pack-border-glow {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    pointer-events: none;
    z-index: 5;
}

.pack-tear-line {
    position: absolute;
    top: 0;
    right: 28px;
    width: 2px;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px, transparent 6px,
        rgba(255, 255, 255, 0.25) 6px, rgba(255, 255, 255, 0.25) 10px
    );
    z-index: 3;
}

.pack-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.05) 30%,
        rgba(255, 255, 255, 0.2) 38%,
        rgba(255, 255, 255, 0.05) 46%,
        transparent 55%
    );
    background-size: 250% 100%;
    animation: packShimmer 4s ease-in-out infinite;
    z-index: 4;
    pointer-events: none;
}

@keyframes packShimmer {
    0% { background-position: 250% 0; }
    100% { background-position: -250% 0; }
}

.tear-instruction {
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: breathe 2.5s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.tear-icon {
    font-size: 1.1rem;
    display: inline-block;
    animation: wiggle 1.5s ease-in-out infinite;
}

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

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

/* Pack Tearing */
.pack-foil.tearing {
    animation: packTear 1s ease-in-out forwards;
    cursor: default;
}

.pack-foil::after {
    content: '';
    position: absolute;
    top: 0;
    right: 24px;
    width: 12px;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,200,100,0.6) 40%, transparent 70%);
    filter: blur(3px);
    z-index: 10;
    opacity: 0;
}

.pack-foil.tearing::after {
    opacity: 1;
    animation: tearProgress 1s ease-in-out forwards;
}

@keyframes tearProgress {
    0% { height: 0; top: 0; }
    100% { height: 100%; top: 0; }
}

.pack-foil.tearing .pack-tear-line {
    animation: tearLineGlow 1s ease-in-out forwards;
}

@keyframes tearLineGlow {
    0% {
        box-shadow: none;
        clip-path: polygon(0 0, 100% 0, 100% 0%, 0 0%);
    }
    50% {
        background: linear-gradient(180deg, rgba(255,220,100,0.9) 0%, rgba(255,255,255,0.8) 50%, rgba(255,220,100,0.9) 100%);
        box-shadow: 0 0 25px rgba(255, 220, 100, 0.9), 0 0 50px rgba(255, 200, 50, 0.5);
        clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
    }
    100% {
        background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
        box-shadow: none;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes packTear {
    0% { transform: rotateY(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    25% { transform: rotateY(-3deg) scale(1.01); }
    60% { transform: rotateY(6deg) scale(0.99); clip-path: polygon(0 0, 87% 0, 84% 100%, 0 100%); }
    100% { transform: rotateY(-15deg) translateX(25px); clip-path: polygon(0 0, 84% 0, 74% 100%, 0 100%); }
}

.pack-foil.torn {
    animation: packFlyAway 0.6s ease-in forwards;
}

.pack-torn-piece {
    position: absolute;
    top: 0;
    right: 0;
    width: 65px;
    height: 100%;
    background: linear-gradient(135deg, #302b63 0%, #24243e 50%, #0f0c29 100%);
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 16% 0);
    border-radius: 0 14px 14px 0;
    animation: tornPieceFly 0.6s ease-out forwards;
    z-index: 5;
}

@keyframes tornPieceFly {
    0% { transform: translateX(0) rotate(0deg); opacity: 1; }
    100% { transform: translateX(180px) translateY(-100px) rotate(30deg); opacity: 0; }
}

@keyframes packFlyAway {
    0% { transform: rotateY(-15deg) translateX(25px); opacity: 1; }
    100% { transform: rotateY(-30deg) translateX(-100px) translateY(40px) scale(0.6); opacity: 0; }
}

/* Screen flash for rare pulls - sits behind modal content */
.screen-flash {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: screenFlash 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 0;
    border-radius: var(--radius-lg);
}

@keyframes screenFlash {
    0% { opacity: 0; }
    10% { opacity: 0.5; }
    30% { opacity: 0.2; }
    100% { opacity: 0; }
}

/* Overlay pulse for legendary reveals (no transform - preserves 3D flip) */
.overlay-pulse {
    animation: overlayPulse 0.5s ease-out;
}

@keyframes overlayPulse {
    0% { background: rgba(0, 0, 0, 0.8); }
    15% { background: rgba(245, 158, 11, 0.25); }
    40% { background: rgba(0, 0, 0, 0.6); }
    100% { background: rgba(0, 0, 0, 0.8); }
}

/* Sparkle burst on tear */
.tear-sparkles {
    position: absolute;
    top: 50%;
    right: 28px;
    width: 120px;
    height: 120px;
    transform: translate(50%, -50%);
    pointer-events: none;
    z-index: 20;
}

.tear-sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: sparkle 0.8s ease-out forwards;
}

@keyframes sparkle {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ----------------------------------------
   Revealed Cards
   ---------------------------------------- */
.revealed-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    padding: var(--space-md) var(--space-lg);
    max-width: 720px;
    margin: 0 auto;
}

.revealed-cards.hidden { display: none; }

/* Flip Card */
.flip-card {
    width: 130px;
    height: 190px;
    perspective: 1200px;
    cursor: pointer;
}

.flip-card.card-enter {
    animation: cardSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

@keyframes cardSlideIn {
    0% { opacity: 0; transform: translateY(60px) rotateX(15deg) scale(0.7); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

/* Anticipation wobble before epic+ reveal */
.flip-card.card-anticipation {
    animation: cardAnticipation 0.5s ease-in-out;
}

@keyframes cardAnticipation {
    0%, 100% { transform: scale(1); }
    20% { transform: scale(1.06) rotate(-1deg); }
    40% { transform: scale(1.08) rotate(1deg); }
    60% { transform: scale(1.06) rotate(-0.5deg); }
    80% { transform: scale(1.04); }
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

/* Card Back - Premium design */
.flip-card-back {
    background: linear-gradient(145deg, #0f0d1a 0%, #1a1647 40%, #0f0d1a 100%);
    border: 2px solid rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-back-pattern {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        repeating-conic-gradient(from 0deg at 50% 50%, rgba(99, 102, 241, 0.04) 0deg 10deg, transparent 10deg 20deg);
}

.card-back-logo {
    position: relative;
    z-index: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-icon {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    position: relative;
}

.card-back-icon::after {
    content: '?';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(99, 102, 241, 0.5);
}

.card-back-border {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    pointer-events: none;
}

.flip-card:not(.flipped):hover .flip-card-back {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
    border-color: rgba(99, 102, 241, 0.5);
}

/* Card Front */
.flip-card-front {
    transform: rotateY(180deg);
    background: linear-gradient(165deg, #1e1b3a 0%, #151329 100%);
    border: 2px solid var(--color-border);
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Rarity strip at top */
.card-rarity-strip {
    width: 100%;
    text-align: center;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 0;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.flip-card-front[data-rarity="common"] .card-rarity-strip { color: var(--rarity-common); }
.flip-card-front[data-rarity="uncommon"] .card-rarity-strip { color: var(--rarity-uncommon); }
.flip-card-front[data-rarity="rare"] .card-rarity-strip { color: var(--rarity-rare); }
.flip-card-front[data-rarity="epic"] .card-rarity-strip { color: var(--rarity-epic); }
.flip-card-front[data-rarity="legendary"] .card-rarity-strip {
    color: var(--rarity-legendary);
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.1), transparent);
}
.flip-card-front[data-rarity="mythic"] .card-rarity-strip {
    color: var(--rarity-mythic);
    background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.1), transparent);
}

/* Holographic Effect */
.card-holo-effect {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        transparent 0%,
        rgba(255, 0, 128, 0.12) 15%,
        rgba(0, 255, 255, 0.12) 30%,
        rgba(255, 255, 0, 0.12) 45%,
        rgba(0, 255, 128, 0.12) 60%,
        rgba(128, 0, 255, 0.12) 75%,
        transparent 100%
    );
    background-size: 400% 400%;
    animation: holoShift 6s ease infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.flip-card.flipped .card-holo-effect { opacity: 1; }

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

/* Card Shine sweep */
.card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(255, 255, 255, 0.35) 45%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0.35) 55%,
        transparent 60%
    );
    transform: rotate(25deg);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

.flip-card.flipped .card-shine {
    animation: cardShine 1.2s ease-out 0.35s;
}

@keyframes cardShine {
    0% { opacity: 0; transform: rotate(25deg) translateX(-120%); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: rotate(25deg) translateX(120%); }
}

/* Card Face Container */
.flip-card-front .card-face-container {
    width: 76px;
    height: 76px;
    margin: 12px 0 6px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle, #1a1835 0%, #0f0d1a 100%);
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.flip-card-front .card-info {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flip-card-front .agent-name {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 2px;
}

.card-type-label {
    font-size: 0.58rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.card-value-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fbbf24;
    font-family: var(--font-display);
    background: rgba(251, 191, 36, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    margin: 0 auto 8px;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

/* Card particles container */
.card-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.card-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--px)), calc(-50% + var(--py))) scale(0); opacity: 0; }
}

/* Rarity-specific card borders */
.flip-card-front[data-rarity="common"] { border-color: var(--rarity-common); }
.flip-card-front[data-rarity="uncommon"] { border-color: var(--rarity-uncommon); }
.flip-card-front[data-rarity="rare"] { border-color: var(--rarity-rare); }
.flip-card-front[data-rarity="epic"] { border-color: var(--rarity-epic); }
.flip-card-front[data-rarity="legendary"] {
    border-color: var(--rarity-legendary);
    border-width: 2px;
}
.flip-card-front[data-rarity="mythic"] {
    border-color: var(--rarity-mythic);
    border-width: 2px;
}

/* Special card effects for rare+ */
.flip-card.special-card .card-holo-effect {
    opacity: 1;
    animation: holoShift 4s ease infinite;
}

.flip-card.special-card[data-rarity="rare"] .flip-card-front {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.35), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.flip-card.special-card[data-rarity="epic"] .flip-card-front {
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.flip-card.special-card[data-rarity="legendary"] .flip-card-front {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.45), 0 0 60px rgba(245, 158, 11, 0.15);
    animation: legendaryGlow 2.5s ease-in-out infinite;
}

.flip-card.special-card[data-rarity="mythic"] .flip-card-front {
    box-shadow: 0 0 35px rgba(236, 72, 153, 0.5), 0 0 70px rgba(139, 92, 246, 0.2);
    animation: mythicGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
    0%, 100% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.4), 0 0 50px rgba(245, 158, 11, 0.1); }
    50% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.7), 0 0 80px rgba(245, 158, 11, 0.3); }
}

@keyframes mythicGlow {
    0%, 100% { box-shadow: 0 0 25px rgba(236, 72, 153, 0.4), 0 0 50px rgba(139, 92, 246, 0.1); }
    50% { box-shadow: 0 0 45px rgba(236, 72, 153, 0.7), 0 0 80px rgba(139, 92, 246, 0.3); }
}

/* Responsive */
@media (max-width: 520px) {
    .flip-card {
        width: 105px;
        height: 155px;
    }
    .flip-card-front .card-face-container {
        width: 58px;
        height: 58px;
        margin: 8px 0 4px;
    }
    .flip-card-front .agent-name {
        font-size: 0.68rem;
    }
    .card-value-tag {
        font-size: 0.62rem;
        margin-bottom: 5px;
    }
    .pack-foil {
        width: 170px;
        height: 250px;
    }
    .revealed-cards {
        gap: 10px;
        padding: var(--space-sm) var(--space-md);
    }
}

/* ============================================
   Payment Modal
   ============================================ */
#payment-modal .modal-content {
    max-width: 450px;
}

#payment-modal .modal-title {
    color: var(--rarity-legendary);
    padding: var(--space-lg);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.payment-info {
    padding: var(--space-lg);
}

.payment-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.payment-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    font-size: 0.9rem;
}

.payment-summary .summary-row.shortfall {
    padding-top: var(--space-sm);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    font-weight: 600;
}

.payment-summary .price {
    color: var(--rarity-legendary);
    font-weight: 600;
}

.payment-summary .balance {
    color: var(--color-text-muted);
}

.payment-summary .shortfall-amount {
    color: #ef4444;
}

.payment-prompt {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.payment-prompt strong {
    color: var(--color-text);
}

.payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: 0 var(--space-lg) var(--space-lg);
}

.payment-method-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-method-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--color-accent);
    transform: translateX(4px);
}

.payment-method-btn .method-icon {
    font-size: 1.5rem;
}

.payment-method-btn .method-name {
    flex: 1;
    text-align: left;
}

#payment-modal .modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

#payment-modal #cancel-payment {
    min-width: 120px;
}

/* ============================================
   Purchase Confirmation Modal
   ============================================ */
#confirm-purchase-modal .confirm-modal {
    max-width: 400px;
}

#confirm-purchase-modal .confirm-content {
    padding: var(--space-lg);
}

#confirm-purchase-modal .confirm-agent-preview {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

#confirm-purchase-modal .confirm-agent-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
}

#confirm-purchase-modal .confirm-agent-card[data-rarity="common"] {
    border-color: var(--rarity-common);
}
#confirm-purchase-modal .confirm-agent-card[data-rarity="uncommon"] {
    border-color: var(--rarity-uncommon);
}
#confirm-purchase-modal .confirm-agent-card[data-rarity="rare"] {
    border-color: var(--rarity-rare);
}
#confirm-purchase-modal .confirm-agent-card[data-rarity="epic"] {
    border-color: var(--rarity-epic);
}
#confirm-purchase-modal .confirm-agent-card[data-rarity="legendary"] {
    border-color: var(--rarity-legendary);
}
#confirm-purchase-modal .confirm-agent-card[data-rarity="mythic"] {
    border-color: var(--rarity-mythic);
}

#confirm-purchase-modal .confirm-agent-card .face-canvas {
    border-radius: 50%;
    background: var(--color-bg-secondary);
}

#confirm-purchase-modal .confirm-agent-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

#confirm-purchase-modal .confirm-agent-info .agent-type {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

#confirm-purchase-modal .confirm-details {
    background: var(--color-bg);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

#confirm-purchase-modal .confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

#confirm-purchase-modal .confirm-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
}

#confirm-purchase-modal .confirm-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

#confirm-purchase-modal .quantity-selector {
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

#confirm-purchase-modal .quantity-selector label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
    font-weight: 500;
}

#confirm-purchase-modal .quantity-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
}

#confirm-purchase-modal .qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#confirm-purchase-modal .qty-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

#confirm-purchase-modal .qty-btn:active {
    transform: scale(0.95);
}

#confirm-purchase-modal .qty-input {
    width: 60px;
    height: 36px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: var(--radius-md);
    -moz-appearance: textfield;
}

#confirm-purchase-modal .qty-input::-webkit-outer-spin-button,
#confirm-purchase-modal .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#confirm-purchase-modal .qty-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

#confirm-purchase-modal .available-note {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

#confirm-purchase-modal .total-row {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--color-border);
}

#confirm-purchase-modal .total-row .confirm-price {
    font-size: 1.4rem;
}

#confirm-purchase-modal .confirm-question {
    text-align: center;
    color: var(--color-text);
    font-size: 0.95rem;
}

#confirm-purchase-modal .modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
}

#confirm-purchase-modal .modal-footer .btn {
    min-width: 140px;
}

#confirm-purchase-modal #confirm-purchase {
    background: linear-gradient(135deg, var(--color-accent), #4f46e5);
}

#confirm-purchase-modal #confirm-purchase:hover {
    background: linear-gradient(135deg, var(--color-accent-hover), #6366f1);
    transform: translateY(-1px);
}

/* ============================================
   Pack Confirmation Modal
   ============================================ */
#confirm-pack-modal .confirm-modal {
    max-width: 420px;
}

#confirm-pack-modal .confirm-content {
    padding: var(--space-lg);
}

#confirm-pack-modal .confirm-pack-preview {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

#confirm-pack-modal .confirm-pack-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-accent);
}

#confirm-pack-modal .confirm-pack-card .pack-icon {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-accent), #4f46e5);
    border-radius: var(--radius-md);
    position: relative;
}

#confirm-pack-modal .confirm-pack-card .pack-icon::after {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

#confirm-pack-modal .confirm-pack-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

#confirm-pack-modal .confirm-pack-info .pack-description {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
}

#confirm-pack-modal .pack-details {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.8rem;
}

#confirm-pack-modal .pack-cards-count {
    background: var(--color-bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

#confirm-pack-modal .pack-guaranteed {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

#confirm-pack-modal .confirm-details {
    background: var(--color-bg);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

#confirm-pack-modal .confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#confirm-pack-modal .confirm-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
}

#confirm-pack-modal .confirm-question {
    text-align: center;
    color: var(--color-text);
    font-size: 0.95rem;
}

#confirm-pack-modal .modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
}

#confirm-pack-modal .modal-footer .btn {
    min-width: 140px;
}

#confirm-pack-modal #confirm-pack {
    background: linear-gradient(135deg, var(--color-accent), #4f46e5);
}

#confirm-pack-modal #confirm-pack:hover {
    background: linear-gradient(135deg, var(--color-accent-hover), #6366f1);
    transform: translateY(-1px);
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
    padding: var(--space-xl);
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-3xl);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.main-footer p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Animations
   ============================================ */
@keyframes rainbow-shift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(var(--rotation, 0deg)); }
    50% { transform: translateY(-20px) rotate(var(--rotation, 0deg)); }
}

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

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes packShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

@keyframes cardReveal {
    from { transform: scale(0) rotateY(180deg); opacity: 0; }
    to { transform: scale(1) rotateY(0deg); opacity: 1; }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-visual {
        height: 300px;
    }

    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: var(--space-sm) var(--space-md);
    }

    .header-container {
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: var(--space-sm);
    }

    .nav-link {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.875rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .tab-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select,
    .filter-input {
        width: 100%;
    }

    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .balance-display {
        display: none;
    }

    .floating-cards {
        display: none;
    }

    .hero-visual {
        display: none;
    }

    .agents-grid,
    .owned-agents-grid {
        grid-template-columns: 1fr;
    }

    .stats-panel {
        grid-template-columns: 1fr;
    }

    .packs-grid {
        grid-template-columns: 1fr;
    }
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   BTC Widget
   ============================================ */
.btc-widget {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(247, 147, 26, 0.3);
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.08), rgba(247, 147, 26, 0.02));
}

.btc-widget-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.btc-icon-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btc-icon {
    font-size: 1.6rem;
    color: #f7931a;
    font-weight: 700;
}

.btc-label {
    font-weight: 700;
    color: #f7931a;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.btc-price-info {
    display: flex;
    flex-direction: column;
}

.btc-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    font-family: var(--font-display);
    transition: text-shadow 0.3s ease;
}

.btc-price.btc-flash {
    text-shadow: 0 0 12px rgba(247, 147, 26, 0.8), 0 0 4px rgba(247, 147, 26, 0.4);
}

@keyframes btcFlash {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.btc-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.btc-change.positive {
    color: #10b981;
}

.btc-change.negative {
    color: #ef4444;
}

.btc-chart-container {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

#btc-chart {
    width: 100%;
    height: 60px;
}

.btc-widget-right {
    flex-shrink: 0;
}

.btc-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .btc-widget {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .btc-chart-container {
        order: 3;
        min-width: 100%;
    }
    .btc-widget-right {
        display: none;
    }
}

/* Price change arrows on cards */
.price-change {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.3rem;
}

.price-change.up {
    color: #10b981;
}

.price-change.down {
    color: #ef4444;
}

.price-change .arrow {
    font-size: 0.6rem;
}

/* ============================================
   Pack Value Dropdown (hover ? button)
   ============================================ */
#pack-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pack-value-dropdown {
    position: relative;
}

.value-info-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.value-info-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.25);
}

.value-dropdown-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    z-index: 10;
    animation: dropdownReveal 0.2s ease forwards;
}

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

.value-dropdown-content::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 12px;
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
}

.pack-value-dropdown:hover .value-dropdown-content {
    display: block;
}

.value-dropdown-content.profit {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(10, 30, 20, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.value-dropdown-content.profit::after {
    background: rgba(10, 30, 20, 0.95);
    border-right: 1px solid rgba(16, 185, 129, 0.3);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

.value-dropdown-content.loss {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(30, 10, 10, 0.95));
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.value-dropdown-content.loss::after {
    background: rgba(30, 10, 10, 0.95);
    border-right: 1px solid rgba(239, 68, 68, 0.3);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.value-summary-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}

.value-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.value-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.value-amount {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
    font-family: var(--font-display);
}

.value-summary-arrow {
    font-size: 0.8rem;
    opacity: 0.5;
}

.profit .value-summary-arrow { color: #10b981; }
.loss .value-summary-arrow { color: #ef4444; }

.value-result-row {
    text-align: center;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.value-result-amount {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-display);
}

.profit .value-result-amount { color: #10b981; }
.loss .value-result-amount { color: #ef4444; }

.value-result-pct {
    font-size: 0.65rem;
    opacity: 0.6;
}

.profit .value-result-pct { color: #10b981; }
.loss .value-result-pct { color: #ef4444; }

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-border: #666;
        --color-text-muted: #ccc;
    }
}
