.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.badge:hover {
    transform: translateY(-2px);
}

.badge-premium {
    color: var(--primary-text);
    background: linear-gradient(135deg, var(--player-one), var(--player-two));
    border: 2px solid rgb(243, 186, 29);
    box-shadow: 0 5px 20px rgba(243, 186, 29, 0.6);
}

.badge-premium:hover {
    box-shadow: 0 8px 30px rgba(243, 186, 29, 1);
}

.badge-verified {
    background: rgba(8, 217, 214, 0.2);
    color: var(--player-one);
    border: 2px solid var(--player-one);
}

.badge-founder {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: 2px solid #8b5cf6;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

.badge-founder:hover {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.6);
}

.badge-early-adopter {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
    border: 2px solid rgb(34, 197, 94);
}

.badge-bronze {
    background: rgba(189, 115, 18, 0.2);
    color: rgb(205, 127, 50);
    border: 2px solid rgb(205, 127, 50);
}

.badge-silver {
    background: rgba(192, 192, 192, 0.2);
    color: rgb(192, 192, 192);
    border: 2px solid rgb(192, 192, 192);
}

.badge-gold {
    background: rgba(243, 186, 29, 0.2);
    color: rgb(243, 186, 29);
    border: 2px solid rgb(243, 186, 29);
    box-shadow: 0 5px 20px rgba(243, 186, 29, 0.3);
}

.badge-gold:hover {
    box-shadow: 0 8px 30px rgba(243, 186, 29, 0.5);
}

.badge-platinum {
    background: rgba(229, 228, 226, 0.2);
    color: rgb(229, 228, 226);
    border: 2px solid rgb(229, 228, 226);
    box-shadow: 0 5px 20px rgba(229, 228, 226, 0.3);
}

.badge-platinum:hover {
    box-shadow: 0 8px 30px rgba(229, 228, 226, 0.4);
}

.badge-diamond {
    color: rgba(132, 251, 255);
    background: linear-gradient(135deg, rgba(202, 253, 255, 0.3), rgba(134, 134, 134, 0.3));
    border: 2px solid rgba(132, 251, 255);
    box-shadow: 0 5px 20px rgba(132, 251, 255, 0.4);
}

.badge-diamond:hover {
    box-shadow: 0 8px 30px rgba(132, 251, 255, 0.6);
}

.badge-master {
    color: rgb(255, 255, 255);
    background: linear-gradient(135deg, rgba(8, 217, 214, 0.5), rgba(255, 46, 99, 0.5));
    border: 2px solid rgba(255, 46, 99);
    box-shadow: 0 5px 20px rgba(255, 46, 99, 0.5);
}

.badge-master:hover {
    box-shadow: 0 8px 30px rgba(255, 46, 99, 0.8);
}

.badge-twitch {
    background: rgba(145, 70, 255, 0.2);
    color: rgb(169, 112, 255);
    border: 2px solid rgb(145, 70, 255);
}

.badge-steam {
    background: rgba(23, 26, 33, 0.8);
    color: rgb(102, 192, 244);
    border: 2px solid rgb(102, 192, 244);
}

.badge-discord {
    background: rgba(88, 101, 242, 0.2);
    color: rgb(88, 101, 242);
    border: 2px solid rgb(88, 101, 242);
}

.badge-youtube {
    background: rgba(255, 0, 0, 0.2);
    color: rgb(255, 0, 0);
    border: 2px solid rgb(255, 0, 0);
}

.badge-kick {
    background: rgba(83, 255, 26, 0.2);
    color: rgb(83, 255, 26);
    border: 2px solid rgb(83, 255, 26);
}

