.lego-color-guide-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 0;
}

.color-guide-intro {
    text-align: center;
    margin-bottom: 20px;
}

.lego-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 150px));
    justify-content: center;
    gap: 18px;
}

.lego-color-item {
    width: 150px;
    min-height: 220px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: transform .2s, box-shadow .2s;

    display: grid;
    grid-template-rows: 90px auto;
    align-items: start;
}

.lego-color-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.brick-png-swatch {
    width: 100px;
    aspect-ratio: 300 / 220;
    margin: 0 auto;
    position: relative;
    align-self: center;
}

.brick-png-swatch::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--brick-color);

    -webkit-mask-image: url("/assets/images/color-guide/brick-mask.png");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;

    mask-image: url("/assets/images/color-guide/brick-mask.png");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.brick-png-swatch img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.color-name {
    display: block;
    margin-top: 4px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    align-self: start;
}

.bricklink-name {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #666;
    line-height: 1.2;
    align-self: start;
}

.color-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 999;
}

.color-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 360px;
    max-width: 92%;
    max-height: 90%;
    overflow-y: auto;
    background: #fff;
    padding: 24px;
    border-radius: 14px;
    text-align: center;
    z-index: 1000;
}

.modal-png-swatch {
    width: 220px;
}

.modal-close {
    margin-top: 15px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #952121;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

@media only screen and (max-width: 600px) {

    .lego-color-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

.lego-color-item {
    width: 100%;
    min-height: auto;
    padding: 8px 6px 10px;

    grid-template-rows: 62px auto auto;
}

    .brick-png-swatch {
        width: 72px;
    }
	.color-name,
.bricklink-name {
    overflow-wrap: anywhere;
}

    .color-name {
        font-size: 12px;
		    margin-top: 2px;
    line-height: 1.15;
    }

    .bricklink-name {
        font-size: 11px;
		    margin-top: 3px;
    line-height: 1.15;
    }

    .modal-png-swatch {
        width: 170px;
    }

    .color-modal {
        min-width: 85%;
        padding: 18px;
    }
}