/* =============================================
   badge.bar - Holographic Badge Showcase
   Memphis Bold Shapes + Holographic 3D Product
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #1a1028;
    --card-surface: #2a1d3d;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --text: #f0e6ff;
    --accent-pink: #ff6b9d;
    --accent-cyan: #00e5ff;
    --accent-purple: #a78bfa;
    --success: #22c55e;
    --wood-1: #8b6914;
    --wood-2: #a0522d;
    --wood-3: #654321;
    --holo-angle: 135deg;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    position: relative;
}

/* --- Star Accent Background Decorations --- */
#star-accents {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star-accent {
    position: absolute;
    opacity: 0.05;
    background: var(--gold);
}

.star-1 {
    width: 80px;
    height: 80px;
    top: 5%;
    left: 8%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(15deg);
}

.star-2 {
    width: 120px;
    height: 120px;
    top: 15%;
    right: 5%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(-25deg);
}

.star-3 {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 3%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(45deg);
}

.star-4 {
    width: 100px;
    height: 100px;
    top: 60%;
    right: 10%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(-10deg);
}

.star-5 {
    width: 50px;
    height: 50px;
    top: 80%;
    left: 15%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(30deg);
}

.star-6 {
    width: 90px;
    height: 90px;
    top: 30%;
    right: 20%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(60deg);
}

.star-7 {
    width: 70px;
    height: 70px;
    top: 70%;
    left: 40%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(-40deg);
}

.star-8 {
    width: 110px;
    height: 110px;
    top: 90%;
    right: 30%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: rotate(20deg);
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5em;
    background: linear-gradient(135deg, var(--gold), var(--accent-pink), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================================
   HERO: The Trophy Case
   ================================== */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
    padding: 2rem;
}

#hero-title {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, var(--gold) 0%, #ffec80 40%, var(--gold) 60%, #fff5b3 80%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
    animation: titleShimmer 3s ease-in-out infinite;
    background-size: 200% 100%;
}

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

/* Hero Badge Container */
#hero-badge-container {
    perspective: 600px;
    width: 240px;
    height: 240px;
    margin-bottom: 2rem;
}

#hero-badge {
    width: 100%;
    height: 100%;
    animation: heroBadgeRotate 4s ease-in-out infinite;
    transform-style: preserve-3d;
    position: relative;
}

@keyframes heroBadgeRotate {
    0%, 100% { transform: perspective(600px) rotateY(-15deg); }
    50% { transform: perspective(600px) rotateY(15deg); }
}

.hero-badge-face {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-badge-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

.hero-badge-holo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--holo-angle),
        rgba(255, 107, 157, 0.3),
        rgba(255, 215, 0, 0.3),
        rgba(0, 229, 255, 0.3),
        rgba(167, 139, 250, 0.3),
        rgba(255, 107, 157, 0.3));
    mix-blend-mode: color-dodge;
    border-radius: 50%;
    pointer-events: none;
    animation: holoShift 3s ease-in-out infinite;
}

@keyframes holoShift {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

#hero-tagline {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--text);
    text-align: center;
    opacity: 0.85;
}

/* --- Memphis Geometric Decorations --- */
.memphis-shape {
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.memphis-circle-1 {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid var(--accent-pink);
    top: 12%;
    left: 6%;
    opacity: 0.4;
    animation: memphisBounce 5s ease-in-out infinite;
}

.memphis-circle-2 {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-cyan);
    bottom: 15%;
    right: 10%;
    opacity: 0.25;
    animation: memphisBounce 6s ease-in-out infinite 1s;
}

.memphis-triangle-1 {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid var(--accent-purple);
    top: 20%;
    right: 8%;
    opacity: 0.3;
    animation: memphisSpin 8s linear infinite;
}

.memphis-triangle-2 {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid var(--accent-pink);
    bottom: 20%;
    left: 12%;
    opacity: 0.25;
    animation: memphisSpin 10s linear infinite reverse;
}

.memphis-zigzag-1 {
    top: 50%;
    left: 2%;
    width: 50px;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0px,
        var(--gold) 8px,
        transparent 8px,
        transparent 12px
    );
    opacity: 0.2;
    transform: rotate(-20deg);
}

@keyframes memphisBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

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

