:root {
    --card-border: 5px;
    --zoom-16: 16px;
    --card-animation: all 100ms ease;
    --card-border-radius: 8px;
    --board-border-radius: 28px;
    --button-shadow-color: #0000007f;
    --button-main-color: #00ff00;
    --button-main-shadow-color: #00ff007f;
    --button-main-background-color: #00ff001f;
    --button-gray-color: #3f3f3f;
    --card-slot-opacity: 0;
}

* {
    box-sizing: border-box;
}

@font-face {
    font-family: 'Astrojets';
    src: url('../ttf/AstrojetsRegular.ttf');
    ascent-override: 80%;
    descent-override: 0%;
}

html, body {
    color: #ffffffaf;
    font-family: Astrojets, sans-serif;
    background: #0f0f0f;
    margin: unset;
}

hr {
    width: calc(100% - 64px);
    height: 3px;
    background-color: rgb(47, 47, 47);
    border: none;
    margin-block: unset;
    border-bottom: 1px solid rgb(0, 0, 0);
}

.rotate {
    animation: rotating 1s linear infinite;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

button.custom-button {
    all: unset;
    padding: 8px 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    border-radius: 8px;
    height: 20px;
    transition: all 50ms ease;
    border: 1px solid transparent;
    color: rgb(235, 235, 235);
    white-space: nowrap;

    &:not(.disabled) {
        cursor: pointer;
    }

    & span {
        font-size: 16px;
        position: relative;
        top: -1px;
    }

    &.primary, &:not(.disabled):hover {
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

        &.primary.disabled {
            background-color: unset;
            color: rgb(159, 159, 159);
        }

    &.green {
        &.primary:not(.disabled) {
            background-color: rgb(27, 44, 27);
            border: 1px solid rgb(62, 151, 62);
        }

        &.secondary {
            color: rgb(103, 213, 103);
        }

        &:not(.disabled):not(.active):not(:active):hover {
            background-color: rgba(127, 255, 127, 0.25);
            border: 1px solid rgba(127, 255, 127, 0.4);

            &.secondary {
                color: rgb(235, 235, 235);
            }
        }

        &:not(.disabled) {
            &:active, &.active {
                background-color: rgba(127, 255, 127, 0.1);
                border: 1px solid rgba(127, 255, 127, 0.15);

                &.secondary {
                    color: rgb(235, 235, 235);
                }
            }
        }
    }

    &.gray {
        &.secondary {
            color: rgb(235, 235, 235);
        }

        &:not(.disabled):not(.active):not(:active):hover {
            background-color: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }


        &:not(.disabled) {
            &:active, &.active {
                background-color: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255, 255, 255, 0.1);
            }
        }
    }

    &.red {
        &.primary:not(.disabled) {
            background-color: rgb(49, 41, 41);
            border: 1px solid rgb(79, 63, 63);
            color: rgb(255, 159, 159);
        }

        &.secondary {
            color: rgb(255, 127, 127);
        }

        &:not(.disabled):not(:active):not(.active):hover {
            background-color: rgba(255, 127, 127, 0.2);
            border: 1px solid rgba(255, 127, 127, 0.3);
        }

        &:not(.disabled) {
            &:active, &.active {
                background-color: rgba(255, 127, 127, 0.1);
                border: 1px solid rgba(255, 127, 127, 0.2);
            }
        }
    }

    &.disabled:not(.active) {
        color: rgb(159, 159, 159);
        cursor: not-allowed;
        border-color: transparent;
    }
}

#dialog-background {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template: 1fr min-content 1fr / 1fr min-content 1fr;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: all 100ms ease;
    z-index: 1000;

    & div#backdrop {
        grid-area: 1 / 1 / 4 / 4;
    }

    & div#dialog {
        min-width: 384px;
        grid-area: 2 / 2 / 3 / 3;
        color: rgb(191, 191, 191);
        background-color: rgb(31, 31, 31);
        border-radius: 16px;
        border: 2px solid rgb(47, 47, 47);
        transition: all 100ms ease;
        transform: scale(0.9);
        box-shadow: 4px 4px 8px rgb(0, 0, 0);
        padding: 24px;
        max-height: 80dvh;
        display: flex;
        flex-direction: column;
        scrollbar-width: none;

        & hr:not(.default) {
            margin-block: 16px;
            margin-inline: 0;
            width: 100%;
        }

        & .hint {
            font-size: 14px;
        }

        & .header {
            min-height: 26px;

            & > h1 {
                margin-block: 0;
                font-size: 18px;
                height: 26px;
                letter-spacing: 0.025em;
                font-weight: normal;
                white-space: nowrap;
                overflow-x: hidden;
                text-overflow: ellipsis;
            }
        }

        & .message {
            font-size: 14px;
            color: rgb(255, 63, 63);
            margin-bottom: 24px;
        }

        & .footer {
            display: flex;
            gap: 32px;
            flex-direction: row-reverse;

            & .spacer {
                flex: 1;
            }
        }

        & .body {
            display: flex;
            flex-direction: column;
            gap: 32px;
            overflow: auto;

            & > p {
                margin: unset;
                padding-block: 4px;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
                white-space: nowrap;

                & b.colored {
                    text-shadow: -2px -2px 2px black, 2px -2px 2px black, -2px 2px 2px black, 2px 2px 2px black;
                    margin-inline: 4px;
                }
            }
        }
    }
}

section.error {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 48px;
    background-color: rgb(32, 16, 16);
    border-bottom: 2px solid rgb(192, 128, 128);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 64px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 0 32px var(--error-shadow-color);

    svg {
        box-shadow: var(--icon-shadow-red);
    }

    h4 {
        margin: unset;
        font-size: 18px;
        font-weight: normal;
        letter-spacing: 0.025em;
        color: var(--text-color-red);
    }

    p {
        margin: unset;
        font-size: 14px;
        color: var(--text-color-red);
        opacity: 0.75;
    }
}

div#error-background {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
}
