:root {
    /* Premium Palette */
    --primary: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338CA;
    /* Indigo 700 */
    --primary-light: #EEF2FF;
    /* Indigo 50 */
    --secondary: #64748b;
    --accent: #06b6d4;
    /* Cyan 500 */
    --success: #10b981;
    --danger: #6366F1;
    /* Updated to Vibrant Indigo */
    --hot-deal: #6366F1;
    /* Vibrant Indigo for highlights */
    --hot-glow: #818CF8;
    /* Lighter Indigo for glow effects */
    --warning: #f59e0b;

    /* Backgrounds */
    --background: #0f172a;
    /* Slate 900 - Dark Mode Default for premium feel */
    --surface: #1e293b;
    /* Slate 800 */
    --surface-hover: #334155;

    /* Text */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Borders & Effects */
    --border: #334155;
    /* Slate 700 */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);

    /* Radius */
    --radius: 1rem;
    --radius-lg: 1.5rem;
    --radius-round: 9999px;
}

* {
    box-sizing: border-box;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Background Abstract Shapes instead of just one Pokeball for a modern look */
body::before {
    content: "";
    position: fixed;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* Header Styles */
/* Header Styles */
/* Header Transition for Scroll */
.site-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ... existing logo/nav ... */

/* Hero Search - Increased Width */
.hero-container {
    width: 100%;
    max-width: 800px;
    /* Increased from 700px */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    z-index: 10;
}

/* ... existing hero-text ... */

.search-wrapper {
    position: relative;
    width: 100%;
    /* Ensure it takes full width of container */
    max-width: 100%;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ... existing inputs ... */

/* Listing Card Active - Better Colors */
.listing-card.active {
    background: rgba(16, 185, 129, 0.05);
    /* Success Green Tint */
    border-color: rgba(16, 185, 129, 0.4);
}

.listing-card.active .listing-price {
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

.listing-info {
    flex: 1;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    /* Allow wrapping on very small screens but try to keep inline */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-item:hover {
    color: var(--primary);
}

.discord-cta {
    background-color: rgba(88, 101, 242, 0.1);
    color: #5865F2;
    padding: 6px 16px;
    border-radius: var(--radius-round);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid rgba(88, 101, 242, 0.2);
}

.discord-cta:hover {
    background-color: #5865F2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Content Card */
.content-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* Typography */
h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

ul {
    color: var(--text-muted);
    padding-left: 1.5rem;
    text-align: left;
}

li {
    margin-bottom: 0.5rem;
}

/* Utility */
.text-center {
    text-align: center;
}

/* Index Specific Styles */
/* Index Specific Styles */
.header-hero {
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.5) 0%, transparent 100%);
    padding: 4rem 1rem;
    display: flex;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.hero-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    z-index: 10;
}

.hero-text {
    text-align: center;
    margin-bottom: 0.5rem;
}

.search-tip {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-tip svg {
    color: var(--primary);
    flex-shrink: 0;
}

.search-tip b {
    color: var(--text-main);
}

/* Game Switcher */
.game-selector-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.game-selector {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    padding: 4px;
    border-radius: 20px;
    display: flex;
    position: relative;
    border: 1px solid var(--border);
}

.game-selector input[type="radio"] {
    display: none;
}

.game-selector label {
    padding: 8px 24px;
    cursor: pointer;
    border-radius: 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    user-select: none;
}

.game-selector input[type="radio"]:checked+label {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.game-selector label:hover {
    color: var(--text-main);
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.search-wrapper {
    position: relative;
    width: 100%;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    transition: box-shadow 0.2s ease;
    padding-right: 6px;
}

.search-wrapper:focus-within {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.search-wrapper input[type="text"] {
    flex: 1;
    width: auto;
    height: 56px;
    padding: 0 12px 0 50px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    background: transparent;
    box-shadow: none;
}

.search-wrapper input[type="text"]::placeholder {
    color: #757575;
}

.search-wrapper input[type="text"]:focus {
    outline: none;
    border: none;
    box-shadow: none;
    padding: 0 12px 0 50px;
}

.search-btn {
    position: relative;
    height: 44px;
    border-radius: 24px;
    padding: 0 1.5rem;
    font-size: 1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-btn:hover {
    background-color: var(--primary-hover);
}

.upload-label {
    position: relative;
    margin-right: 4px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.upload-label:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

/* Pills & Filter Styles */
.options-pills {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 1rem;
}

.pill-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.5rem;
}

.pill-group {
    position: relative;
}

.pill-group input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pill-group label {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-round);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.pill-group label:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background-color: rgba(79, 70, 229, 0.1);
}

.pill-group input[type="checkbox"]:checked+label {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Advanced Filters */
.advanced-filters-section {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.advanced-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
}

.advanced-toggle-btn:hover,
.advanced-toggle-btn.active {
    color: var(--primary);
}

.advanced-toggle-btn .chevron {
    transition: transform 0.3s ease;
}

.advanced-content {
    width: 100%;
    margin-top: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.custom-select {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.6rem 2rem 0.6rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.custom-select:focus {
    border-color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card.highlight {
    border-bottom: 4px solid var(--hot-deal);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.stat-card.highlight .stat-value {
    color: var(--hot-deal);
}

/* Listings */
/* Market Action Bar */
.market-bar {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.market-bar-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.market-bar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.market-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.market-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listing-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Listings Cards */
.listing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
    gap: 1rem;
    /* Added gap for proper spacing */
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    background-color: var(--surface-hover);
}

.listing-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.listing-text {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
    /* Allow title and badge to wrap on small screens */
}

/* Mobile Listing Card Adjustments */
@media (max-width: 600px) {
    .listing-card {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        padding-bottom: 4rem;
        /* Make room for price at bottom if absolute, or just let it stack */
        padding: 1rem;
    }

    .listing-info {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
        align-items: flex-start;
    }

    .listing-text {
        flex-direction: column;
        align-items: flex-start;
        white-space: normal;
        margin-left: 0.5rem;
        /* Space from badge */
        flex: 1;
        /* Take remaining space instead of forcing 100% width */
        width: auto;
        min-width: 0;
        /* Critical for flexbox wrapping */
    }

    .listing-title {
        white-space: normal;
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
        overflow-wrap: break-word;
        /* Ensure long words don't overflow */
        word-break: break-word;
    }

    .listing-meta {
        margin-left: 0;
        display: inline-flex;
        /* Ensure it doesn't span full width unnecessarily */
    }

    .listing-price-group {
        width: 100%;
        flex-direction: row;
        /* Horizontal price + shipping on mobile? Or keep vertical? */
        justify-content: space-between;
        align-items: center;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
        padding-top: 0.5rem;
    }

    .listing-price {
        font-size: 1.1rem;
    }
}

.listing-title {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.listing-meta {
    font-size: 0.65rem;
    color: #FFFFFF;
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 1rem;
    border: 1px solid var(--hot-deal);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

/* Mobile Listing Card Adjustments (Ensure this is AFTER listing-title) */
@media (max-width: 600px) {
    .listing-card {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        padding-bottom: 0;
        padding: 1rem;
        gap: 0.5rem;
    }

    .listing-info {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0;
        align-items: flex-start;
    }

    .listing-text {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0.5rem;
        flex: 1;
        width: 100%;
        /* Use 100% here as it is flex column item now */
        min-width: 0;
    }

    .listing-title {
        white-space: normal !important;
        /* Force override */
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
        overflow-wrap: break-word;
        word-break: break-all;
        /* Aggressive break for very long strings */
    }

    .listing-meta {
        margin-left: 0;
        display: inline-flex;
    }

    .listing-price-group {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
        padding-top: 0.5rem;
    }

    .listing-price {
        font-size: 1.1rem;
    }
}

.listing-meta:hover {
    background: var(--hot-deal);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-status-indigo {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 6px 14px;
    background: #4F46E5;
    /* Solid Indigo 600 */
    color: #FFFFFF !important;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-status-indigo:hover {
    background: #4338CA;
    transform: translateY(-1px);
    color: white !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-status-indigo.out-of-stock {
    background: #475569;
    /* Slate 600 */
    color: #cbd5e1 !important;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.8;
}

.listing-meta svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.listing-price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.listing-price {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.15rem;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.listing-shipping {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.listing-card.active {
    background: rgba(99, 102, 241, 0.05);
    /* Indigo Tint */
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.listing-card.active .listing-price {
    color: var(--hot-deal);
    background-color: rgba(99, 102, 241, 0.1);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Footer Links */
.footer-links {
    margin-top: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Loading Animation */
.loader-container {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
}

.pokeball {
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--text-main);
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

/* Top half */
.pokeball::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 50%;
    background-color: var(--danger);
    border-bottom: 3px solid var(--text-main);
    top: 0;
}

/* Center button */
.pokeball::before {
    content: '';
    position: absolute;
    background-color: #fff;
    width: 12px;
    height: 12px;
    border: 3px solid var(--text-main);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--text-main);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.pixel-icon {
    width: auto;
    height: 32px;
    image-rendering: pixelated;
    vertical-align: middle;
}

.auction-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.auction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.auction-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    /* Small retro text */
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auction-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columns Desktop */
    gap: 1.5rem;
}

.auction-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure cards in a row are same height */
}

.auction-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.auction-img-container {
    width: 100%;
    height: 220px;
    background: #f0f0f0;
    position: relative;
}

.auction-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Keeps card aspect ratio */
    background: #1e1e1e;
    /* Darker background for card pop */
}

.trending-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--hot-deal), var(--hot-glow));
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auction-details {
    padding: 0.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.auction-card-footer {
    margin-top: auto;
    /* Pushes this block to the bottom */
    padding-top: 0.5rem;
}

.auction-title-text {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.auction-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.auction-price {
    font-weight: 700;
    color: var(--success);
}

.auction-bids {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auction-timer {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.auction-timer.time-critical {
    color: var(--danger);
}

.view-more-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 15px;
}

.view-more-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auction-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 Column Mobile */
        gap: 1rem;
    }

    .auction-img-container {
        height: 180px;
        /* Reduced specific height for mobile */
    }

    .auction-title-text {
        font-size: 0.8rem;
    }

    .auction-price {
        font-size: 0.9rem;
    }
}

/* Location Badge in Header */
.location-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-round);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.location-badge span:first-child {
    font-size: 1rem;
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.cookie-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
}

.cookie-btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-round);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.cookie-btn.accept {
    background: var(--primary);
    color: white;
}

.cookie-btn.accept:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.cookie-btn.learn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.cookie-btn.learn:hover {
    background: var(--glass-bg);
    color: var(--text-main);
}

@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Region Selector Dropdown */
.region-selector-container {
    position: relative;
    display: inline-block;
}

.region-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 8px;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.region-grid-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.region-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.region-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.region-item.active {
    background: var(--primary);
    color: white;
}

.region-flag-small {
    font-size: 1.2rem;
}

.region-code-small {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Pill Select for Language */
.language-pill {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.pill-select {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-round);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    /* Hide default arrow to style better */
    -webkit-appearance: none;
    text-align: center;
}

.pill-select:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.pill-select:focus {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}