/* badge.bar - Dopamine Neon Burst Landing */
/* Palette: #1a1a2e, #25254a, #ff1493, #ffea00, #00b4d8, #9b59b6, #ffd700, #c0c0c0, #f0f0f0 */

:root {
    --bg: #1a1a2e;
    --card: #25254a;
    --pink: #ff1493;
    --yellow: #ffea00;
    --blue: #00b4d8;
    --purple: #9b59b6;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --text: #f0f0f0;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #2d1b4e, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientPulse 6s ease infinite;
    position: relative;
}

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

.hero-brand {
    font-family: 'Bungee', cursive;
    font-size: clamp(3rem, 10vw, 7rem);
    color: var(--yellow);
    text-shadow: 0 0 20px rgba(255, 234, 0, 0.5), 0 0 60px rgba(255, 20, 147, 0.3);
    animation: brandSlam 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes brandSlam {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.hero-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.counter-number {
    font-family: 'Bungee', cursive;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--pink);
}

.counter-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(240, 240, 240, 0.6);
}

/* Toast */
.toast {
    position: fixed;
    top: 1.5rem;
    right: -350px;
    width: 300px;
    background: var(--card);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 200;
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.toast.show { right: 1.5rem; }

.toast-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.3), var(--gold) 60%);
    border: 2px solid var(--gold);
    flex-shrink: 0;
    animation: badgeSpin 2s linear infinite;
}

@keyframes badgeSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.toast-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
}

.toast-desc {
    font-size: 0.75rem;
    color: rgba(240, 240, 240, 0.6);
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: 40%;
    left: 50%;
    opacity: 0;
    animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(720deg); opacity: 0; }
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(26, 26, 46, 0.95);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-pill {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--card);
    color: rgba(240, 240, 240, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-pill.active {
    background: var(--pink);
    color: var(--text);
    border-color: var(--pink);
}

/* Badge Wall */
.badge-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 220px;
    gap: 16px;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.badge-card {
    background: var(--card);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.badge-card.show {
    opacity: 1;
    transform: scale(1);
    animation: cardPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.badge-card:hover { transform: scale(1.05); }

.badge-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.badge-card:hover::after { transform: translateX(100%); }

.card-large { grid-row: span 2; grid-column: span 2; }
.card-wide { grid-column: span 2; }

/* Rarity Glows */
.rarity-common { border: 1px solid rgba(192, 192, 192, 0.3); }
.rarity-rare { border: 1px solid rgba(0, 180, 216, 0.4); box-shadow: 0 0 15px rgba(0, 180, 216, 0.15); }
.rarity-epic { border: 1px solid rgba(155, 89, 182, 0.4); box-shadow: 0 0 15px rgba(155, 89, 182, 0.2); }
.rarity-legendary { border: 1px solid rgba(255, 215, 0, 0.5); box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); animation: legendGlow 2s ease-in-out infinite; }

@keyframes legendGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.35); }
}

/* Badge Emblem */
.badge-emblem {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.emblem-common {
    border: 3px solid var(--silver);
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.2), rgba(192,192,192,0.1) 60%);
}

.emblem-rare {
    border: 3px solid var(--blue);
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.2), rgba(0,180,216,0.15) 60%);
}

.emblem-epic {
    border: 3px solid var(--purple);
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.2), rgba(155,89,182,0.15) 60%);
}

.emblem-legendary {
    border: 3px solid var(--gold);
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.3), rgba(255,215,0,0.15) 60%);
}

.emblem-icon {
    font-size: 1.5rem;
    color: rgba(240, 240, 240, 0.8);
}

.badge-ribbon {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid rgba(255,255,255,0.1);
    margin-top: -2px;
}

.badge-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.75rem;
}

.rarity-tag {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.tag-common { color: var(--silver); border: 1px solid rgba(192,192,192,0.3); }
.tag-rare { color: var(--blue); border: 1px solid rgba(0,180,216,0.3); }
.tag-epic { color: var(--purple); border: 1px solid rgba(155,89,182,0.3); }
.tag-legendary { color: var(--gold); border: 1px solid rgba(255,215,0,0.3); }

/* Progress Section */
.progress-section {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
}

.section-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--pink);
    text-align: center;
    margin-bottom: 2rem;
}

.progress-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.progress-badge-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px dashed rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.progress-info { flex: 1; }

.progress-name {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: repeating-linear-gradient(45deg, var(--pink), var(--pink) 10px, #ff3da8 10px, #ff3da8 20px);
    background-size: 28px 8px;
    animation: stripeMove 1s linear infinite;
    transition: width 1.5s ease-out;
}

@keyframes stripeMove {
    0% { background-position: 0 0; }
    100% { background-position: 28px 0; }
}

.progress-stat {
    font-family: 'Bungee', cursive;
    font-size: 0.75rem;
    color: var(--pink);
    margin-top: 0.3rem;
    display: block;
}

/* Hall of Fame */
.hall-of-fame {
    padding: 4rem 2rem;
    text-align: center;
}

.fame-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.fame-card {
    background: var(--card);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 280px;
    position: relative;
    overflow: hidden;
}

.fame-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1), transparent 60%);
    transform: translate(-50%, -50%);
    animation: fameGlow 3s ease-in-out infinite;
}

@keyframes fameGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.fame-emblem {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
    position: relative;
    z-index: 1;
}

.fame-emblem .emblem-icon { font-size: 2.5rem; }

.fame-name {
    font-family: 'Bungee', cursive;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.fame-desc {
    font-size: 0.8rem;
    color: rgba(240, 240, 240, 0.5);
    position: relative;
    z-index: 1;
}

.keep-earning {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--yellow);
    text-shadow: 0 0 20px rgba(255, 234, 0, 0.3);
}

/* Fade In */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .badge-wall {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }
    .card-large { grid-row: span 2; grid-column: span 2; }
    .card-wide { grid-column: span 2; }
    .filter-bar { flex-wrap: wrap; }
    .fame-grid { flex-direction: column; align-items: center; }
}
