html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Courier New', Courier, monospace;
    display: grid;
    grid-template-columns: min-content 0 auto;
}

#names-wrapper {
    overflow: scroll;
    grid-row: 1;
    grid-column: 1;
}

#collapser-wrapper {
    grid-row: 1;
    grid-column: 2;

    position: relative;
    width: 0;
    height: 0;
}

#poems-wrapper {
    overflow: scroll;
    grid-row: 1;
    grid-column: 3;
    min-width: 40px;
}

#names {
    box-sizing: border-box;
    min-height: 100%;
    padding: 20px;
    font-size: large;

    border-right: 2px solid black;
}

#names.collapsed,
#names:empty {
    max-width: 0;
    padding: 20px 0;
    border-width: 0;
}

.name {
    overflow: hidden;
    user-select: none;
    margin: 0;
    padding: 10px;
}

.name:not(:last-child) {
    border-bottom: 1px solid black;
}

.name.selected {
    background-color: #777;
}

#poems {
    box-sizing: border-box;
    min-height: 100%;
    padding: 20px;
    margin: 0;

    font-size: normal;
    min-width: fit-content;
    display: flex;
    align-items: center;
}

#text:not(:empty) {
    border-left: 1px solid black;
    padding-left: 10px;
    margin: 0 auto;
}

#collapser {
    position: absolute;
    margin: 5px;
    padding: 5px;
    width: 20px;
    height: 20px;
    overflow: hidden;

    font-size: 20px;
    line-height: 20px;
    text-align: center;

    border: 1px solid black;
    border-radius: 100%;

    background-color: #fff;
    user-select: none;
}

body:has(#names.collapsed) #collapser {
    transform: scale(-1, 1);
}

body:has(#names:empty) #collapser {
    display: none;
}

@media only screen and (min-width: 768px) {
    #poems {
        font-size: large;
    }

    #names {
        font-size: larger;
    }
}

@media (hover: hover) {
    .name:hover {
        cursor: pointer;
    }

    .name:hover:not(.selected) {
        background-color: #aaa;
    }

    #collapser:hover {
        cursor: pointer;
        background-color: #aaa;
    }
}

@media (hover: none) {
    .name:active:not(.selected) {
        background-color: #aaa;
    }

    #collapser:active {
        cursor: pointer;
        background-color: #aaa;
    }
}