#color-palette {
    box-sizing: border-box;
    filter: drop-shadow(0 0 0.4rem rgba(72, 72, 72, 0.6));
    position: fixed;
    bottom: 0px;
    width: 100%;
    padding: 20px;
    border-radius: 25px 0 0 0;
    translate: 0 100%;
    background-color: rgba(255,255,255,0);
    transition: translate 0.3s ease-in-out, background-color 0.3s cubic-bezier(.53,.83,.71,.96);
}

#color-tab {
    position: absolute;
    background-color: white;
    border-radius: 25px 25px 0 0;
    padding: 20px;
    top: 0;
    right: 0;
    translate: 0 -90%;
    cursor: pointer;
}

#color-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(8, calc((100vw - 40px - 9vw) / 8));
    grid-template-rows: repeat(4, calc((100vw - 40px - 9vw) / 8));
    grid-gap: 1vw;
    justify-content: center; /* Centers the grid when it's not full width */
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(.2,.93,.71,.96);
}

#color-palette.active > #color-container {
    opacity: 1;
}

.colors {
    width: 100%;
    aspect-ratio: 1;
    transition: transform 0.3s ease;
    cursor: pointer;
}
#color-palette.palette-disabled .colors {
    outline: 1px solid black;
    background-image: linear-gradient(-45deg, transparent 49%, black 49%, black 51%, transparent 51%);
    background-size: contain;
    background-position: center;
}

.colors:last-child {
    outline: 1px solid black;
}

#color-palette.active {
    translate: 0 0;
    opacity: 1;
    background-color: rgba(255,255,255,1);
}

@media (min-width: 620px) and (max-width: 1200px) {
    #color-container {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(16, calc((100vw - 40px - 16vw) / 16));
        grid-template-rows: repeat(2, calc((100vw - 40px - 16vw) / 16));
        grid-gap: 1vw;
        justify-content: center; /* Centers the grid when it's not full width */
        opacity: 0;
        transition: opacity 0.3s cubic-bezier(.2,.93,.71,.96);
    }
}
@media only screen and (min-width: 1200px) {
    #color-palette {
        position: fixed;
        right: 0;
        top: 15%;

        height: fit-content;
        width: auto;
        padding: 1.7vw;
        border-radius: 20px 0 0 20px;
        translate: 100% 0;
    }
    #color-container {
        width: 100%;
        display: grid;
        grid-template-rows: repeat(8, 2.65vw);
        grid-template-columns: repeat(4, 2.65vw);
        grid-gap: .55vw;
        justify-content: center;
    }
    #color-tab {
        width: fit-content;
        border-radius: 20px 0 0 20px;
        padding: 20px;
        top: 8%;
        left: 0;
        translate: -95% 0;
    }
    .colors:hover {
        transform: scale(1.1);
    }
}
  