/* Root variables for consistent theming */
:root {
    --background: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --neon-red:     #ff1744;  /* Electric red/pinkish edge */
    --neon-yellow: #faff00;  /* Radiant highlighter yellow */
    --neon-orange: #ff7300;  /* Electric orange */
    --neon-green: #00ff88;
    --neon-blue: #00ccff;
    --neon-purple: #cc00ff;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(15, 15, 20, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    /* Quality glow colors */
    --default-glow: rgba(0, 0, 0, 0.2);
    --mad-glow: rgba(235, 63, 47, 0.4);
    --basic-glow: rgba(255, 255, 255, 0.3);
    --uncommon-glow: rgba(0, 128, 0, 0.4);
    --rare-glow: rgba(255, 255, 0, 0.4);
    --epic-glow: rgba(242, 80, 134, 0.4);
    --legendary-glow: rgba(255, 107, 0, 0.4);
    --ultimate-glow: rgba(228, 47, 235, 0.4);
    --mythical-glow: rgba(204, 0, 255, 0.4);
    --collectors-glow: rgba(3, 188, 255, 0.4);
    --special-glow: rgba(73, 191, 140, 1);
    --yellow-gradient: linear-gradient(45deg, #ffd700, #ffa500, #ffd700);
    --silver-glow: rgba(192, 192, 192, 0.7);
}

/* General styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
  background-color: #000000;
  overscroll-behavior-y: contain;
}

body {
    font-family: ui-sans-serif, system-ui, sans-serif;
    background: radial-gradient(ellipse at center, var(--dark-bg) 0%, #000000 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    overscroll-behavior-y: contain;
}

/* --- UPDATED: Particles (Ember Effect) --- */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* Below item containers (z-index: 10) */
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -10px; /* Start from below the screen */
    width: 2px;
    height: 5px; /* Flake-like shape */
    border-radius: 50%;
    opacity: 0;
    animation: float-ember 4s infinite ease-out; /* Faster, more erratic animation */
    box-shadow: 0 0 4px currentColor, 0 0 8px currentColor;
    background-color: currentColor;
}

@keyframes float-ember {
    0% {
        transform: translateY(0) translateX(0) scale(1.2);
        opacity: 0;
    }
    10% {
        opacity: 1; /* Fade in quickly */
    }
    25% {
        transform: translateY(-25vh) translateX(30px) scale(1);
    }
    50% {
        transform: translateY(-50vh) translateX(-20px) scale(0.8);
    }
    75% {
        transform: translateY(-75vh) translateX(40px) scale(0.5);
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(-10px) scale(0);
        opacity: 0;
    }
}


