.container {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    position: relative;
    display: flex;
    flex-direction: column;

    touch-action: none;
}

.container:has(#gd_maximize:checked) {
    position: fixed !important;
    inset: 0;
    width: 100dvw !important;
    height: 100dvh !important;
}

body:has(#gd_maximize:checked) {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

.header {
    color: #eee;
    text-wrap: nowrap;
    overflow: hidden;
}

.followarea {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    padding: 0;
    margin: 0;
    color: #0e0;
    user-select: all;
    font-family: monospace;
    font-size: 10px;
    height: 3em;
    line-height: 1em;
}

.main {
    user-select: none;
    /* pointer-events: none; */

    position: relative;
    flex-grow: 1;
    container-type: size;
}

.main_layout {
    flex-grow: 1;
    background-color: #222;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.bc_container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.tbox.a {
    flex: 1;
    min-height: 0;
}

.tbox>img,
.tbox>canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tbox.b {
    aspect-ratio: 1 / 1;
    max-width: 5.5cm;
    inline-size: min(calc(100cqw / 2), 100cqh);
}

.tbox.c {
    aspect-ratio: 1 / 1;
    max-width: 5.5cm;
    inline-size: min(calc(100cqw / 2), 100cqh);
}

@container (min-aspect-ratio: 288/224) {
    .main_layout {
        flex-direction: row;
    }

    .bc_container {
        display: contents;
    }

    .tbox.a {
        flex: 1;
        height: 100%;
        order: 2;
    }

    .tbox>.max {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    .tbox.b {
        aspect-ratio: 1 / 1;
        max-height: 5.5cm;
        inline-size: min(calc(100cqw/3), 100cqh);
        margin-top: auto;
        order: 1;
    }

    .tbox.c {
        aspect-ratio: 1 / 1;
        max-height: 5.5cm;
        inline-size: min(calc(100cqw/3), 100cqh);
        margin-top: auto;
        order: 3;
    }
}

.hidden {
    display: none !important;
}

#gd_container {
    width: 640px;
    height: 480px;
    background-color: #111 !important;
}

#gd_main {
    /* image-rendering: pixelated; */
}