.badge-kofi {
    background: linear-gradient(135deg, #29ABE0 0%, #F16061 100%);
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 5px 20px rgba(41, 171, 224, 0.3);
}

.badge-kofi:hover {
    box-shadow: 0 8px 30px rgba(41, 171, 224, 0.5);
}

.badge-kofi svg {
    fill: #ffffff;
    width: 0.9rem;
    height: 0.9rem;
}

.badge-speedrunner {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(239, 68, 68);
    border: 2px solid rgb(239, 68, 68);
}

.badge-completionist {
    background: rgba(168, 85, 247, 0.2);
    color: rgb(168, 85, 247);
    border: 2px solid rgb(168, 85, 247);
}

.badge-no-death {
    background: rgba(20, 20, 20, 0.8);
    color: rgb(220, 38, 38);
    border: 2px solid rgb(220, 38, 38);
    box-shadow: 0 5px 20px rgba(220, 38, 38, 0.3);
}

.badge-no-death:hover {
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

.badge-streak {
    background: linear-gradient(135deg, #fb923c, #f59e0b);
    color: #ffffff;
    border: 2px solid #fb923c;
    box-shadow: 0 5px 20px rgba(251, 146, 60, 0.3);
}

.badge-streak:hover {
    box-shadow: 0 8px 30px rgba(251, 146, 60, 0.5);
}

.badge-100-wins {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
    border: 2px solid rgb(34, 197, 94);
}

.badge-veteran {
    background: rgba(245, 158, 11, 0.2);
    color: rgb(245, 158, 11);
    border: 2px solid rgb(245, 158, 11);
}

.badge-community-favorite {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #ffffff;
    border: 2px solid #ec4899;
    box-shadow: 0 5px 20px rgba(236, 72, 153, 0.3);
}

.badge-community-favorite:hover {
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.5);
}

.badge-tournament-winner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #ffffff;
    border: 2px solid #fbbf24;
    box-shadow: 0 5px 20px rgba(251, 191, 36, 0.5);
}

.badge-tournament-winner:hover {
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.7);
}

.badge-rival-slayer {
    background: rgba(255, 46, 99, 0.2);
    color: var(--player-two);
    border: 2px solid var(--player-two);
}

.badge-rank {
    background: rgba(255, 46, 99, 0.2);
    color: var(--player-two);
    border: 2px solid var(--player-two);
}

.badge-bug-finder {
    background: rgba(0, 255, 65, 0.2);
    color: var(--bug-finder-green);
    border: 2px solid var(--bug-finder-green);
    box-shadow: 0 8px 30px rgba(0, 255, 65, 0.4);
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse,
                pixel-flicker 3s infinite steps(10),
                color-scan 2s infinite ease-in-out;
}

.badge-bug-finder::before,
.badge-bug-finder::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
}

.badge-bug-finder::before {
    left: 2px;
    text-shadow: -2px 0 rgba(0, 255, 65, 0.8);
    animation: glitch-anim 2s infinite linear alternate-reverse;
    color: var(--bug-finder-green);
}

.badge-bug-finder::after {
    left: -2px;
    text-shadow: -2px 0 rgba(0, 200, 30, 0.8);
    animation: glitch-anim2 3s infinite linear alternate-reverse;
    color: var(--bug-finder-green);
}

@keyframes glitch-anim {
    0% { clip-path: inset(0 0 90% 0); transform: translate(-2px, -2px); }
    20% { clip-path: inset(20% 0 60% 0); transform: translate(2px, 2px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 1px); }
    60% { clip-path: inset(60% 0 20% 0); transform: translate(1px, -1px); }
    80% { clip-path: inset(80% 0 5% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(0 0 90% 0); transform: translate(0, 0); }
}

@keyframes glitch-anim2 {
    0% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
    25% { clip-path: inset(10% 0 85% 0); transform: translate(-2px, 2px); }
    50% { clip-path: inset(40% 0 43% 0); transform: translate(2px, -1px); }
    75% { clip-path: inset(10% 0 85% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(0 0 90% 0); transform: translate(0, 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(0.5deg); }
    40% { transform: skew(-0.5deg); }
    60% { transform: skew(0.3deg); }
    80% { transform: skew(-0.3deg); }
    100% { transform: skew(0deg); }
}

@keyframes pixel-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        filter: none;
    }
    20%, 24%, 55% {
        opacity: 0.9;
        filter: contrast(150%) brightness(120%) saturate(150%);
    }
}

@keyframes color-scan {
    0%, 100% {
        filter: drop-shadow(0 0 2px var(--bug-finder-green));
    }
    50% {
        filter: drop-shadow(2px 0 4px var(--bug-finder-green)) drop-shadow(-2px 0 4px rgba(0, 200, 30, 0.8));
    }
}

.badge-bug-finder i {
    position: relative;
    z-index: 1;
}

.badge-bug-finder span {
    position: relative;
    z-index: 1;
}
/* Season badges */
.badge-season-champion {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1f2937;
    border: 2px solid #fbbf24;
    box-shadow: 0 5px 20px rgba(251, 191, 36, 0.4);
}

.badge-season-runner-up {
    background: linear-gradient(135deg, #9ca3af, #e5e7eb);
    color: #1f2937;
    border: 2px solid #e5e7eb;
}

.badge-season-third {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #ffffff;
    border: 2px solid #d97706;
}
