div.page-container {
    display: flex;
    height: 100vh;
}

div.page-content-container {
    flex-grow: 1;
}

div.sidebar {
    min-width: fit-content;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}



div.sidebar-box {
    width: 100%;
    border: 2px solid #ccc;
    margin: 8px;
}

div.sidebar-box-header {
    background-color: #ccc;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    padding: 4px;
}

div.sidebar-box-content {
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    max-height: 100vh;
}

div.sidebar-box-content > * {
    width: 100%;
}



.gameboy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gameboy-case {
    text-align: center;
    font-size: 12px;
    padding: 20px 20px 40px 20px;
    margin: 20px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(
            rgba(211, 211, 211, 255)   0%,
            rgba(211, 211, 211, 255)  80%,
            rgba(211, 211, 211,   0) 100%
    );
    transform-origin: top center;
    scale: 2;
    z-index: 0;
}

.gameboy-screen-border {
    display: grid;
    grid-template-columns: 40px 160px 40px;
    grid-template-rows: 20px 144px 20px;

    background-color: darkgray;
    border-radius: 10px 10px 30px 10px;
}

.gameboy-screen-container {
    grid-column: 2;
    grid-row: 2;
}

.power-led-off, .power-led-on {
    grid-column: 1;
    grid-row: 2;

    width: 6px;
    height: 6px;

    margin: 46px 17px 92px 17px;
}

.power-led-off {
    background-color: #666;
    border-left: 1px solid #aaa;
    border-top: 1px solid #aaa;
    border-right: 1px solid #222;
    border-bottom: 1px solid #222;
}

.power-led-on {
    background-color: #f00;
    border-left: 1px solid #f66;
    border-top: 1px solid #f66;
    border-right: 1px solid #c00;
    border-bottom: 1px solid #c00;
}

canvas {
    margin: 0;
    padding: 0;
    image-rendering: pixelated;
}

.gameboy-screen {
    background: #000;
    margin: 0;
    padding: 0;
}

.gameboy-screen-bg {
    background: #9bbc0f;
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    padding: 0;
    box-shadow: inset 0 0 5px #306430;
}


.menu-overlay-container {
    grid-column: 2;
    grid-row: 2;

    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 15% 70% 15%;

    transition: all ease 250ms;
    opacity: 0;
}

.menu-overlay-container:hover {
    opacity: 1;
}

.menu-overlay-container > * {
    /* negate the scaling for the gameboy case */
    z-index: 1;
    scale: 0.5;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
}


.menu-overlay-background {
    grid-column: 1;
    grid-row: 1 / 4;
    background-color: #222;
    opacity: 0.25;
    z-index: 0;
}

.menu-bar-top-container {
    grid-column: 1;
    grid-row: 1;
}

.game-title {
    text-align: center;
    vertical-align: middle;

    font-family: sans-serif;
    font-size: 24pt;
    color: #222;
    background-color: #666;
}

.menu-bar-bottom-background {
    grid-column: 1;
    grid-row: 3;
    background-color: #666;
    z-index: 1;
    pointer-events: all;
}

.menu-bar-bottom-container {
    grid-column: 1;
    grid-row: 3;
    align-items: center;
}

.gameboy-controls-left, .gameboy-controls-right {
    margin-left: 8px;
    margin-right: 8px;
    height: 100%;

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.gameboy-controls-left {
    justify-content: flex-start;
    float: left;
}

.gameboy-controls-right {
    justify-content: flex-end;
    float: right;
    align-self: end;
}


input, button {
    z-index: 10;
}




.rom-select-entry {
    display: grid;
    grid-template-columns: auto min-content;
    grid-template-rows: auto auto;
    padding: 0 5px;

    border-top: 2px solid #ccc;
}

.rom-select-entry.first {
    border-top: 0;
}

.rom-select-entry:hover {
    background-color: #ccc;
}

.rom-select-entry h1 {
    grid-row: 1;
    grid-column: 1;

    font-size: 12pt;
    margin: 0;
}

.rom-select-entry p {
    grid-row: 2;
    grid-column: 1;

    font-size: 10pt;
    margin: 0;
}

.rom-select-entry button {
    grid-row: 1 / 3;
    grid-column: 2;

    font-size: 20pt;
    height: 100%;
    align-self: stretch;
    background: none;
    border: none;
    cursor: pointer;
}

.rom-select-entry button:hover {
    font-weight: bold;
}




table.grid {
    border-collapse: collapse;
    border: none;
}

table.grid > tbody > tr > td {
    padding: 5px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.5;
}



.keybindings {
    align-content: center;
}

.key {
    font-family: monospace;
    font-weight: bold;
    align-self: center;

    padding: 0 4px;

    background: #aaa;
    border-top: 3px solid #ddd;
    border-left: 3px solid #ddd;
    border-right: 3px solid #888;
    border-bottom: 3px solid #888;
}

.key.start {
    border-radius: 8pt;
}

.key.ab {
    background: #903;
    color: #fff;

    border-top: 3px solid #b03;
    border-left: 3px solid #b03;
    border-right: 3px solid #702;
    border-bottom: 3px solid #702;
    border-radius: 50%;
}