/* Header */
.header {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* --- UPDATED: Brand Title Gradient (Static & No Yellow) --- */
.brand-title {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--neon-orange), var(--neon-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.navbar {
    display: flex;
    list-style: none;
    gap: 30px;
}

.navbar a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar a:hover,
.navbar a.active {
    color: var(--neon-orange);
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-orange);
    transition: width 0.3s ease;
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

.search-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 200px;
    transition: all 0.3s ease;
    padding-left: 15px;
}

.search-input:focus {
    outline: none;
    border-color: var(--neon-orange);
    box-shadow: 0 0 0 2px rgba(255, 115, 0, 0.2);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.control-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.control-button:hover {
    background: rgba(255, 115, 0, 0.1);
    border-color: var(--neon-orange);
    color: var(--neon-orange);
}

.control-button.active {
    background: var(--neon-orange);
    color: #000;
    border-color: var(--neon-orange);
}

/* Filter Controls */
.filter-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1400px;
    margin-left: 20px;
    margin-right: 20px;
    backdrop-filter: blur(20px);
    display: none;
    animation: slideDown 0.3s ease;
    position: relative;
    z-index: 200;
}

.filter-panel.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 32px 10px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    min-height: 40px;
    line-height: 1.2;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23ff7300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.filter-select:hover {
    border-color: var(--neon-orange);
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-select:focus {
    outline: none;
    border-color: var(--neon-orange);
    box-shadow: 0 0 0 2px rgba(255, 115, 0, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-select option {
    background: #1a1a1a;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px;
}

/* Sort Controls */
.sort-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px auto;
    max-width: 1400px;
    margin-left: 20px;
    margin-right: 20px;
    backdrop-filter: blur(20px);
    display: none;
    animation: slideDown 0.3s ease;
}

.sort-panel.show {
    display: block;
}

.sort-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.sort-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sort-button:hover {
    background: rgba(255, 115, 0, 0.1);
    border-color: var(--neon-orange);
    color: var(--neon-orange);
}

.sort-button.active {
    background: var(--neon-orange);
    color: #000;
    border-color: var(--neon-orange);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Item Grid and Skeleton */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-grid.loaded {
    opacity: 1;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    height: 200px;
    display: flex;
    gap: 20px;
    animation: pulse 1.5s infinite;
}

.skeleton-image {
    width: 160px;
    height: 160px;
    background: linear-gradient(90deg, #1a1a1a 25%, #222222 50%, #1a1a1a 75%);
    border-radius: 12px;
    background-size: 200% 100%;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.skeleton-text {
    background: linear-gradient(90deg, #1a1a1a 25%, #222222 50%, #1a1a1a 75%);
    height: 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    background-size: 200% 100%;
    animation: pulse 1.5s infinite;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

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

/* Quality-based hover effects */
.item-card.default:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 5px 15px var(--default-glow);
    border-color: #000000;
    animation: defaultPulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ffffff;
}

@keyframes defaultPulse {
    0%, 100% { box-shadow: 0 5px 15px var(--default-glow); }
    50% { box-shadow: 0 7px 20px rgba(0, 0, 0, 0.25); }
}

.item-card.mad:hover,
.item-card.basic:hover,
.item-card.uncommon:hover,
.item-card.rare:hover,
.item-card.epic:hover,
.item-card.legendary:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px var(--basic-glow);
    border-color: var(--basic-glow);
    animation: class1Pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ffffff, 0 15px 35px var(--basic-glow);
}

@keyframes class1Pulse {
    0%, 100% { box-shadow: 0 15px 35px var(--basic-glow); }
    50% { box-shadow: 0 20px 40px var(--basic-glow); }
}

.item-card.ultimate:hover,
.item-card.mythical:hover {
    transform: translateY(-8px) scale(1.03) rotateX(3deg);
    box-shadow: 0 20px 40px var(--ultimate-glow), 0 0 20px var(--ultimate-glow);
    border-color: var(--ultimate-glow);
    animation: class2Shimmer 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ffffff, 0 20px 40px var(--ultimate-glow), 0 0 20px var(--ultimate-glow);
}

@keyframes class2Shimmer {
    0%, 100% { box-shadow: 0 20px 40px var(--ultimate-glow), 0 0 20px var(--ultimate-glow); }
    50% { box-shadow: 0 25px 50px var(--ultimate-glow), 0 0 30px var(--ultimate-glow); }
}

.item-card.collectors:hover {
    transform: translateY(-12px) scale(1.05) rotateY(3deg) rotateX(3deg);
    box-shadow: 0 25px 50px var(--collectors-glow), 0 0 30px rgba(3, 188, 255, 0.4), inset 0 0 20px rgba(3, 188, 255, 0.1);
    border-color: #03bcff;
    animation: collectorsFlame 1.2s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ffffff, 0 25px 50px var(--collectors-glow), 0 0 30px rgba(3, 188, 255, 0.4), inset 0 0 20px rgba(3, 188, 255, 0.1);
}

@keyframes collectorsFlame {
    0%, 100% { box-shadow: 0 25px 50px var(--collectors-glow), 0 0 30px rgba(3, 188, 255, 0.4), inset 0 0 20px rgba(3, 188, 255, 0.1); filter: brightness(1); }
    25% { box-shadow: 0 30px 60px rgba(3, 188, 255, 0.7), 0 0 40px rgba(3, 200, 255, 0.6), inset 0 0 25px rgba(3, 188, 255, 0.2); filter: brightness(1.1); }
    75% { box-shadow: 0 28px 55px rgba(3, 150, 255, 0.6), 0 0 35px rgba(3, 188, 255, 0.5), inset 0 0 22px rgba(3, 188, 255, 0.15); filter: brightness(1.05); }
}

.item-card.funtime:hover {
    transform: translateY(-15px) scale(1.08) rotateY(5deg) rotateX(5deg);
    box-shadow: 0 30px 60px rgba(255, 0, 0, 0.3), 0 0 40px rgba(255, 165, 0, 0.3), 0 0 60px rgba(0, 128, 0, 0.3), inset 0 0 30px rgba(0, 0, 255, 0.15);
    border-color: transparent;
    animation: funtimeAura 1s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ffffff, 0 30px 60px rgba(255, 0, 0, 0.3), 0 0 40px rgba(255, 165, 0, 0.3), 0 0 60px rgba(0, 128, 0, 0.3), inset 0 0 30px rgba(0, 0, 255, 0.15);
}

.item-card.hyped.default:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--default-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.mad:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--mad-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.basic:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--basic-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.uncommon:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--uncommon-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.rare:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--rare-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.epic:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--epic-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.legendary:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--legendary-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.ultimate:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--ultimate-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.mythical:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--mythical-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.collectors:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--collectors-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.funtime:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--funtime-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

.item-card.hyped.special:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--special-glow);
    border-radius: 17px;
    z-index: -1;
    animation: hypedBorder 2s linear infinite;
}

@keyframes hypedBorder {
    0% { transform: rotate(0deg) scale(1); opacity: 0.3; }
    50% { transform: rotate(180deg) scale(1.02); opacity: 0.6; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.3; }
}

@keyframes funtimeAura {
    0%, 100% { box-shadow: 0 30px 60px rgba(255, 0, 0, 0.3), 0 0 40px rgba(255, 165, 0, 0.3), 0 0 60px rgba(0, 128, 0, 0.3), inset 0 0 30px rgba(0, 0, 255, 0.15); filter: brightness(1) saturate(1); }
    33% { box-shadow: 0 35px 70px rgba(255, 165, 0, 0.3), 0 0 50px rgba(0, 128, 0, 0.3), 0 0 80px rgba(0, 0, 255, 0.3), inset 0 0 35px rgba(75, 0, 130, 0.15); filter: brightness(1.2) saturate(1.3); }
    66% { box-shadow: 0 32px 65px rgba(0, 128, 0, 0.3), 0 0 45px rgba(0, 0, 255, 0.3), 0 0 70px rgba(75, 0, 130, 0.3), inset 0 0 32px rgba(255, 0, 0, 0.15); filter: brightness(1.1) saturate(1.1); }
}

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

.item-card.special:hover {
    transform: translateY(-5px) scale(1.02) rotate(1deg);
    box-shadow: 0 10px 20px var(--special-glow), 0 0 15px rgba(255, 255, 255, 0.2);
    border-color: #FFFFFF;
    animation: specialMystery 3s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ffffff, 0 10px 20px var(--special-glow), 0 0 15px rgba(255, 255, 255, 0.2);
}

@keyframes specialMystery {
    0%, 100% { box-shadow: 0 10px 20px var(--special-glow), 0 0 15px rgba(255, 255, 255, 0.2); filter: brightness(1) hue-rotate(0deg); }
    33% { box-shadow: 0 12px 25px rgba(255, 255, 255, 0.4), 0 0 20px rgba(200, 200, 200, 0.3); filter: brightness(1.1) hue-rotate(60deg); }
    66% { box-shadow: 0 11px 22px rgba(255, 255, 255, 0.35), 0 0 18px rgba(220, 220, 220, 0.25); filter: brightness(1.05) hue-rotate(120deg); }
}

/* Sweep effects */
.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 115, 0, 0.08), transparent);
    transition: left 0.5s ease;
}

.item-card:hover::before {
    left: 100%;
}

.item-card.default::before { background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent); }
.item-card.mad::before { background: linear-gradient(90deg, transparent, rgba(235, 63, 47, 0.15), transparent); }
.item-card.basic::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent); }
.item-card.uncommon::before { background: linear-gradient(90deg, transparent, rgba(0, 128, 0, 0.15), transparent); }
.item-card.rare::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.15), rgba(255, 255, 0, 0.1), transparent); }
.item-card.epic::before { background: linear-gradient(90deg, transparent, rgba(242, 80, 134, 0.15), transparent); }
.item-card.legendary::before { background: linear-gradient(90deg, transparent, rgba(255, 107, 0, 0.2), rgba(255, 200, 0, 0.15), transparent); }
.item-card.ultimate::before { background: linear-gradient(90deg, transparent, rgba(228, 47, 235, 0.2), transparent); }
.item-card.mythical::before { background: linear-gradient(90deg, transparent, rgba(204, 0, 255, 0.25), rgba(255, 0, 255, 0.2), rgba(150, 0, 255, 0.15), transparent); }
.item-card.collectors::before { background: linear-gradient(90deg, transparent, rgba(3, 188, 255, 0.2), transparent); }
.item-card.funtime::before { background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.25), rgba(255, 165, 0, 0.2), rgba(0, 128, 0, 0.2), rgba(0, 0, 255, 0.15), transparent); }
.item-card.special::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), rgba(200, 200, 200, 0.05), transparent); }

