
.book {
    height: 200px;
    width: auto;
    image-rendering: auto;
    margin: 0 4px;
    border-radius: 4px;
}

.book:hover {
    cursor: pointer;
}

.details {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    justify-content: center;
    margin: 16px auto;
    min-height: 175px;
    background-color: rgba(255, 255, 255, 0.427);
    border-radius: 4px;
    padding: 16px 16px 0 16px;
    width: 50%;
}

#rating > img {
    width: 16px;
    height: auto;
}

#game-description {   
    letter-spacing: 0.1em;
    text-align: left;
    -webkit-text-stroke-width: 0;
    color: rgb(2, 2, 2);
    font-weight: normal;
    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    /* width: 50% */
}

#nav {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    width: 90%;
    max-width: 100%;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: nav;
}

#list-parent {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 54px;
    position: fixed;
    z-index: 10;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#list-parent.open {
    display: flex;
}

#list-toolbar {
    display: flex;
    flex: none;
    gap: 10px;
    align-items: center;
    padding: 16px 16px 12px;
    background-color: transparent;
}

#game-search {
    flex: 1;
    min-width: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    padding: 10px 14px;
    border: 1px solid #4f43ae;
    border-radius: 10px;
    background: #0e0e10;
    color: white;
    color-scheme: dark;
    outline: none;
}

#game-search:focus {
    border-color: #4f43ae;
}

#game-search::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

#list {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 16px;
    background-color: #161618;
    border: 2px solid #4f43ae;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

#list-grid {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-x: clip;
    overflow-y: auto;
    background-color: transparent;
    scrollbar-color: #4f43ae transparent;
}

.game-list-ghost {
    display: block;
    margin: 0;
    pointer-events: none;
    object-fit: contain;
    image-rendering: auto;
}

#list-grid::-webkit-scrollbar {
    width: 16px;
}

#list-grid::-webkit-scrollbar-track {
    background: transparent;
}

#list-grid::-webkit-scrollbar-thumb {
    background-color: #4f43ae;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

#list-grid::-webkit-scrollbar-thumb:hover {
    background-color: #5c50c4;
}

.modal{

}




#walkthrough {
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    margin: 50px;
    background-color: #161618;
    border: 2px solid #4f43ae;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

#walkthrough>iframe {
    /* width: 100%;
    height: 100%; */
}

#walkthrough-split {
    display: flex;
    height: 100%;
    width: 100%;
}

#walkthrough-split>* {
    flex: 1;
    height: 100%;
}

#close-walkthrough-button,
#walkthrough-button {
    margin: 0;
    padding: 10px 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: #4f43ae;
    border: none;
    border-radius: 10px;
}

#close-walkthrough-button {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

#close-walkthrough-button:hover,
#walkthrough-button:hover {
    background: #5c50c4;
}

.game-list-image {
    min-width: 324px;
    min-height: 230px;
    max-width: 324px;
    max-height: 230px;
    margin: 6px;
    image-rendering: auto;
}

/* 
.game-list-image:hover {
    margin: 0px;
    border: 6px solid #e4000f;
    animation-name: blinking;
    animation-duration: 1000ms;
    animation-iteration-count: 100;
} */

@keyframes blinking {
    50% {
        border-color: #a48bd1;
    }
}

button:hover {
    cursor: pointer;
}

#close-list-button {
    position: static;
    flex: none;
    padding: 10px 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: #4f43ae;
    border: none;
    border-radius: 10px;
}

#close-list-button:hover {
    background: #5c50c4;
}

#search-empty {
    width: 100%;
    padding: 32px 16px;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    color: white;
    animation: search-empty-in 220ms ease;
}

@keyframes search-empty-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.close-button {}

#random-game {
    position: relative;
    z-index: 1;
    text-align: center;
    font-family: snes;
    font-size: 55px;
    /* color: #b5b6e4; */
    /* color: #4f43ae; */
    /* color: #cec9cc; */
    /* color: #e4000f; */
    color: #ffffff;
    /* font-weight: bold; */
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: black;
}

#random-game-image {
    /* margin-bottom: 10px; */
    /* box-shadow: 8px 0 0 0 rgba(255, 0, 0, 0); */
    /* border-bottom: 6px solid black; */
    transition: ease-in-out all 500ms;
    image-rendering: auto;
    image-rendering: smooth;
}

/* #random-game-image:hover{
    border-left: 8px solid #e4000f;
    border-right: 8px solid #e4000f;
} */


#random-game-image:hover {
    cursor: pointer;
}

