html {
    overflow-y: scroll;
}

::selection {
    background: white;
    color: blue;
}

.home {
    padding-bottom: 0;
}

#tiles {
    position: fixed;
    inset: 0;
    display: grid;
    touch-action: none;
}

#tiles > div {
    min-width: 0;
    min-height: 0;
}

#tiles img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
}

#tiles > div:hover img,
#tiles > div.seen img {
    opacity: 1;
}

#tiles.giant > div {
    position: relative;
    overflow: hidden;
}

#tiles.giant img {
    position: absolute;
    width: auto;
    max-width: none;
    transform: translateX(-50%);
}

body {
    --content-width: min(73%, 1100px);
    --mark-size: 45px;
    margin: 0;
    background: #98996e;
    color: black;
    min-height: 100vh;
    box-sizing: border-box;
    padding-bottom: 20vh;
}

body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 5.3%;
    height: calc(var(--mark-size) + 4px);
    background: black;
    z-index: 2;
    pointer-events: none;
}

body.games,
body.cinema {
    padding-bottom: 0;
}

body.cinema {
    padding-bottom: calc(5.3vh + var(--mark-size) + 96px);
}

h1 {
    position: static;
    margin: 0;
    font: bold var(--mark-size)/1 "Times New Roman", serif;
    padding: 0 2px;
    z-index: 3;
}

h1 a {
    color: blue;
    text-decoration: none;
}

h1 a:hover {
    background: repeating-linear-gradient(90deg, #000000 0%, #298326 12.5%, #f0cf30 25%, #ff6102 37.5%, #bf0a0d 50%, #5b3579 62.5%, #1552a1 75%, #45a9df 87.5%, #000000 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: spin 0.25s linear infinite;
}

@keyframes spin {
    to { background-position: -200% 0; }
}

nav {
    position: fixed;
    bottom: 5.3%;
    left: 50%;
    width: var(--content-width);
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font: 10pt Arial, sans-serif;
    padding: 2px 0;
    z-index: 3;
}

nav > a {
    padding: 0 2px;
    color: white;
    text-decoration: none;
}

nav > a:hover {
    font-style: italic;
    text-decoration: underline;
}

nav > a[aria-current="page"] {
    font-style: italic;
}

@media (max-width: 600px) {
    body {
        --content-width: 94%;
        --mark-size: clamp(20px, 5.4vw, 32.4px);
    }

    nav {
        gap: 4px;
        font-size: clamp(10px, 2.5vw, 13.33px);
    }
}

.films {
    position: relative;
    margin: 8vh auto 0;
    width: var(--content-width);
    z-index: 1;
}

.player {
    position: relative;
    width: min(480px, 40%);
    aspect-ratio: 16 / 9;
    margin: 0 auto 12px;
}

#screen {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 0;
}

.cinema .player {
    aspect-ratio: auto;
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
}

.player-bar {
    display: flex;
    width: 100%;
    color: red;
    background: yellow;
    font: 10pt Arial, sans-serif;
}

.player-bar span {
    flex: 1;
    min-width: 0;
}

.player-bar time {
    align-self: flex-start;
    flex-shrink: 0;
    color: yellow;
    background: red;
}

#shelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, 40px);
    justify-content: center;
    gap: 3px;
}

#shelf a {
    display: block;
}

#shelf img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

#shelf a:hover, #shelf a:focus-visible {
    outline: 1px solid blue;
}

.games .films {
    margin-top: 10vh;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.games .player {
    width: min(480px, calc(100% - 104px));
    margin: 0;
    aspect-ratio: auto;
    font: 10pt Arial, sans-serif;
    text-align: right;
    max-height: 65vh;
    overflow-y: auto;
}

.game-stack {
    order: -1;
    flex-shrink: 0;
    width: 80px;
}

#up, #down {
    display: block;
    margin: 0 auto;
    padding: 0 8px;
    border: 2px solid;
    border-color: #555 #555 #aaa #aaa;
    background: red;
    color: yellow;
    font: 32px Arial, sans-serif;
    transform: rotate(90deg);
    cursor: pointer;
}

.games #shelf {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-shrink: 0;
    width: 80px;
    max-height: calc(65vh - 76px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

.games #shelf > a {
    flex: 0 0 auto;
}

#cover {
    display: block;
    width: 100%;
    height: auto;
    max-height: 40vh;
    object-fit: contain;
    object-position: right bottom;
}

#name {
    margin-top: 6px;
}

#stores {
    margin-top: 4px;
}

#released {
    margin-top: 4px;
}

#stores a {
    display: inline-block;
    margin-left: 12px;
}

#stores a:hover {
    font-style: italic;
    text-decoration: underline;
}

.games #shelf img {
    height: 37.4px;
    aspect-ratio: 460 / 215;
    object-fit: contain;
}

#description {
    margin: 12px 0 0;
    line-height: 1.4;
    white-space: pre-line;
}

.goods {
    position: relative;
    margin: 8vh auto 0;
    width: var(--content-width);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px 12px;
    font: 10pt Arial, sans-serif;
}

.shop-filter {
    position: absolute;
    top: 3%;
    right: calc((100% - var(--content-width)) / 2);
    font: 10pt Arial, sans-serif;
}

.shop-filter select {
    font: inherit;
}

.goods a[hidden] {
    display: none;
}

.goods a {
    color: black;
    text-decoration: none;
}

.goods a:hover {
    font-style: italic;
    text-decoration: underline;
}

.goods img, .goods .missing {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 6px;
}

.goods .missing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
}

.events {
    position: relative;
    margin: 5vh auto 24px;
    width: var(--content-width);
    font: 10pt Helvetica, Arial, sans-serif;
}

