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

body {
    font-family: 'Rubik', sans-serif;
    background: #FFF5E1;
    color: #1A1A1A;
    overflow-x: hidden;
    position: relative;
}

/* Terrazzo Border */
#terrazzo-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    border: 20px solid transparent;
    border-image: repeating-linear-gradient(
        45deg,
        #FF6633 0px, #FF6633 5px,
        #33CC99 5px, #33CC99 10px,
        #FFD23F 10px, #FFD23F 15px,
        #9966FF 15px, #9966FF 20px,
        #3366FF 20px, #3366FF 25px,
        #FF3366 25px, #FF3366 30px
    ) 20;
}

/* Badge Sections */
.badge-section {
    position: relative;
    padding: 4rem 2rem;
}

/* Marquee Hero */
#marquee {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFF5E1;
    text-align: center;
}

.hero-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1A1A1A;
    text-shadow: 4px 4px 0 #FF6633, 8px 8px 0 #33CC99;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-title.visible {
    opacity: 1;
    transform: scale(1);
}

.hero-subtitle {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #9966FF;
    margin-top: 1rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
}

.hero-subtitle.visible {
    opacity: 1;
}

.insert-coin-btn {
    font-family: 'Bungee', cursive;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    background: #FFD23F;
    color: #1A1A1A;
    border: 3px solid #1A1A1A;
    box-shadow: 4px 4px 0 #1A1A1A;
    cursor: pointer;
    margin-top: 2rem;
    text-transform: uppercase;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    opacity: 0;
    transition: opacity 0.5s ease 0.5s, transform 0.1s ease, box-shadow 0.1s ease;
}

.insert-coin-btn.visible {
    opacity: 1;
}

.insert-coin-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #1A1A1A;
}

.insert-coin-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #1A1A1A;
}

/* Section Titles */
.section-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
    color: #1A1A1A;
    text-align: center;
    letter-spacing: 0.03em;
}

/* Zigzag Divider */
.zigzag-divider {
    width: 200px;
    height: 12px;
    margin: 1rem auto 2.5rem;
    background: repeating-linear-gradient(
        90deg,
        #FF6633 0px, transparent 0px,
        transparent 10px
    ),
    repeating-linear-gradient(
        -45deg,
        #33CC99 0px, #33CC99 5px,
        #FFD23F 5px, #FFD23F 10px,
        #9966FF 10px, #9966FF 15px
    );
    background-size: 20px 12px;
    clip-path: polygon(
        0% 50%, 5% 0%, 10% 50%, 15% 0%, 20% 50%, 25% 0%, 30% 50%, 35% 0%,
        40% 50%, 45% 0%, 50% 50%, 55% 0%, 60% 50%, 65% 0%, 70% 50%, 75% 0%,
        80% 50%, 85% 0%, 90% 50%, 95% 0%, 100% 50%,
        100% 100%, 95% 50%, 90% 100%, 85% 50%, 80% 100%, 75% 50%, 70% 100%,
        65% 50%, 60% 100%, 55% 50%, 50% 100%, 45% 50%, 40% 100%, 35% 50%,
        30% 100%, 25% 50%, 20% 100%, 15% 50%, 10% 100%, 5% 50%, 0% 100%
    );
}

/* Badge Grid */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Badge Cards */
.badge-card {
    background: white;
    border: 3px solid #1A1A1A;
    box-shadow: 4px 4px 0 #1A1A1A;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
    transform: translateY(20px) rotate(0deg);
}

.badge-card.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

.badge-card:hover {
    transform: translateY(-4px) rotate(-1deg);
    box-shadow: 6px 6px 0 #1A1A1A;
}

.badge-shape {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--badge-color, #33CC99);
    border: 2px solid #1A1A1A;
}

.badge-circle .badge-shape {
    border-radius: 50%;
}

.badge-hexagon .badge-shape {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: none;
}

.badge-shield .badge-shape {
    clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 50% 100%, 0% 70%);
    border: none;
}

.badge-star .badge-shape {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: none;
}

.badge-rectangle .badge-shape {
    border-radius: 8px;
}

.badge-icon {
    font-size: 2rem;
    color: white;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

.badge-name {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1A1A1A;
    margin-bottom: 0.3rem;
}

.badge-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.badge-rarity {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
}

.rarity-common { background: #E0E0E0; color: #666; }
.rarity-rare { background: #3366FF; color: white; }
.rarity-epic { background: #9966FF; color: white; }
.rarity-legendary { background: #FFD23F; color: #1A1A1A; border: 1px solid #1A1A1A; }

/* Progress Section */
.progress-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.progress-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
}

.progress-pct {
    font-family: 'Bungee', cursive;
    font-size: 0.8rem;
    color: #FF6633;
}

.progress-track {
    height: 20px;
    background: white;
    border: 3px solid #1A1A1A;
    box-shadow: 3px 3px 0 #1A1A1A;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--fill-color, #33CC99);
    transition: width 1.5s ease;
}

.progress-fill.animated {
    width: var(--fill-width, 0%);
}

/* Leaderboard */
.leaderboard-table {
    max-width: 600px;
    margin: 0 auto;
}

.leader-row {
    display: grid;
    grid-template-columns: 50px 1fr 80px 100px;
    padding: 0.75rem 1rem;
    border: 2px solid #1A1A1A;
    margin-bottom: -2px;
    background: white;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.leader-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.leader-header {
    background: #1A1A1A;
    color: white;
    font-family: 'Bungee', cursive;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    opacity: 1;
    transform: none;
}

.leader-rank {
    font-family: 'Bungee', cursive;
    font-size: 0.9rem;
}

.rank-gold { color: #FFD23F; }
.rank-silver { color: #C0C0C0; }
.rank-bronze { color: #CD7F32; }

.leader-name {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
}

.leader-badges {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #9966FF;
    text-align: center;
}

.leader-score {
    font-family: 'Bungee', cursive;
    font-size: 0.8rem;
    color: #FF6633;
    text-align: right;
}

/* Footer */
#footer {
    background: #1A1A1A;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-brand {
    font-family: 'Bungee', cursive;
    font-size: 1.5rem;
    color: #FFD23F;
    display: block;
}

.footer-tagline {
    font-family: 'Rubik', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    display: block;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 768px) {
    .badge-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .leader-row {
        grid-template-columns: 40px 1fr 60px 80px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    #terrazzo-border {
        border-width: 10px;
    }
}

@media (max-width: 480px) {
    .badge-grid {
        grid-template-columns: 1fr;
    }
}
