:root {
    --num-of-items: 0;
}

@font-face {
    font-family: "FS Me";
    src: url("fonts/fsme.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "PLZ";
    src: url("https://manzdev.github.io/twitch-zx-spectrum/fonts/plz.woff2") format("woff2"),
    url("https://manzdev.github.io/twitch-zx-spectrum/fonts/plz.woff") format("woff");
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    src: url("Montserrat.ttf") format("ttf");
    font-display: swap;
}

body {
    font-family: "FS Me", sans-serif;
    margin: 0;
    padding: 0;
    border:60px solid #f1e9de;
    background-color: #f1e9de
}
.page {
     border:10px solid #d2c5b0;
    border-radius: 4px;
}

header.bbc-header h1 {
    margin: 0;
    padding-left: 20px;
    font-family:  'Courier New', monospace;
    color:#ffffd7 !important;
    font-weight: normal
}

p.subtitle {
    padding-left: 10px;
}

.main-container {
    padding: 10px 10px 0;
    background: #000;
    color:beige;
}

.carousel {
    margin: 0 auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-color: #e8504b #8E8A8A;
    transform: rotateX(180deg);
}

.games {
    display: grid;
    grid-template-columns: repeat(var(--num-of-items), 100%);
    grid-template-rows: auto;
    gap: 10px 20px;
    transform: rotateX(180deg);
    padding-top: 6px;
}

@media screen and (min-width: 641px) {
    .games {
        grid-template-columns: repeat(var(--num-of-items), minmax(640px, 1fr));
    }
}

.game-container {
    display: contents;

}

.game-container * {
    scroll-snap-align: start;

}

.game-container .header {
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    background: #e8504b;
    color: #fff;
    height: 50px;
    align-items: center;
    padding: 0 20px;
    margin: 0 -20px;
}

.game-container h2.header::before {
    content: ' ';
    display: block;
    background: black;
    background-image: url("../assets/bbc-micro-keyboth.png");
    width: 40px;
    height: 50px;
    margin-left: -20px
}

.game-container:last-child span.header {
    padding-right: 0;
}

.game-container:last-child span.header::after {
    content: ' ';
    display: block;
    background: black;
    background-image: url("../assets/bbc-micro-keyright.png");
    width: 40px;
    height: 50px;
    background-repeat: no-repeat;
    margin-left: calc(100% - 23px);
}

.game-container .title {
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    padding: 0 10px;
}

.game-container .year {
    grid-row: 3;
    padding: 0 10px;
}

.game-container .thumb {
    grid-row: 4;
    position: relative;
    cursor: pointer;
    padding: 0 10px;
}

.game-container .thumb-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.game-container a:hover img {
    outline: 5px solid #e8504b;
}

.game-container .game {
    grid-row: 4;
}

.game-container .details {
    grid-row: 5;
    margin: 10px -10px 20px 10px;
    border: 1px solid #aaa;
    border-radius: 4px;
    padding: .5em .5em 0;
    height: fit-content;
}

.game-container .details summary {
    font-weight: bold;
    margin: -.5em -.5em 0;
    padding: .5em;
}

.game-container .details[open] {
    padding: .5em;
}

.game-container .details[open] summary {
    border-bottom: 1px solid #aaa;
    margin-bottom: .5em;
}

.game {
    display: none;
}

.play,
.game * {
    max-width: 100%;
    height: fit-content !important;
}

.game div:nth-of-type(1) {
    display: none !important;
}

.game div:nth-of-type(2) {
    position: absolute;
    display: flex;
    justify-content: flex-end;
    background: transparent !important;
}

.game div:nth-of-type(2) div button {
    display: none;
}

.game div:nth-of-type(2) div button:nth-of-type(2) {
    display: block;
}

.game div:nth-of-type(2) div button:nth-of-type(2) svg {
    display: block;
    height: 20px !important;
}

.main-footer {
    padding: 10px 10px 0;
}

.keyboard {
    display: flex;
    justify-content: center;
    margin: 0 -10px;
    padding: 0;
}

.carousel::-webkit-scrollbar {
    width: 12px;
    height: 20px;
    background: grey;
}

.carousel::-webkit-scrollbar-corner,
.carousel::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

.carousel::-webkit-scrollbar-thumb {
    background-color: #e8504b;
    background-clip: padding-box;
    border: 2px solid transparent;
}

.carousel::-webkit-scrollbar-thumb:hover {
    background-color: #e8504b;
}

.carousel::-webkit-scrollbar-thumb:active {
    background-color: #e8504b;
}

.carousel::-webkit-scrollbar-thumb:horizontal{
    background: #e8504b;
    border-radius: 10px;
}

/* Buttons */
.carousel::-webkit-scrollbar-button:single-button {
    background-color: #f1f1f1;

    display: block;
    background-size: 10px;
    background-repeat: no-repeat;
}

/* Left */
.carousel::-webkit-scrollbar-button:single-button:horizontal:decrement {
    height: 12px;
    width: 12px;
    background-position: 3px 5px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(232, 80, 75)'><polygon points='0,50 50,100 50,0'/></svg>");

}

.carousel::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(112, 112, 112)'><polygon points='0,50 50,100 50,0'/></svg>");
}

.carousel::-webkit-scrollbar-button:single-button:horizontal:decrement:active {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(128, 128, 128)'><polygon points='0,50 50,100 50,0'/></svg>");
}

/* Right */
.carousel::-webkit-scrollbar-button:single-button:horizontal:increment {
    height: 12px;
    width: 12px;
    background-position: 3px 5px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(232, 80, 75)'><polygon points='0,0 0,100 50,50'/></svg>");
}

.carousel::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(112, 112, 112)'><polygon points='0,0 0,100 50,50'/></svg>");
}

.carousel::-webkit-scrollbar-button:single-button:horizontal:increment:active {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(128, 128, 128)'><polygon points='0,0 0,100 50,50'/></svg>");
}