#mario {
    position: absolute;
    bottom: 0;
    left: -100px;
    animation-direction: alternate-reverse;
}

#mario-cape {
    position: absolute;
    bottom: 0;
    left: -20px;
}

#footer {
    position: fixed;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    text-align: center;
    font-family: snes;
    font-size: 1.5rem;
}

.controls {
    color: green;
}

#video {
    width: 652px;
    image-rendering: auto;
    image-rendering: smooth;
    /* border: 12px solid #a48bd1;
    border-style: ridge; */
}

#video::-webkit-media-controls-overflow-button {
    display: none;
}


/* #video-parent {
    margin-top: 20px;
    width: 100%;
    height: 600px;
    position: relative;
  }
#video,
#video-border {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
#video-border {
z-index: 10;
} */


#snes {
    color: var(--snes-red);
}

#game-heading {
    white-space: nowrap;
}

.shelf-banner {
    width: 0;
    min-width: 100%;
    margin-bottom: 12px;
}

.shelf-banner img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
}

#game-list-button {
    cursor: url('cursors/cursor.cur'), url('cursors/cursor.svg'), pointer;
    padding: 10px;
}

.cartridge-button {
    font-family: snes;
    font-size: 55px;
    line-height: 0.85;
    color: #e4000f;
    padding: 0;
    background-image: url('./images/snes_game_icon_2.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0);
    border: none;
    cursor: url('cursors/cursor.cur'), url('cursors/cursor.svg'), pointer;
}

.cartridge-button:disabled {
    opacity: 0.4;
    filter: grayscale(1);
    cursor: default;
}

.cartridge-button:active:not(:disabled) {
    transform: translateY(4px);
}

.snes-button {
    font-family: snes;
    font-size: 55px;
    line-height: 0.85;
    color: var(--snes-purple);
    -webkit-text-stroke: 1px black;
    padding: 16px 10px 14px;
    background: #161618;
    border: 3px solid #0a0a0c;
    border-top: none;
    border-bottom-width: 7px;
    border-bottom-color: #4a2460;
    border-left-color: #5c4a88;
    border-right-color: #5a2c68;
    border-radius: 14px;
    box-shadow: inset 0 0 0 2px var(--snes-box-purple);
    cursor: url('cursors/cursor.cur'), url('cursors/cursor.svg'), pointer;
}

.snes-button.is-red {
    color: var(--snes-red);
}

.snes-button:disabled {
    opacity: 0.4;
    filter: grayscale(1);
    cursor: default;
}

.snes-button:active:not(:disabled) {
    transform: translateY(4px);
    border-bottom-width: 3px;
}

#canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    image-rendering: pixelated;
}

:root {
    --snes-purple: #a48bd1;
    --snes-box-purple: #9c4bae;
    --snes-red: #e4000f;
    /* Fraction of the cover to hide. 0.1 cuts 10% off that edge. */
    --bg-crop-left: 0;
    --bg-crop-top: 0.06;
    --bg-crop-right: 0.18;
    --bg-crop-bottom: 0.16;
}

html {
    height: 100%;
}

