#modal-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9900;
    background-color: #00000055;
    visibility: hidden;
}

#modal-layer:has(:first-child) {
    visibility: visible;
}

@keyframes show {
    100% {
        opacity: 1;
        transform:  translate(-50%, -50%);
    }
}
@keyframes hide {
    100% {
        opacity: 0;
        transform: scale(0.5) translate(-100%, -100%);
    }
}
@keyframes blind {
    100% {
        filter: blur(3px);
        transform: scale(0.75) translate(-75%, -75%);
    }
}

.modal-win {
    animation: show .1s 100ms ease-out forwards;
    min-height: 300px;
    max-height: 60vh;
    min-width: 600px;
    max-width: 60vw;
    background-color: hsl(var(--background-hue-sat), var(--background-light));
    border-radius: var(--rounding);
    padding: 20px 25px;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    overflow: scroll;
    opacity: 0;
    filter: none;
    transform: scale(0.5) translate(-100%, -100%);
}
.power-mode .modal-win {
    opacity: 1;
    transform:  translate(-50%, -50%);
}
.hidden-modal {
    transform:  translate(-50%, -50%);
    opacity: 1;
    animation: blind .1s 100ms ease-in forwards;
}
.modal-closing {
    animation: hide .1s 100ms ease-out forwards;
    opacity: 1;
    transform:  translate(-50%, -50%);
}
.power-mode .modal-closing {
    opacity: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    height: 50px;
}

.modal-title {
    width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-close {
    width: 50px;
    height: 50px;
}

.modal-content {
    height: calc(100% - 140px);
}

fieldset {
    border: none;
    display: grid;
}

.modal-button-box {
    display: flex;
    justify-content: space-around;
    height: 50px;
    width: 100%;
    margin-top: 20px;
}

.modal-button-box > * {
    width: 100%;
    margin-left: 5px;
}

.modal-button-box > :first-child {
    border-radius: var(--rounding) var(--inner-rounding) var(--inner-rounding) var(--rounding);
    margin-left: 0;
}

.modal-button-box > :last-child {
    border-radius: var(--inner-rounding) var(--rounding) var(--rounding) var(--inner-rounding);
}