/* The 10-brick collection progress graphic, shared by collection.html and how-it-works.html (lego-bricks.js). */
/* LEGO Brick Styles - ENHANCED WITH TWO-ROW OVERFLOW SYSTEM */

.lego-brick-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    flex-wrap: nowrap !important;
    margin: 16px 0;
    padding: 12px 4px 20px 4px; /* Start with mobile padding */
    background: #2c3e50;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px; /* Start small */
    overflow: hidden;
}

.lego-brick {
    /* SIZE FOR SMALLEST SCREENS FIRST (320px) */
    width: 20px !important;  /* Tiny mobile size */
    height: 26px !important; /* Maintains 40:52 ratio */
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin-top: 3px;
    transform-origin: center bottom;
}

.brick-stud {
    width: 9px;  /* Proportional to 20px brick */
    height: 4px;
    border-radius: 1px;
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 1;
}

.brick-body {
    width: 100%;
    height: 26px; /* Same as brick height */
    border-radius: 2px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 2;
}

.percentage-label {
    position: absolute;
    bottom: -12px;
    font-size: 6px; /* Tiny for mobile */
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    width: 100%;
    text-align: center;
}

/* NOW SCALE UP FOR LARGER SCREENS */
@media (min-width: 480px) {
    .lego-brick {
        width: 28px !important;
        height: 36px !important;
    }
    .brick-stud {
        width: 13px;
        height: 6px;
        top: -6px;
    }
    .brick-body {
        height: 36px;
    }
    .percentage-label {
        font-size: 7px;
        bottom: -14px;
    }
    .lego-brick-container {
        padding: 14px 6px 24px 6px;
        min-height: 65px;
    }
}

@media (min-width: 768px) {
    .lego-brick {
        width: 35px !important;
        height: 46px !important;
    }
    .brick-stud {
        width: 16px;
        height: 7px;
        top: -7px;
    }
    .brick-body {
        height: 46px;
    }
    .percentage-label {
        font-size: 8px;
        bottom: -16px;
    }
    .lego-brick-container {
        padding: 18px 10px 30px 10px;
        min-height: 80px;
    }
}

@media (min-width: 1024px) {
    .lego-brick {
        width: 40px !important;
        height: 52px !important;
    }
    .brick-stud {
        width: 18px;
        height: 8px;
        top: -8px;
    }
    .brick-body {
        height: 52px;
    }
    .percentage-label {
        font-size: 9px;
        bottom: -18px;
    }
    .lego-brick-container {
        padding: 24px 16px 40px 16px;
        min-height: 100px;
    }
}
        
.overflow-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid #f39c12;
}

.complete-container {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    border: 2px solid #f1c40f;
}


.lego-brick:hover {
    transform: scale(1.1) rotateY(10deg);
}

.brick-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 4px 4px;
    transition: height 1s ease-out;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.brick-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    font-size: 12px;
    color: #666;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}

.gold-sparkle {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 14px;
    animation: sparkle 2s infinite;
    z-index: 10;
}

.overflow-separator {
    margin: 16px 0 8px 0;
    text-align: center;
    color: #f39c12;
    font-weight: bold;
    font-size: 12px;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes goldPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes goldShimmer {
    0%, 100% { 
        box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 20px rgba(255, 215, 0, 0.6); 
    }
    50% { 
        box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 30px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 237, 78, 0.7); 
    }
}

.complete-gold {
    animation: goldShimmer 3s infinite;
}

.complete-crown {
    font-size: 16px;
    color: #f1c40f;
    font-weight: bold;
    animation: goldPulse 2s infinite;
    text-align: center;
    margin-bottom: 8px;
}

