:root {
    font-size: 16px;
    font-family: eczar, "Times New Roman", serif;
    color: #dce6e8;
    image-rendering: pixelated;
    
    --cell-size: 117px;
}

body {
    background: #101016;
    margin: 0;
}

body.modal {
    /*overflow: hidden;*/
}

hr {
    background: linear-gradient(to right, transparent, #fff, transparent);
    border: none;
    height: 1px;
    margin-bottom: 16px;
}

main {
    position: relative;
    z-index: 0;
    inset: 0;
    margin: 100px auto;
    width: calc(var(--cell-size) * 9);
    display: grid;
    grid-auto-rows: var(--cell-size);
    grid-auto-columns: var(--cell-size);
}

#modal {
    position: fixed;
    z-index: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #000000e3;
    box-sizing: border-box;
    transition: opacity 0.5s;
    opacity: 0;
    pointer-events: none;
}

#modal.displayed {
    opacity: 1;
    pointer-events: auto;
}

#modal .modal-wrapper {
    width: 700px;
    height: fit-content;
    position: fixed;
    inset: 0;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#modal .modal-title {
    width: 100%;
    font-size: 3rem;
    font-weight: normal;
    text-align: center;
    line-height: 1;
}

#modal .modal-content {
    width: 100%;
}

#modal .modal-close {
    margin-top: 20px;
    text-align: right;
    cursor: pointer;
    user-select: none;
    font-style: italic;
    border-bottom: solid 1px;
}

.wrapper {
    margin: 4px;
    position: relative;
}

.box {
    width: 100%;
    height: 100%;
    position: relative;
    pointer-events: none;
}

/** medium **/
@media screen and (min-width: 481px) and (max-width: 1129px) {
    main {
        width: calc(var(--cell-size) * 5);
        height: auto;
        position: relative;
        margin: 56px auto;
    }

    #modal .modal-wrapper {
        width: calc(100% - 42px);
    }

    #modal .modal-content {
        max-height: 180px;
        overflow: auto;
    }
}

/** small **/
@media screen and (max-width: 480px) {
    main {
        width: calc(var(--cell-size) * 3);
        height: auto;
        position: relative;
        margin: 12px auto;
    }

    #modal .modal-wrapper {
        width: calc(100% - 42px);
    }
}