/* ==================================
   BADGE WALL: Masonry Grid
   ================================== */
#badge-wall {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

#masonry-grid {
    columns: 4;
    column-gap: 20px;
}

@media (max-width: 1024px) {
    #masonry-grid { columns: 3; }
}

@media (max-width: 768px) {
    #masonry-grid { columns: 2; }
}

@media (max-width: 480px) {
    #masonry-grid { columns: 1; }
}

/* --- Badge Card --- */
.badge-card {
    break-inside: avoid;
    background: var(--card-surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
}

.badge-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 40px rgba(255, 215, 0, 0.15);
}

/* --- Badge Ribbon --- */
.badge-ribbon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 24px;
    background: var(--ribbon-color, var(--accent-pink));
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
    z-index: 2;
}

/* --- Badge Visual --- */
.badge-visual {
    position: relative;
    width: 100%;
    max-width: 120px;
    margin: 10px auto 8px;
}

.badge-shape-svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: filter 0.3s ease;
}

.badge-card:hover .badge-shape-svg {
    filter: drop-shadow(0 6px 20px rgba(255, 215, 0, 0.4));
}

.badge-holo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--holo-angle),
        rgba(255, 107, 157, 0.15),
        rgba(255, 215, 0, 0.15),
        rgba(0, 229, 255, 0.15),
        rgba(167, 139, 250, 0.15),
        rgba(255, 107, 157, 0.15));
    background-size: 200% 200%;
    mix-blend-mode: color-dodge;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.badge-card:hover .badge-holo-overlay {
    opacity: 1;
    animation: holoGradientMove 2s linear infinite;
}

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

/* --- Badge Shelf Shadow --- */
.badge-shelf-shadow {
    width: 80%;
    height: 6px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
    margin: 4px auto 10px;
    border-radius: 50%;
}

/* --- Badge Text --- */
.badge-label {
    font-family: 'Rubik', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
}

.badge-meta {
    font-family: 'Nunito', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(240, 230, 255, 0.5);
    margin-bottom: 6px;
    display: block;
}

.badge-verified {
    font-family: 'Rubik', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.verified-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: verifiedPulse 2s ease-in-out infinite;
}

@keyframes verifiedPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

/* ==================================
   THE BAR COUNTER
   ================================== */
#bar-counter {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem 2rem;
    text-align: center;
}

.bar-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    color: rgba(240, 230, 255, 0.6);
    margin-bottom: 2rem;
}

#bar-surface {
    background: linear-gradient(180deg, #8b6914 0%, #a0522d 20%, #8b6914 40%, #654321 100%);
    border-radius: 12px 12px 0 0;
    padding: 30px 20px 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 30px;
    overflow-x: auto;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    box-shadow:
        0 4px 0 0 #4a3010,
        0 8px 0 0 #3a2510,
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Wood grain texture */
#bar-surface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 8px,
        rgba(0, 0, 0, 0.04) 8px,
        rgba(0, 0, 0, 0.04) 10px
    );
    border-radius: inherit;
    pointer-events: none;
}

/* Bar edge highlight */
#bar-surface::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.bar-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

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

.bar-badge-svg {
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s ease;
}

.bar-badge:hover .bar-badge-svg {
    filter: drop-shadow(0 6px 16px rgba(255, 215, 0, 0.5));
}

.bar-badge-name {
    font-family: 'Rubik', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

/* ==================================
   CONFETTI CONTAINER
   ================================== */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

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

/* ==================================
   RESPONSIVE ADJUSTMENTS
   ================================== */
@media (max-width: 768px) {
    #hero {
        padding: 1.5rem;
    }

    #hero-badge-container {
        width: 180px;
        height: 180px;
    }

    #bar-surface {
        gap: 16px;
        padding: 20px 16px 30px;
        justify-content: flex-start;
    }

    .bar-badge-svg {
        width: 55px;
        height: 55px;
    }

    .memphis-circle-1,
    .memphis-circle-2,
    .memphis-triangle-1,
    .memphis-triangle-2,
    .memphis-zigzag-1 {
        display: none;
    }
}

@media (max-width: 480px) {
    #hero-badge-container {
        width: 150px;
        height: 150px;
    }

    .badge-card {
        padding: 14px;
    }
}
