#board {
    position: relative;
    background-image: url('../png/ui/grass.png');
    background-size: 20%;
    border: 2px solid #5f00ff;
    border-radius: var(--board-border-radius);
    box-shadow: 0 0 64px #5f00ff7f;
    transform-origin: 0 0;
}

#board-container {
    transition: all 100ms ease;
}

.card {
    position: absolute;
    display: grid;
    grid: 100% / 100%;
    width: 278px;
    height: 478px;
    border-radius: 18px;
    box-shadow: 0 0 4px black;
    transition: all 100ms ease, opacity 250ms ease, transform 250ms ease;
    user-select: none;

    &.shop-card {
        transform: scale(0.5);
        transform-origin: 0 0;
    }

    & .background {
        grid-area: 1 / 1 / 2 / 2;

        &.content {
            display: grid;
            grid: 18px 50px 25px 240px 25px 102px 18px / 18px 242px 18px;

            & > .progress {
                grid-area: 2 / 2 / 3 / 3;
            }

            & > .title {
                grid-area: 2 / 2 / 3 / 3;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 24px;
                color: #7f0000;
            }

            & > img {
                image-rendering: pixelated;
                grid-area: 4 / 2 / 5 / 3;

                &.pad {
                    width: 176px;
                    height: 176px;
                    margin: 32px;
                }

                &.fill {
                    width: 240px;
                    height: 240px;
                }
            }

            & > .stats {
                grid-area: 4 / 2 / 5 / 3;
                border-radius: 8px;
                display: flex;
                flex-direction: column;
                gap: 12px;
                padding: 12px;
                background-color: #0000005f;
                transition: all 100ms ease;

                &:not(.visible) {
                    opacity: 0;
                }

                & > .value {
                    display: flex;
                    gap: 16px;
                    align-items: center;

                    & > img {
                        width: 48px;
                        height: 48px;
                    }

                    & > span {
                        color: white;
                        font-size: 48px;
                    }
                }

                & > .container {
                    display: flex;
                    gap: 16px;
                    align-items: center;

                    & > img {
                        width: 72px;
                        height: 72px;
                        image-rendering: pixelated;
                    }

                    & > span {
                        color: white;
                        font-size: 48px;
                    }
                }
            }

            & > .amount {
                grid-area: 4 / 2 / 5 / 3;
                display: flex;
                justify-content: center;
                align-items: center;
                font-size: 72px;
                color: white;
            }

            & > .description {
                grid-area: 6 / 2 / 7 / 3;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                color: #1f1f1f;
                font-size: 20px;
                padding: 12px;
                line-height: 22px;
            }
        }
    }

    &.chest-card {
        & > .background.content > .amount {
            opacity: 0;
            transition: opacity 100ms ease;
        }
    }

    &:hover {
        & > .background.content > .stats:not(.visible) {
            opacity: 1;
        }

        &.chest-card.locked {
            & > .background.content > .amount {
                opacity: 1;
            }
        }
    }

    & img.background {
        width: 100%;
        height: 100%;
    }

    & * {
        pointer-events: none;
    }

    &.hidden {
        opacity: 0;
        transform: scale(0.8) translateY(-239px);
    }

    &.red {
        & .tint {
            filter: hue-rotate(0deg);
        }
    }

    &.orange {
        & .tint {
            filter: hue-rotate(40deg);
        }
    }

    &.yellow {
        & .tint {
            filter: hue-rotate(68deg) saturate(5);
        }
    }

    &.yellow-green {
        & .tint {
            filter: hue-rotate(71deg) saturate(5);
        }
    }

    &.green {
        & .tint {
            filter: hue-rotate(120deg);
        }
    }

    &.turquoise {
        & .tint {
            filter: hue-rotate(170deg);
        }
    }

    &.cyan {
        & .tint {
            filter: hue-rotate(190deg);
        }
    }

    &.blue {
        & .tint {
            filter: hue-rotate(225deg);
        }
    }

    &.violet {
        & .tint {
            filter: hue-rotate(260deg);
        }
    }

    &.purple {
        & .tint {
            filter: hue-rotate(275deg);
        }
    }

    &.pink {
        & .tint {
            filter: hue-rotate(300deg);
        }
    }

    &.magenta {
        & .tint {
            filter: hue-rotate(330deg);
        }
    }

    &.locked {
        box-shadow: -6px 6px 6px black, 6px 6px 6px black;

        &[data-z="0"] {
            box-shadow: -6px -6px 6px black, -6px 6px 6px black, 6px -6px 6px black, 6px 6px 6px black;
        }
    }

    &:not(.locked):hover {
        box-shadow: 0 0 16px black;
    }

    & .progress {
        background-color: transparent;
        width: 0;

        &.red {
            background-color: #bf00007f;
        }

        &.orange {
            background-color: #ffdf004f;
        }

        &.yellow {
            background-color: #ffbf004f;
        }

        &.yellowgreen {
            background-color: #7fbf004f;
        }

        &.green {
            background-color: #00bf004f;
        }

        &.turquoise {
            background-color: #00ffbf4f;
        }

        &.cyan {
            background-color: #00ffbf4f;
        }

        &.blue {
            background-color: #003fff4f;
        }

        &.violet {
            background-color: #0000df4f;
        }

        &.pink {
            background-color: #bf00bf4f;
        }

        &.magenta {
            background-color: #ff007f4f;
        }
    }

    &[data-child] {
        & .background:not(.tint) > div {
            & div:not(.progress):not(.centered-text) {
                display: none;
            }
        }
    }
}

#preview {
    opacity: 0;
    z-index: 999;
    transition: left 250ms ease, top 250ms ease;
    pointer-events: none;
    backdrop-filter: blur(4px);

    &.valid {
        border: 2px solid #3fff3f;
        background-color: #3f7f3f7f;
    }

    &.invalid {
        border: 2px solid #ff3f3f;
        background-color: #7f3f3f7f;
    }
}

.centered-text {
    text-align: center;
}

b {
    &.colored {
        font-weight: 500;
        margin-inline: 4px;
        text-shadow: -1px -1px 1px black, 1px -1px 1px black, -1px 1px 1px black, 1px 1px 1px black;
        line-height: 20px;
        white-space: nowrap;

        &.red {
            color: #ff0000;
        }

        &.yellow {
            color: #ffbf00;
        }

        &.green {
            color: #00bf00;
        }

        &.turquoise {
            color: #00ffbf;
        }

        &.cyan {
            color: #3f9fff;
        }

        &.blue {
            color: #3f7fff;
        }

        &.pink {
            color: #ff3fff;
        }

        &.magenta {
            color: #ff007f;
        }

        &.violet {
            color: #7f3fff;
        }
    }
}

.shop {
    & > .grid {
        background-image: url('../png/ui/book.png');
        background-size: contain;
        display: grid;
        width: 1280px;
        height: 963px;
        transition: all 100ms ease;
        padding: 80px 96px 112px 96px;
        grid-template: repeat(2, 239px 1fr) 239px / repeat(3, 139px 1fr) 32px 32px repeat(2, 139px 1fr) 139px;
    }
}

.card-slot {
    position: absolute;
    width: 278px;
    height: 478px;
    transition: all 100ms ease;
    border-radius: 18px;
    border: 4px dashed #ffffff3f;
    pointer-events: none;
    opacity: var(--card-slot-opacity);

    &.shop-card {
        transform-origin: 0 0;
        border-color: #0000009f;
        opacity: 1;
        transform: scale(0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 72px;
        color: #0000009f;
        text-align: center;

        &.not-implemented {
            border-style: dotted;
            color: transparent;
            border-color: #0000005f;
        }
    }
}