body {
    /* filter: invert(70%); */
    /* background-color: rgba(255, 255, 255, 0.782);   */
    min-height: 100%;
    min-height: 100dvh;
    transition: background-color .5s ease-in-out;
    background-blend-mode: color;
    /* background-color: rgba(255, 255, 255, 0.402); */
    background-color: rgb(0 0 0 / 40%);
    /* background-color: black; */
    /* backdrop-filter: blur(10px); */
    backdrop-filter: blur(62px);
    background-image: url("./images/bg1.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    cursor: url('cursors/cursor.cur'), url('cursors/cursor.svg'), pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0px;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.page-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(62px);
    pointer-events: none;
}

.page-bg-incoming {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.page-bg-plate {
    position: absolute;
    left: calc(var(--bg-crop-left) / (1 - var(--bg-crop-left) - var(--bg-crop-right)) * -100%);
    top: calc(var(--bg-crop-top) / (1 - var(--bg-crop-top) - var(--bg-crop-bottom)) * -100%);
    width: calc(100% / (1 - var(--bg-crop-left) - var(--bg-crop-right)));
    height: calc(100% / (1 - var(--bg-crop-top) - var(--bg-crop-bottom)));
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 100% 100%;
    background-color: rgb(0 0 0 / 40%);
    background-blend-mode: color;
}

.admin-page {
    position: fixed;
    inset: 0;
    overflow: auto;
    box-sizing: border-box;
    background: #121214;
    color: #f3f3f4;
    color-scheme: dark;
    cursor: auto;
    user-select: text;
}

.admin-page h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.admin-page p {
    color: rgba(243, 243, 244, 0.78);
}

.admin-note {
    margin: 16px 0 0;
    color: #f3f3f4;
}

.admin-table-wrap {
    margin-top: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1e;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(243, 243, 244, 0.55);
    background: #222228;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table select,
.admin-page input {
    width: 100%;
    box-sizing: border-box;
    background: #111114;
    color: #f3f3f4;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.admin-page input {
    width: auto;
}

.admin-attach,
.admin-page button {
    background: #4f43ae;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.admin-attach:disabled,
.admin-page button:disabled {
    opacity: 0.55;
    cursor: default;
}

.admin-game {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-thumb {
    width: 72px;
    height: 52px;
    object-fit: contain;
    background: #0e0e10;
    border-radius: 4px;
    image-rendering: auto;
    flex: none;
}

.admin-thumb-wide {
    width: 112px;
    height: 80px;
}

.admin-empty {
    color: rgba(243, 243, 244, 0.45);
    font-size: 0.85rem;
}

.admin-lookup {
    margin: 8px 0 40px;
}

.admin-lookup h2,
.admin-page h2,
.admin-record h3 {
    margin: 28px 0 8px;
}

.admin-results {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #1a1a1e;
}

.admin-page button.admin-quiet {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    color: inherit;
    font-weight: 500;
    text-align: left;
    border-radius: 0;
}

.admin-page button.admin-quiet:hover {
    background: rgba(255, 255, 255, 0.06);
}

.admin-record {
    margin-top: 20px;
}

.admin-field {
    display: grid;
    grid-template-columns: 160px 112px minmax(220px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.admin-json {
    max-height: 420px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    background: #0e0e10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e7e7ea;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

@font-face {
    font-family: snes;
    src: url('./fonts/SNES Italic.ttf')
}

.flex-parent {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* (1920x1080) Full HD Display */
@media screen and (min-height: 900px) and (max-height: 1100px) {
    #random-game-image {
        /* width: 200px; */
        height: auto;
        margin-bottom: 0;
    }

    #random-game {
        font-size: 40px;
    }

    /* 
    button {
        font-family: snes;
        font-size:40px;
        color: #e4000f;
        padding-left: 20px;
        padding-right: 25px;
        background-image: url('./images/snes_game_icon.webp');
        background-size: cover;
        height: 59px;
        background-color: rgba(0,0,0,0);
        border: none;
        cursor: url('cursors/cursor.cur'), url('cursors/cursor.svg'), pointer;
        margin-bottom: 10px;
        margin-top: 5px;
    } */

    /* button:active {
        margin-top:10px;
        margin-bottom: 5px;
    } */

    #video {
        width: 632px;
        height: auto;
        border: 8px solid #a48bd1;
        border-style: ridge;
    }

    #footer {
        font-size: 1rem;
    }

    .avatar {
        border: 6px;
        height: auto;
    }

    #mario {
        width: 300px;
        left: -60px;
    }

    #mario-cape {
        width: 192px;
        left: -20px;
    }

    .flex-parent {
        display: flex;
        align-items: center;
        justify-content: center;
    }

}

/* mobile? */
@media (max-width: 1000px) {

    #close-list-button {
        position: static;
        right: auto;
        bottom: auto;
    }



    #list-parent {
        margin: 0;
    }

    #list,
    #list-toolbar,
    #list-grid {
        margin: 0;
        background-color: black;
    }

    #list {
        border: none;
    }

    :root {
        touch-action: pan-x pan-y;
        height: 100%
    }

    body {
        background-color: black;
        background-image: none;
    }

    #snes {
        color: var(--snes-red);
    }

    .game-list-image {
        /* min-height: 230px; */
        height: 230px;
        min-width: 324px;
        width: auto;
        margin: 0;
        /* image-rendering: crisp-edges; */
        /* image-rendering:auto;         */
    }

    .game-list-image:hover {
        border: none;
    }

    #random-game-image {
        /* width: 200px; */
        height: auto;
        width: 100%;
        border: none;
        /* padding: 8px;
        box-sizing: border-box; */
    }

    #random-game {
        font-size: 70px;
        display: flex;
        height: 100%;
        flex-direction: column;
        align-items: normal;
        justify-content: space-between;
    }

    #video {
        width: 100%;
        height: auto;
        /* border: 8px solid #a48bd1; */
        /* border-style: ridge; */
        border: none;
        margin-bottom: 20px;
        /* padding: 8px;
        box-sizing: border-box; */
    }

    #footer {
        font-size: 1rem;
        display: none;
    }

    .avatar {
        border: 6px;
        height: auto;
    }

    #mario {
        width: 300px;
        left: -60px;
    }

    #mario-cape {
        width: 192px;
        left: -20px;
    }

    #canvas {
        display: none;
    }

    .flex-parent {
        display: flex;
        justify-content: start;
        height: 100%;
        flex-direction: column-reverse;
    }

    #walkthrough {
        position: fixed;
        margin: 0px;
        border: none;
        border-radius: 0;
        background-image: none;
        background-color: #161618;
        box-shadow: none;
    }

}