/* Image hover effects */
.item-image-container:hover .item-image {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.2) saturate(1.4) contrast(1.1);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.item-image-container .item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
    opacity: 0;
}

.item-image-container .item-image.loaded {
    opacity: 1;
}

.item-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.item-type-label {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.item-name {
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: font-size 0.3s ease;
    font-size: 20px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    height: 200px;
    display: flex;
    gap: 20px;
    z-index: 10; /* Above particles (z-index: 0) */
}

.item-card:hover {
    box-shadow: 0 0 0 2px #ffffff;
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.item-image-container {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

@keyframes floatImage {
    from {
        transform: translateY(-3px);
    }
    to {
        transform: translateY(3px);
    }
}

.item-status {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--neon-orange);
    color: #000;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.item-status.rising { background: #00ccff; }
.item-status.lowering { background: #ff6b6b; }
.item-status.dead { background: #666; color: #fff; }
.item-status.new { background: linear-gradient(45deg, var(--neon-orange), var(--neon-red)); animation: statusPulse 2s ease-in-out infinite; }

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

.item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    min-height: 60px; /* Fixed height for consistency */
}

.item-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-grow: 1;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    word-wrap: break-word;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.quality-default { color: #000000; }
.quality-mad { color: #eb3f2f; }
.quality-basic { color: #ffffff; }
.quality-uncommon { color: #008000; }
.quality-rare { color: #cccc2b; }
.quality-epic { color: #f25086; }
.quality-legendary { color: #ff6b00; }
.quality-ultimate { color: #e42feb; }
.quality-mythical { color: #1d00fc; }
.quality-collectors { color: #03bcff; }
.quality-funtime { background: linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet, red); background-size: 400%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: rainbowShift 30s linear infinite; }
.quality-special { color: #49bf8c; }

.item-origin {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
    opacity: 0.8;
}

.item-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* Pins to bottom */
}

.item-not-tradeable {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* Pins to bottom */
}

.item-value {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #FFE240;
}

.coin-icon {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.3)); /* Smaller yellow glow */
    background: none;
}

.item-demand {
    display: flex;
    align-items: center;
    gap: 6px;
}

.demand-stars {
    background: linear-gradient(45deg, var(--neon-orange), var(--neon-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: bold;
}

.demand-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.copies-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    position: absolute;
    bottom: 8px;
    right: 8px;
    backdrop-filter: blur(10px);
}

.early-variant-sticker {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #C0C0C0; /* Plain silver color */
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    border: none;
    background: none;
    z-index: 2;
    pointer-events: none;
    text-transform: uppercase;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
}

.pagination-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.pagination-button:hover:not(:disabled) {
    background: rgba(255, 115, 0, 0.1);
    border-color: var(--neon-orange);
    color: var(--neon-orange);
}

.pagination-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--neon-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .navbar { gap: 20px; }
    .search-controls { width: 100%; justify-content: center; }
    .search-input { min-width: 150px; flex: 1; }
    .item-grid { grid-template-columns: 1fr; gap: 20px; }
    .filter-grid { grid-template-columns: 1fr; }
    .sort-buttons { justify-content: center; }
}

@media (max-width: 480px) {
    .main-content { padding: 15px; }
    .brand-title { font-size: 1.5rem; }
    .navbar { flex-wrap: wrap; justify-content: center; gap: 15px; }
    .filter-select { padding: 8px 28px 8px 10px; background-position: right 10px center; background-size: 10px; }

    /* --- NEW MOBILE CARD STYLES --- */
    .item-card {
        flex-direction: column; /* Stacks the image and content vertically */
        height: auto;           /* Allows the card to grow in height as needed */
        padding: 15px;
    }

    .item-image-container {
        width: 100%;            /* Makes the image container span the full card width */
        height: 180px;          /* Sets a fixed height for the image on mobile */
        margin-bottom: 15px;    /* Adds some space between the image and the content below */
    }

    .item-content {
        min-height: auto;       /* Resets the minimum height for the new vertical layout */
    }

    .item-name {
        font-size: 1.1rem;      /* Adjust font size for better readability on small screens */
    }
}

/* Visually Hidden Class for Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* === FOOTER STYLES (Orange/Red Theme) === */
.site-footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 10, 15, 0.98) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 80px;
    position: relative;
    overflow: hidden;
    width: 100%;
    line-height: normal; /* Fix for inherited line-height from body */
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 60px 0 40px;
    text-align: left;
}
.footer-brand {
    max-width: 300px;
}
.footer-logo {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--neon-orange), var(--neon-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}
.footer-social {
    display: flex;
    gap: 12px;
}
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.social-link:hover {
    background: rgba(255, 115, 0, 0.1);
    border-color: var(--neon-orange);
    color: var(--neon-orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 115, 0, 0.2);
}
.footer-section {
    min-width: 0;
}
.footer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    position: relative;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-orange), var(--neon-red));
    border-radius: 1px;
}
.footer-links {
    list-style: none;
    padding-left: 0;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}
.footer-links a:hover {
    color: var(--neon-orange);
    transform: translateX(4px);
}
.footer-links a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--neon-orange);
    transition: width 0.3s ease;
}
.footer-links a:hover::before {
    width: 100%;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px 0;
}
.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin: 0;
}
.footer-badges {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.footer-badge {
    background: rgba(255, 115, 0, 0.1);
    border: 1px solid rgba(255, 115, 0, 0.2);
    color: var(--neon-orange);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.footer-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.footer-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}
.footer-particle:nth-child(1) {
    width: 4px;
    height: 4px;
    top: 20%;
    left: 10%;
    background: var(--neon-orange);
    animation: footer-float-1 8s infinite ease-in-out;
}
.footer-particle:nth-child(2) {
    width: 2px;
    height: 2px;
    top: 60%;
    right: 20%;
    background: var(--neon-red);
    animation: footer-float-2 10s infinite ease-in-out;
}
.footer-particle:nth-child(3) {
    width: 3px;
    height: 3px;
    bottom: 30%;
    left: 70%;
    background: var(--neon-yellow);
    animation: footer-float-3 12s infinite ease-in-out;
}
@keyframes footer-float-1 {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.1; }
    50% { transform: translateY(-20px) translateX(15px); opacity: 0.3; }
}
@keyframes footer-float-2 {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.1; }
    50% { transform: translateY(15px) translateX(-10px); opacity: 0.2; }
}
@keyframes footer-float-3 {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.1; }
    50% { transform: translateY(-10px) translateX(-20px); opacity: 0.25; }
}
/* Responsive Design for Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 0 30px;
        text-align: center;
        justify-items: center;
    }
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-bottom-content {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
}


.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 1200px;
    display: flex;
    flex-wrap: wrap;
}
.item-profile {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 20px;
}
.item-image-container {
    text-align: center;
}
.item-info {
    display: flex;
    flex-direction: column;
}
.item-description {
    grid-column: span 1;
}
.chart-container {
    grid-column: span 3;
    height: 400px;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close:hover {
    color: black;
    cursor: pointer;
}