.people {
    position: relative;
    margin: 5vh 0 24px 14%;
    width: 60%;
    font: 10pt Arial, sans-serif;
    line-height: 1.7;
    text-align: left;
}

.people a {
    display: block;
    width: fit-content;
    color: blue;
    text-decoration: none;
}

.people a:hover {
    font-style: italic;
    text-decoration: underline;
}

.contacts, .featured, .colophon {
    margin-top: 24px;
}

.featured {
    margin-top: 0;
    margin-bottom: 24px;
}

.about nav, .exhibit nav {
    position: fixed;
    z-index: 3;
}

.about nav > a, .exhibit nav > a {
    padding: 0 2px;
}

.show {
    display: grid;
    grid-template-columns: 37% minmax(0, 1fr);
    gap: 24px 30px;
    margin-bottom: 80px;
}

.show button {
    padding: 0;
    border: 0;
    cursor: pointer;
    background: #bdbdbd;
}

.large {
    grid-row: 1 / 3;
    width: 100%;
    aspect-ratio: 16 / 9;
    align-self: start;
}

.details {
    text-align: right;
    line-height: 1.4;
}

.details h2,
#collections h2,
.games #shelf h2 {
    margin: 0;
    font: bold calc(clamp(24px, 2.5vw, 48px) - 5pt) "Times New Roman", serif;
}

#collections {
    margin-top: 96px;
    font: 10pt/1.6 Arial, sans-serif;
}

#collections section {
    margin-bottom: 24px;
}

#collections h2 {
    color: yellow;
    background: red;
    margin-bottom: 8px;
}

#collections a {
    display: block;
    width: fit-content;
    color: red;
    background: yellow;
    text-decoration: none;
}

#collections a:hover {
    font-style: italic;
    text-decoration: underline;
}

.details p {
    margin: 0;
}

.small {
    display: flex;
    gap: 30px;
    align-self: end;
}

.small button {
    width: 15%;
    aspect-ratio: 16 / 9;
}

.small button[aria-pressed="true"] {
    outline: 1px solid black;
    outline-offset: 2px;
}

#enlarged {
    background: yellow;
    padding: 16px 48px;
    border: 0;
    width: min(1100px, 85vw);
    box-sizing: border-box;
}

#enlarged::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

#close {
    border: 2px solid;
    border-color: #aaa #555 #555 #aaa;
    display: block;
    margin: 0 0 12px auto;
    font: 10pt Arial, sans-serif;
}

#show-title {
    position: absolute;
    top: 16px;
    left: 48px;
    right: 110px;
    color: red;
    font: normal 10pt Arial, sans-serif;
}

#picture {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 75vh;
}

.photographs .large,
.photographs .small button {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.photographs .small {
    gap: 8px;
}

.photographs .small button {
    flex: 0 1 15%;
    min-width: 0;
}

.show[data-photos="Loveismydojo_solo"] .small,
.show[data-photos="fbmarketplace_gallery1"] .small {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.show[data-photos="Loveismydojo_solo"] .small button,
.show[data-photos="fbmarketplace_gallery1"] .small button {
    width: 100%;
}

.expanded-slide {
    position: relative;
}

#previous, #next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 8px;
    border: 2px solid;
    border-color: #aaa #555 #555 #aaa;
    background: white;
    color: black;
    font: 32px Arial, sans-serif;
    cursor: pointer;
}

#previous {
    left: -40px;
}

#next {
    right: -40px;
}

@media (max-width: 600px) {
    .show {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .large {
        grid-row: auto;
    }

    .small {
        gap: 12px;
    }

    .small button {
        width: 25%;
    }

    .photographs .small button {
        flex-basis: 25%;
    }
}

@media (max-width: 600px) {
    .cinema .films {
        width: 94%;
        margin-top: 25vh;
    }

    .player {
        width: min(320px, 100%);
    }

    .cinema .player {
        width: 100%;
    }

    #shelf {
        grid-template-columns: repeat(auto-fit, 32px);
    }
}

.people div:not(:has(*)),
.details h2,
.details div,
.details p,
#name,
#released,
#description,
.shop-filter label,
.shop-filter select,
.shop-filter option {
    color: yellow;
    background: red;
}

.people a,
.details a,
#stores a,
.goods a > div {
    color: red;
    background: yellow;
}

main button:not(.large):not(.small button),
#enlarged button {
    color: yellow;
    background: red;
}

.games #shelf {
    order: -1;
    display: block;
    width: 30%;
    max-height: none;
    overflow: visible;
    flex-shrink: 0;
}

.games #shelf section {
    margin-bottom: 12px;
}

.games #shelf h2 {
    margin: 0 0 8px;
    color: yellow;
    background: red;
}

.games #shelf a {
    width: fit-content;
    color: red;
    background: yellow;
    font: 10pt/1.6 Arial, sans-serif;
    text-decoration: none;
}

.games #shelf a:hover,
.games #shelf a:focus-visible {
    font-style: italic;
    text-decoration: underline;
    outline: none;
}

.games .player {
    width: 45%;
    max-height: none;
    overflow: visible;
}

#pokemon-grid {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    width: var(--content-width);
    margin: 8vh auto 0;
}

.pokemon output {
    font: 10pt Arial, sans-serif;
}

.game-version {
    left: calc((100% - var(--content-width)) / 2);
    right: auto;
}

#pokemon-grid img {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

@media (max-width: 600px) {
    .games .films {
        gap: 12px;
    }

    .games #shelf {
        width: 42%;
    }

    .games .player {
        width: 54%;
    }

    #pokemon-grid {
        width: var(--content-width);
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}