/* (1600x900) HD+ Display */
@media screen and (max-width: 1600px) {
    /* insert styles here */
}


/* User Manuals */

.pages {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    min-height: 0;
}

.pages>img {
    display: block;
    max-width: 94vw;
    max-height: calc(100vh - 150px);
    min-height: 0;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
    border-radius: 16px 16px 0 0;
}

#page-image {
    transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1), height 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    .manual-reader,
    #page-image {
        transition: none;
    }
}

.navigation {
    position: relative;
    align-self: stretch;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    margin-top: 0;
    box-sizing: border-box;
    padding: 12px;
    background-color: #161618;
    border: none;
    border-radius: 0 0 16px 16px;
}

.navigation-cluster {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 48px;
    width: 100%;
    height: 52px;
    margin-inline: auto;
}

.navigation-side {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.navigation-side-left {
    justify-content: flex-end;
}

.navigation-side-right {
    justify-content: flex-start;
    gap: 48px;
}

.navigation button {
    width: 100%;
    margin: 0;
    padding: 2px 0 1px;
    background: #161618;
    color: var(--snes-purple);
    font-family: snes;
    font-size: 1.5rem;
    line-height: 1;
    border: 2px solid #0a0a0c;
    border-top: none;
    border-bottom-width: 4px;
    border-bottom-color: #4a2460;
    border-left-color: #5c4a88;
    border-right-color: #5a2c68;
    border-radius: 8px;
    box-shadow: inset 0 0 0 2px var(--snes-box-purple);
    cursor: url('cursors/cursor.cur'), url('cursors/cursor.svg'), pointer;
}

.navigation-side button {
    width: auto;
    padding-inline: 22px;
}

.navigation button.navigation-close {
    color: var(--snes-red);
}

.navigation button:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.book-icons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

#manual-icon-container,
.guide-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.5rem;
    -webkit-text-stroke-width: 0;
    color:#000000;
}

#manual {
    position: fixed;
    inset: 0;
    z-index: 6;
    overflow: hidden;
    transform: translateZ(0);
    pointer-events: auto;
}

