body {
    font-family: Arial, sans-serif;
    display: grid;
    justify-items: center;
    align-items: center;
    background-color: rgb(24, 24, 24);
    color: white;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background-repeat: repeat;
}

body::before {
    opacity: 0.42;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.2px, transparent 1.7px),
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 2px, transparent 2.7px),
        radial-gradient(circle, rgba(210, 235, 255, 0.65) 0 1px, transparent 1.5px);
    background-size: 120px 120px, 240px 240px, 360px 360px;
    background-position: 15px 20px, 65px 80px, 170px 10px;
    animation: snow-fall 18s linear infinite;
}

body::after {
    opacity: 0.22;
    filter: blur(0.6px);
    background-image:
        radial-gradient(circle, #fff 0 2px, transparent 2.8px),
        radial-gradient(circle, rgba(220, 240, 255, 0.8) 0 3px, transparent 3.8px);
    background-size: 160px 160px, 320px 320px;
    background-position: 40px 15px, 110px 75px;
    animation: snow-fall-close 28s linear infinite;
}

@keyframes snow-fall {
    from {
        background-position: 15px -700px, 65px -640px, 170px -710px;
    }
    to {
        background-position: 135px 20px, 185px 80px, 290px 10px;
    }
}

@keyframes snow-fall-close {
    from {
        background-position: 40px -1265px, 110px -1205px;
    }
    to {
        background-position: 200px 15px, 270px 75px;
    }
}

.mobileLogo {
    display: none;
}

.header {
    z-index: 5;
    position: sticky;
    position: --webkit-sticky;
    top: 0px;
    display: inline-flex;
    justify-items: center;
    align-items: center;
    background-color: rgb(24, 24, 24);
    padding-left: 200px;
    padding-right: 200px;
    padding-top: 10px;
}

.logo {
    margin: 15px;
    margin-bottom: 25px;
    margin-left: 0px;
}

.previewBg {
    align-items: center;
    vertical-align: middle;
    display: flex;
    height: 1.6em;
    width: 17em;
    margin: 3px;
    margin-right: 10px;
    background-size: 275px 10000px;
    -webkit-animation-name: animateBackground;
    animation-name: animateBackground;
    -webkit-animation-duration: 5s;
    animation-duration: 5s;
    -webkit-animation-timing-function: steps(149, end);
    animation-timing-function: steps(149, end);
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
    image-rendering: pixelated;
    unicode-bidi: isolate;
    border-radius: 7px;
    padding-bottom: 4px;
    /* box-shadow: inset 0px -3px 0px 1px rgb(50, 50, 50); */
    border: 2px solid rgb(65,65,65);
}

.pattern {
    display: grid;
    grid-template-columns: repeat(1, 3fr 5fr 2.5fr);
    justify-self: center;
    align-items: center;
    border: 2px solid rgb(65,65,65);
    border-radius: 7px;
    padding-left: 10px;
    margin: 3px;
    padding-right: 5px;
    /* background-color: aliceblue; */
}

.pattern:hover {
    border: 2.7px solid rgb(120,120,120);
    background-color: rgb(10,10,10);
}

.button {
    padding: 5px 10px;
    border-radius: 5px;
    margin: 3px;
    border: none;
    font-size: 14px;
    margin-left: 5px;
    color: white;
}

.button:hover {
    cursor: pointer;
    filter: brightness(0.8);
}

.button:active {
    filter: brightness(0.6);
    transform: translateY(2px);
}

.button:disabled {
    opacity: 0.5;
    cursor: default;
    transform: translateY(2px);
}

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

.buttons {
    display: inline;
}

.category {
    color: rgb(100,100,100);
    font-size: 12px;
}

.labels {
    display: grid;
    grid-template-columns: 1fr;
}

.category-buttons {
    z-index: 3;
    display: flex;
    position: sticky;
    justify-content: center;
    gap: 10px;
    width: 80%;
    flex-wrap: wrap;
    position: -webkit-sticky;
    top: 125px;
    background-color: rgb(24, 24, 24);
    padding-bottom: 10px;
    padding-top: 10px;
    border-bottom: 2px solid rgb(180,180,180);
}

.category-button {
    font-size: 16px;
    color: white;
    border: none;
    margin-left: 5px;
    margin-right: 5px;
    background-color: rgb(65, 65, 65);
    padding: 10px;
    border-radius: 7px;
    margin-bottom: 12px;
}

.category-button:hover {
    cursor: pointer;
    filter: brightness(0.8);
    /* border: 1px solid white; */
}

.category-button:active {
    filter: brightness(0.6);
    transform: translateY(2px);
}

.search-container {
    z-index: 20;
    border-radius: 7px;
    background-color: rgb(65, 65, 65);
    position: fixed;
    display: grid;
    grid-template-columns: 7fr 1fr;
    top: 10px;
    right: 10px;
    justify-items: center;
    align-items: center;
}

.searchbar {
    background-color: rgb(65, 65, 65);
    border: none;
    font-size: 16px;
    color: white;
    padding: 3px;
    margin: 5px;
}

.searchbar:focus {
    outline: none;
}

.search-icon:hover {
    cursor: pointer;
    filter: brightness(0.8);
}

canvas {
    border-radius: 7px;
    width: 42em;
    border: 2px solid rgb(65, 65, 65);
}

.previewer-container {
    display: none;
    z-index: 5;
    position: sticky;
    top: 125px;
    position: -webkit-sticky;
    padding-bottom: 0;
    background-color: rgb(24, 24, 24);
    padding-left: 200px;
    padding-right: 200px;

}

.close-preview {
    position: absolute;
    background-color: rgb(65, 65, 65);
    outline: none;
    border: none;
    border-radius: 7px;
    padding: 5px;
    color: white;   
}

.close-preview:hover {
    cursor: pointer;
    background-color: rgb(40,40,40);
    color: rgb(255,0,0);
}

.status-container {
    z-index: 20;
    position: fixed;
    left: 10px;
    top: 10px;
    display: grid;
    padding: 10px;
    grid-template-columns: 1fr 5fr;
    align-items: center;
    gap: 10px;
}

.indicator {
    border-radius: 100%;
    border: none;
    outline: none;
    height: 15px;
    width: 15px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        display: block;
    }

    .header {
        padding: 0;
        width: 100%;
        align-items: center;
        display: flex;
        padding-top: 20px;
        justify-content: center;
        gap: 10px;
    }

    .logo {
        display: none;
    }

    .mobileLogo {
        display: block;
    }

    .category-buttons {
        top: 80px;
        padding-left: 30px;
        padding-right: 30px;
        margin-top: 0;
        padding-top: 20px;
        width: 90%;
        gap: 5px;
    }

    .category-button {
        font-size: 12px;
        padding: 5px 10px;
        margin: 1px;
    }

    .previewBg {
        width: 90%;
        justify-self: center;
        font-size: 0.9em;
    }

    .pattern {
        grid-template-columns: 1fr;
        padding: 5px;
    }

    .search-container {
        top: unset;
        bottom: 10px;
        /* right: 10px; */
        width: 90%;
        justify-self: center;
        right: auto;
        left: auto;
        grid-template-columns: 6fr 1fr;
    }

    .searchbar {
        justify-self: center;
        font-size: 14px;
        width: 90%;
    }

    canvas {
        width: 100%;
    }

    .previewer-container {
        padding-left: 20px;
        padding-right: 20px;
        top: 85px;
        padding-top: 20px;
        padding-bottom: 0;
    }

    .status-container {
        display: flex;
        align-items: center;
        top: 10px;
        right: 0px;
        left: auto;
        background-color: transparent;
        padding: 5px;
        gap: 5px;
    }

    .buttons {
        display: block;
        justify-self: center;
    }

    .indicator {
        height: 12px;
        width: 12px;
    }

    .container {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}
