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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #a0a0a0;
    font-weight: 300;
}

.rarity-filter {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.emoji-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.emoji-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.emoji-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transition: all 0.3s ease;
}

.emoji-card[data-rarity="common"]::before {
    background: #94a3b8;
}

.emoji-card[data-rarity="uncommon"]::before {
    background: #10b981;
}

.emoji-card[data-rarity="rare"]::before {
    background: #3b82f6;
}

.emoji-card[data-rarity="epic"]::before {
    background: #8b5cf6;
}

.emoji-card[data-rarity="legendary"]::before {
    background: #f59e0b;
}

.emoji-card[data-rarity="mythic"]::before {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

.emoji-card[data-rarity="ethereal"]::before {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
    animation: ethereal-glow 2s ease-in-out infinite alternate;
}

.emoji-card[data-rarity="emoji secret"]::before {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    animation: secret-pulse 3s ease-in-out infinite;
}

.emoji-card[data-rarity="emoji god"]::before {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 50%, #fbbf24 100%);
    animation: god-shimmer 1.5s ease-in-out infinite alternate;
}

.emoji-card[data-rarity="emoji glitch secret"]::before {
    background: linear-gradient(135deg, #00ff00 0%, #ff00ff 33%, #00ffff 66%, #ff0000 100%);
    animation: glitch-flicker 0.15s ease-in-out infinite;
    filter: brightness(1.5) contrast(1.2);
}

.emoji-card[data-rarity="ultimate"]::before {
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 50%, #9ca3af 100%);
    animation: ultimate-pulse 2s ease-in-out infinite;
}

.emoji-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.emoji-name {
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.emoji-rarity {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-card[data-rarity="common"] .emoji-rarity {
    color: #94a3b8;
}

.emoji-card[data-rarity="uncommon"] .emoji-rarity {
    color: #10b981;
}

.emoji-card[data-rarity="rare"] .emoji-rarity {
    color: #3b82f6;
}

.emoji-card[data-rarity="epic"] .emoji-rarity {
    color: #8b5cf6;
}

.emoji-card[data-rarity="legendary"] .emoji-rarity {
    color: #f59e0b;
}

.emoji-card[data-rarity="mythic"] .emoji-rarity {
    color: #ec4899;
}

.emoji-card[data-rarity="ethereal"] .emoji-rarity {
    color: #a5b4fc;
    text-shadow: 0 0 10px rgba(165, 180, 252, 0.5);
}

.emoji-card[data-rarity="emoji secret"] .emoji-rarity {
    color: #64748b;
    text-shadow: 0 0 8px rgba(100, 116, 139, 0.6);
}

.emoji-card[data-rarity="emoji god"] .emoji-rarity {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
}

.emoji-card[data-rarity="emoji glitch secret"] .emoji-rarity {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.7);
    animation: glitch-text 0.2s ease-in-out infinite;
}

.emoji-card[data-rarity="ultimate"] .emoji-rarity {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
}

.emoji-frequency {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.emoji-card[data-rarity="ethereal"] .emoji-frequency {
    color: #a5b4fc;
}

.emoji-card[data-rarity="emoji secret"] .emoji-frequency {
    color: #64748b;
}

.emoji-card[data-rarity="emoji god"] .emoji-frequency {
    color: #fbbf24;
}

.emoji-card[data-rarity="emoji glitch secret"] .emoji-frequency {
    color: #ff00ff;
    animation: glitch-text 0.2s ease-in-out infinite;
}

.emoji-card[data-rarity="ultimate"] .emoji-frequency {
    color: #ffffff;
}

.emoji-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #a0a0a0;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ffffff;
}

.modal-emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.modal-rarity {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.modal-stats {
    text-align: left;
    margin-top: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content .ethereal {
    background: linear-gradient(135deg, #a5b4fc 0%, #c7d2fe 100%);
    color: #1e293b;
}

.modal-content .emoji-secret {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #f1f5f9;
}

.modal-content .emoji-god {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
}

.modal-content .emoji-glitch-secret {
    background: linear-gradient(135deg, #ff00ff 0%, #00ffff 100%);
    color: #000000;
}

.modal-content .ultimate {
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
    color: #374151;
}

@keyframes ethereal-glow {
    0% { box-shadow: 0 0 5px rgba(165, 180, 252, 0.3); }
    100% { box-shadow: 0 0 20px rgba(165, 180, 252, 0.8); }
}

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

@keyframes god-shimmer {
    0% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
    100% { box-shadow: 0 0 30px rgba(251, 191, 36, 1); }
}

@keyframes glitch-flicker {
    0% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
        filter: hue-rotate(0deg);
    }
    20% { 
        opacity: 0.7; 
        transform: translateX(-3px) scale(1.02);
        filter: hue-rotate(180deg);
    }
    40% { 
        opacity: 0.9; 
        transform: translateX(2px) scale(0.98);
        filter: hue-rotate(90deg);
    }
    60% { 
        opacity: 0.5; 
        transform: translateX(-2px) scale(1.05);
        filter: hue-rotate(270deg);
    }
    80% { 
        opacity: 0.8; 
        transform: translateX(3px) scale(0.95);
        filter: hue-rotate(45deg);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
        filter: hue-rotate(0deg);
    }
}

@keyframes glitch-text {
    0%, 100% { 
        transform: translateX(0) skew(0deg);
        text-shadow: 0 0 10px rgba(255, 0, 255, 0.7);
    }
    15% { 
        transform: translateX(-2px) skew(5deg);
        text-shadow: -2px 0 rgba(255, 0, 255, 0.9), 2px 0 rgba(0, 255, 255, 0.9);
    }
    30% { 
        transform: translateX(1px) skew(-3deg);
        text-shadow: 0 0 20px rgba(255, 0, 255, 1);
    }
    45% { 
        transform: translateX(-1px) skew(2deg);
        text-shadow: -1px 0 rgba(255, 255, 0, 0.9), 1px 0 rgba(255, 0, 255, 0.9);
    }
    60% { 
        transform: translateX(2px) skew(-1deg);
        text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    }
    75% { 
        transform: translateX(-3px) skew(3deg);
        text-shadow: 2px 0 rgba(255, 0, 0, 0.9), -2px 0 rgba(0, 255, 255, 0.9);
    }
    90% { 
        transform: translateX(1px) skew(-2deg);
        text-shadow: 0 0 25px rgba(255, 0, 255, 0.9);
    }
}

@keyframes glitch-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
        transform: translateY(0);
    }
    25% { 
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
        transform: translateY(-2px);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.7);
        transform: translateY(1px);
    }
    75% { 
        box-shadow: 0 0 35px rgba(0, 255, 0, 0.9);
        transform: translateY(-1px);
    }
}

.emoji-card[data-rarity="emoji glitch secret"] .emoji-icon {
    animation: glitch-rotate 3s linear infinite;
}

@keyframes glitch-rotate {
    0% { transform: rotate(0deg) scale(1); }
    15% { transform: rotate(5deg) scale(1.1); }
    30% { transform: rotate(-3deg) scale(0.9); }
    45% { transform: rotate(2deg) scale(1.05); }
    60% { transform: rotate(-2deg) scale(0.95); }
    75% { transform: rotate(1deg) scale(1.02); }
    90% { transform: rotate(-1deg) scale(0.98); }
    100% { transform: rotate(0deg) scale(1); }
}

.emoji-card[data-rarity="emoji glitch secret"] .emoji-name,
.emoji-card[data-rarity="emoji glitch secret"] .emoji-rarity,
.emoji-card[data-rarity="emoji glitch secret"] .emoji-frequency {
    position: relative;
    animation: glitch-skew 1.5s ease-in-out infinite;
}

@keyframes glitch-skew {
    0%, 100% { 
        transform: skew(0deg);
        opacity: 1;
    }
    20% { 
        transform: skew(2deg, 1deg);
        opacity: 0.9;
    }
    40% { 
        transform: skew(-1deg, -2deg);
        opacity: 0.8;
    }
    60% { 
        transform: skew(1deg, -1deg);
        opacity: 0.9;
    }
    80% { 
        transform: skew(-2deg, 1deg);
        opacity: 0.7;
    }
}

@keyframes ultimate-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 255, 255, 0.8); }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
    }
    
    .emoji-icon {
        font-size: 2.5rem;
    }
}