.manual-reader {
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    min-width: 0;
    max-width: 94vw;
    max-height: calc(100vh - 72px);
    box-sizing: border-box;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.manual-reader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.reader-cover-flight {
    position: fixed;
    z-index: 5;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    margin: 0;
    opacity: 0;
    object-fit: contain;
    pointer-events: none;
    transform-origin: center center;
    image-rendering: auto;
    border-radius: 16px 16px 0 0;
}

@media (min-width: 1001px) {
    .flex-parent {
        --stage-h: min(490px, calc((100dvh - 210px) / (1 + 690 / 490 * 3 / 4)));
        display: grid;
        grid-template-columns: calc(var(--stage-h) * 690 / 490);
        width: 100%;
        max-width: 100%;
        height: auto;
        box-sizing: border-box;
        padding-inline: 16px;
        row-gap: 8px;
        align-items: start;
        justify-content: center;
        justify-items: center;
    }

    #cover-slot {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: calc(var(--stage-h) * 690 / 490);
        height: var(--stage-h);
        margin-bottom: 6px;
    }

    #random-game-image {
        margin-bottom: 0;
    }

    #video-parent {
        grid-column: 1;
        grid-row: 2;
    }

    #nav {
        grid-column: 1;
        grid-row: 3;
        width: 90%;
        min-width: 0;
        margin-top: 12px;
        margin-inline: auto;
        justify-self: center;
        gap: 14px;
    }

    .cartridge-button {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: auto;
        aspect-ratio: 134 / 98;
        box-sizing: border-box;
        font-size: clamp(34px, 10cqw, 58px);
        background-size: cover;
    }

    .snes-button {
        flex: 1 1 0;
        min-width: 0;
        box-sizing: border-box;
        font-size: clamp(28px, 8cqw, 48px);
    }

    .details {
        position: fixed;
        top: 50%;
        left: min(
            calc(50% + (var(--stage-h) * 690 / 490) / 2 + 48px),
            calc(100vw - 176px - 16px)
        );
        right: auto;
        transform: translateY(-50%);
        width: 176px;
        max-height: calc(100vh - 24px);
        margin: 0;
        min-height: 0;
        box-sizing: border-box;
        z-index: 3;
        overflow: auto;
    }

    .details .book {
        max-width: 100%;
        max-height: 180px;
        height: auto;
    }

    #random-game-image,
    #video-parent {
        max-width: none;
        max-height: none;
        min-width: 0;
        min-height: 0;
        flex: 0 0 auto;
        box-sizing: border-box;
    }

    #random-game-image {
        box-sizing: content-box;
        width: calc(var(--stage-h) * 690 / 490);
        height: var(--stage-h);
        object-fit: contain;
        transition: none;
    }

    #random-game-image.is-odd-size {
        width: min(calc(var(--stage-h) * 690 / 490), calc(var(--stage-h) * var(--art-ratio)));
        height: min(var(--stage-h), calc((var(--stage-h) * 690 / 490) / var(--art-ratio)));
    }

    #video-parent {
        position: relative;
        justify-self: start;
        width: calc(var(--stage-h) * 690 / 490);
        height: calc((var(--stage-h) * 690 / 490) * 3 / 4);
        background: #000;
    }

    #video {
        position: absolute;
        inset: 0;
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: contain;
    }
}

@media (max-width: 1000px) {
    #game-heading {
        font-size: clamp(16px, 4.6vw, 26px);
        white-space: normal;
        max-width: 100%;
        padding-inline: 16px;
        box-sizing: border-box;
        line-height: 1.15;
    }

    #random-game-image,
    #video,
    #video-parent {
        max-width: 100%;
        min-width: 0;
    }

    #random-game-image {
        width: 100%;
        max-width: 690px;
        height: auto;
        margin-inline: auto;
        aspect-ratio: 690 / 490;
        object-fit: contain;
    }

    #video-parent {
        width: 100%;
        max-width: calc(490px * 4 / 3);
        margin-inline: auto;
    }

    #video {
        display: block;
        position: static;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        object-fit: contain;
    }

    .flex-parent {
        display: flex;
        flex-direction: column;
        height: auto;
        align-items: stretch;
    }

    #video-parent {
        order: 1;
    }

    #cover-slot {
        order: 2;
        width: 100%;
        max-width: 690px;
        height: auto;
        margin-inline: auto;
    }

    #random-game-image {
        order: 0;
    }

    .details {
        order: 3;
        position: static;
        top: auto;
        right: auto;
        transform: none;
        width: calc(100% - 32px);
        max-width: 100%;
        max-height: none;
        margin: 16px auto;
        overflow: hidden;
        z-index: auto;
        box-sizing: border-box;
        align-self: center;
    }

    .shelf-banner {
        display: none;
    }

    #manual {
        left: 0;
        width: 100%;
        height: 100dvh;
        bottom: auto;
    }

    .manual-reader {
        position: absolute;
        inset: 0;
        left: 0;
        top: 0;
        bottom: 0;
        transform: none;
        width: 100% !important;
        max-width: none;
        min-width: 0;
        height: 100%;
        max-height: none;
        border: none;
        border-radius: 0;
        justify-content: flex-end;
    }

    .manual-reader .pages {
        flex: 0 1 auto;
        align-items: center;
    }

    .pages > img {
        max-width: 100vw;
        max-height: calc(100dvh - 78px);
    }

    #nav {
        order: 4;
        flex-wrap: nowrap;
        width: 90%;
        margin-inline: auto;
        padding-inline: 8px;
        gap: 10px;
    }

    .cartridge-button {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: auto;
        aspect-ratio: 148 / 98;
        box-sizing: border-box;
        font-size: clamp(18px, 5.6vw, 42px);
        background-size: cover;
    }

    .snes-button {
        flex: 1 1 0;
        min-width: 0;
        box-sizing: border-box;
        padding: 12px 6px 10px;
        font-size: clamp(16px, 4.8vw, 32px);
    }
}

#page-num {
    width: auto;
    min-width: 0;
    padding: 0 8px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.72);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
}