/**
 * Copyright (c) 2024 CineKohl Heimkinogesellschaft mbH Kettig
 * All right reserved
 */

@font-face {
    font-family: "Nunito Sans";
    font-weight: 200 1000;
    font-style: normal;
    font-display: swap;
    src: url("/fonts/nunito-sans.ttf") format("truetype-variations");
}
@font-face {
    font-family: "Nunito Sans";
    font-weight: 200 1000;
    font-style: italic;
    font-display: swap;
    src: url("/fonts/nunito-sans_i.ttf") format("truetype-variations");
}

@property --_background-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
:root {
    height: 100%;
    scrollbar-gutter: stable;
    color-scheme: light only;

    --background: #fff;
    --text: #363838;
    --text-dim: #909a9c;
    --text-bright: #000;
    --primary: #fb1368;
    --secondary: #00a8a8;

    --fsk-0: #555;
    --fsk-6: #bb7b00;
    --fsk-12: #029313;
    --fsk-16: #188cc5;
    --fsk-18: #dd000a;
}
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark only;

        --background: #030205;
        --text-dim: #909a9c;
        --text: #eff3f3;
        --text-bright: #fff;
        --primary: #fc4285;
        --secondary: #4cffff;

        --fsk-0: white;
        --fsk-6: #ffe940;
        --fsk-12: #2fb63e;
        --fsk-16: #35a9e5;
        --fsk-18: #ee151f;
    }
}
body {
    min-height: 100%;
    margin: 0;
    padding-top: 77px;
    display: grid;
    background: var(--background);
    color: var(--text);
    grid-template: "header" max-content
                   "main" minmax(0, 1fr)
                   "footer" max-content / minmax(0, 1fr);
    font-family: "Nunito Sans", ui-sans-serif, system-ui, sans-serif;
}
a {
    color: var(--primary);
}
svg {
    fill: currentColor;
}
header {
    grid-area: header;
    background: rgb(from var(--background) r g b / 63%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: grid;
    grid-template: "logo nav" minmax(0, 1fr) / max-content minmax(0, 1fr);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 4px 20px #0003;
    z-index: 1;

    &::after {
        content: "";
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 1px;
        background: linear-gradient(to right,
            rgb(from var(--text) r g b / 0%),
            rgb(from var(--text) r g b / 44%),
            rgb(from var(--text) r g b / 50%),
            rgb(from var(--text) r g b / 44%),
            rgb(from var(--text) r g b / 0%)
        );
    }

    #logo {
        padding: 18px;
        display: block;
        grid-area: logo;
        >a {
            text-decoration: none;
            color: inherit;
            >svg {
                display: block;
                height: 40px;
            }
        }
    }

    nav {
        grid-area: nav;
        justify-content: end;
        align-items: stretch;
        display: flex;
        >a {
            --_percentage: calc(var(--_n) / var(--_x) * 100%);
            display: flex;
            align-items: center;
            text-decoration: none;
            font-stretch: 125%;
            padding: 10px 20px;
            color: var(--text);
            transition: 0.14s ease-out;
            transition-property: color, background-color, font-weight;
            text-transform: uppercase;
            &:hover {
                --_color: color-mix(in lch, var(--primary) calc(100% - var(--_percentage)), var(--secondary) var(--_percentage));
                color: var(--_color);
                background: rgb(from var(--_color) r g b / 20%);
                font-weight: 1000;
            }
        }
    }
}
:root[data-spa="loading"],
html.spa-loading {
    &, *, * *, * * * {
        cursor: wait !important;
        pointer-events: none !important;
    }
    header {
        &::before, &::after {
            content: "";
            display: block;
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            height: 2px;
            background-image: linear-gradient(to right, var(--primary), var(--secondary), var(--primary));
            background-size: 128px 100%;
            animation: spa-loading 0.5s linear infinite;
        }
        &::before {
            opacity: 0.9;
            filter: blur(8px);
        }
    }
}

@keyframes spa-loading {
    to { background-position-x: 128px; }
}

main {
    grid-area: main;
}
footer {
    grid-area: footer;
    padding: 18px;
    border-top: 1px solid rgb(from var(--text) r g b / 44%);
    background-color: rgb(from var(--text) r g b / 3%);
    color: var(--text-dim);
    font-weight: 200;
    font-stretch: 125%;

    .container {
        position: relative;
        #totop {
            appearance: none;
            border: none;
            background: none;
            color: inherit;
            border-radius: 2px;
            padding: 5px;
            display: block;
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            margin-block: auto;
            width: 40px;
            height: 40px;
            cursor: pointer;
            &:hover {
                background: rgb(from var(--text) r g b / 20%);
            }
            svg {
                display: block;
                width: 30px;
                height: 30px;
                fill: currentColor;
            }
        }
    }
}

.button {
    --_background: var(--text);
    --_text: var(--background);
    --_state-color: var(--_background);

    appearance: none;
    display: inline-flex;
    border-radius: 5px;
    padding: 8px 12px;
    border: none;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    font-weight: 1000;
    font-stretch: 125%;
    text-transform: uppercase;
    background: var(--_state-color);
    color: var(--_text);
    transition: 0.14s ease-out;
    transition-property: background-color, color, border-color;

    &.primary {
        --_text: var(--background);
        --_background: var(--primary);
    }

    &.secondary {
        --_text: var(--background);
        --_background: var(--secondary);
    }

    &:hover {
        --_state-color: hsl(from var(--_background) h s calc(l + 15));
    }

    &:active {
        --_state-color: hsl(from var(--_background) h s calc(l - 15));
    }

    &.outlined {
        background: rgb(from var(--_state-color) r g b / 0%);
        box-shadow: 0 0 0 3px currentColor inset;
        color: var(--_background);

        &:hover {
            background: rgb(from var(--_state-color) r g b / 25%);
            color: var(--_state-color);
        }
    }
}

.input {
    appearance: none;
    display: inline-block;
    border-radius: 5px;
    padding: 8px 12px;
    border: 0;
    color: inherit;
    font: inherit;
    font-weight: 400;
    font-stretch: 125%;
    background: none;
    color: var(--_text);
    box-shadow: 0 0 0 1px currentColor inset;
    transition: 0.14s ease-out;
    transition-property: background-color, color box-shadow;
    &:focus {
        outline: none;
        color: var(--secondary);
        background: rgb(from var(--secondary) r g b / 25%);
        box-shadow: 0 0 0 3px currentColor inset;
    }
}

label:has(+ .input) {
    display: block;
    font-weight: 1000;
    font-stretch: 125%;
    text-transform: uppercase;
    font-size: 10pt;
    flex-basis: 100%;
    align-self: start;
}

@supports (color: hsl(from red h s calc(l + 20%))) {
    .button {
        &:hover {
            --_state-color: hsl(from var(--_background) h s calc(l + 15%));
        }

        &:active {
            --_state-color: hsl(from var(--_background) h s calc(l - 15%));
        }
    }
}

.hero {
    margin-top: -77px;
}

ck-banners {
    display: block;
    position: relative;
    z-index: 0;
    overflow: hidden;
    --text: #fff;
    span, a {
        display: block;
        text-decoration: none;
        width: 100%;
        height: auto;
        &.ck-moving {
            position: absolute;
            left: 0;
            top: 0;
        }
        &.ck-hidden {
            display: none;
        }
        img {
            display: block;
            width: 100%;
            height: auto;
        }
    }
}
.error-page-container {
    text-align: center;
    height: 100%;
    display: flex;
    place-items: center;
    h1 {
        --_background-angle: 0deg;
        font-size: clamp(20pt, 6.7vw, 72pt);
        font-weight: 900;
        font-stretch: 125%;
        text-wrap: balance;
        background: linear-gradient(var(--_background-angle), var(--primary), var(--secondary));
        background-clip: text;
        color: transparent;
        margin: 32px 0 12px;
        text-transform: uppercase;
        animation: err-rotate-angle 30s linear infinite;
    }
}

@keyframes err-rotate-angle {
    from { --_background-angle: 0deg; }
    to { --_background-angle: 360deg; }
}

.container {
    inline-size: 100%;
    max-inline-size: 1800px;
    margin-inline: auto;
    padding-inline: 20px;
}

h2 {
    color: var(--text-bright);
    font-weight: 400;
    font-size: 18pt;
    font-stretch: 125%;
    margin: 20px 0;
}

.movies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    justify-items: center;
}

.movies-row {
    display: flex;
    overflow: auto;
    gap: 20px;
    margin-bottom: 40px;
    margin-inline: -20px;
    padding-inline: 20px;
    >.movie-item {
        flex-shrink: 0;
        width: 220px;
    }
}

.movie-item {
    display: block;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    border-radius: 5px;
    min-width: 220px;
    max-width: 260px;
    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: 0.14s ease-out;
        border-radius: inherit;
        color: rgba(0, 0, 0, 0) !important;
        text-indent: -999px;
        aspect-ratio: 320 / 480;
    }
    &:hover {
        img {
            scale: 1.1;
        }
    }
    .movie-info {
        --_blur-radius: 4px;
        position: absolute;
        inset: 0;
        transition: 0.14s ease-out;
        transition-property: opacity, backdrop-filter, -webkit-backdrop-filter;
        opacity: 1;
        -webkit-backdrop-filter: blur(var(--_blur-radius));
        backdrop-filter: blur(var(--_blur-radius));
        background: rgb(from var(--background) r g b / 75%);
        color: var(--text);
        padding: 10px;
        border-radius: inherit;

        .movie-title {
            font-stretch: 125%;
            font-weight: 700;
            text-wrap: balance;
        }

        .movie-details {
            display: flex;
            align-items: center;
            gap: 10px;
        }
    }
    &:not(:hover) {
        .movie-info {
            --_blur-radius: 0;
            opacity: 0;
        }
    }
}

.movie-details-container {
    display: grid;
    max-width: 1000px;
    margin-inline: auto;
    grid-template: "poster title" max-content
                   "poster genres" max-content
                   "poster year" max-content
                   "poster details" max-content
                   "poster description" minmax(0, 1fr)
                 / max-content minmax(0, 1fr);
    column-gap: 20px;
    margin-top: 20px;
    .movie-poster,
    .game-details-cover {
        grid-area: poster;
        object-fit: cover;
        width: 373px;
        max-width: 100%;
        color: rgba(0, 0, 0, 0) !important;
        text-indent: -999px;
        background-image: linear-gradient(
            to right,
            transparent,
            rgb(from var(--text) r g b / 20%),
            transparent,
            rgb(from var(--text) r g b / 20%),
            transparent
        );
        background-clip: content-box;
        background-size: 200% 200%;
        border: 1px solid rgb(from var(--text) r g b / 44%);
        animation: skeleton 1.5s linear infinite;
        border-radius: 2px;
        position: sticky;
        top: 97px;
    }
    .movie-poster {
        aspect-ratio: 373 / 560;
    }
    .movie-genres {
        grid-area: genres;
    }
    .movie-title {
        grid-area: title;
        margin: 0;
    }
    .movie-release-year {
        grid-area: year;
        font-stretch: 125%;
    }
    .movie-details {
        grid-area: details;
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 10px;
    }
    .movie-description {
        grid-area: description;
        white-space: pre-line;
        margin-top: 20px;
        margin-bottom: 20px;
        text-align: justify;
        text-wrap-style: balance;
    }
}

.movie-poster-backdrop {
    position: fixed;
    z-index: -1;
    left: 0;
    top: 0;
    right: 0;
    width: 100%;
    height: min(900px, 100vh);
    object-fit: cover;
    filter: blur(12px);
    opacity: 0.4;
    --_mask: linear-gradient(black 67%, transparent);
    -webkit-mask: var(--_mask);
    mask: var(--_mask);
    transition: opacity 0.8s ease-out;
    &:not(.loaded) {
        opacity: 0;
    }
}

.movie-fsk {
    border: 1px solid var(--_color);
    background-color: rgb(from var(--_color) r g b / 25%);
    border-radius: 2px;
    padding: 2px 6px;
    display: inline-grid;
    place-items: center;
    color: var(--_color);
    font-size: 12px;
    font-stretch: 125%;
    font-weight: 700;
    &.fsk-0 { --_color: var(--fsk-0); }
    &.fsk-6 { --_color: var(--fsk-6); }
    &.fsk-12 { --_color: var(--fsk-12); }
    &.fsk-16 { --_color: var(--fsk-16); }
    &.fsk-18 { --_color: var(--fsk-18); }
}

.movie-genres {
    text-transform: uppercase;
    font-weight: 200;
    font-stretch: 125%;
}

@keyframes skeleton {
    from { background-position-x: 0%; }
    to { background-position-x: -200%; }
}

#m-nav-toggle {
    display: none;
}

.ck-image-buttons {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    pointer-events: none;
    display: flex;
    gap: 4px;
    justify-content: center;
    filter: drop-shadow(0 2px 8px #0005);
    box-shadow: 0 0 0 0px var(--text) inset;
    button {
        appearance: none;
        background: none;
        padding: 0;
        display: block;
        border: 2px solid var(--text);
        border-radius: 0;
        width: 24px;
        height: 16px;
        pointer-events: all;
        cursor: pointer;
        transition: box-shadow 0.14s ease-out;
        &:first-of-type {
            border-top-left-radius: 5px;
            border-bottom-left-radius: 5px;
        }
        &:last-of-type {
            border-top-right-radius: 5px;
            border-bottom-right-radius: 5px;
        }
        &:hover {
            box-shadow: 0 0 0 2px var(--text) inset;
        }
        &.active {
            background: var(--text);
        }
    }
}

.row {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    + .row {
        margin-top: 4px;
        &.more-space {
            margin-top: 16px;
        }
    }
    &.overflowing {
        overflow-x: auto;
        flex-wrap: nowrap;
        width: calc(100% + 40px);
        margin-inline: -20px;
        padding-inline: 20px;
    }
}

#game-systems > * {
    flex-shrink: 0;
    white-space: nowrap;
}

.ck-has-blurhash {
    content-visibility: hidden;
    background: var(--_blurhash) 0 0/100% 100% no-repeat;
}

.game-item {
    .game-item-wrapper {
        display: block;
        transition: 0.14s ease-out;
        z-index: 0;
        position: relative;
    }
    &.game-item--digital > .game-item-wrapper {
        border: none;
    }
    &:hover {
        img {
            scale: 1;
        }
        .game-item-wrapper {
            scale: 1.1;
        }
    }
}

.game-system__3b453e69-cd67-4a8a-bce2-64b79c8585b9 { /* PS4 */
    img {
        aspect-ratio: 375 / 480;
        object-position: bottom right;
    }
}

.game-system__4049aaaf-f24c-48a2-8399-d4a766767bd3 { /* PS5 */
    img {
        aspect-ratio: 375 / 480;
        object-position: bottom right;
    }
}
.game-system__0f62b681-4553-4986-8679-b961e7989217 { /* XBOX One */
    .game-item-wrapper {
        border: 1px solid #127D12;
        border-width: 26px 3px 5px 0;
        &::before {
            content: "";
            background: url("/images/xbox-one-logo.png?h=36") center center/contain no-repeat;
            display: block;
            position: absolute;
            left: 0;
            right: 0;
            top: -22px;
            margin: 0 auto;
            width: 90px;
            height: 18px;
        }
    }
    &.xone-nextgen {
        .game-item-wrapper {
            border-top-width: 5px;
            &::before {
                content: none;
                display: none;
            }
        }
        img {
            aspect-ratio: 980 / 1210;
        }
    }
    img {
        aspect-ratio: 1256 / 1459;
        object-position: bottom right;
    }
}
.game-system__26a2fb85-a153-4f4d-a040-ebbd4f66c96c { /* GameBoy Advance */
}
.game-system__3061d284-6358-465e-9c2f-255ac4a4b1bc { /* XBOX */
    img {
        aspect-ratio: 0.7;
    }
    .game-item-wrapper {
        border: 5px solid #5FB91D;
        border-left-width: 0;
    }
}
.game-system__33410fac-e58c-48d0-ba9d-56d3616ce0b3 { /* SNES */
    img {
        aspect-ratio: 875 / 628;
    }
}
.game-system__4a180ed3-d5ad-47e0-a57a-f16c879e08d5 { /* DS */
    img {
        aspect-ratio: 1204 / 1087;
    }
    .game-item-wrapper {
        border: 6px solid #eee8;
        border-left-width: 0;
    }
    &.ds-intl .game-item-wrapper {
        border-color: #515255;
    }
}
.game-system__6400981a-3e15-4b09-a62a-288f7605d233 { /* PlayStation 2 */
    img {
        aspect-ratio: 0.7;
    }
    .game-item-wrapper {
        border: 5px solid #2438BD;
        border-left-width: 0;
    }
    &.ps2-platinum .game-item-wrapper {
        border-color: #A2B3BD;
    }
    &.ps2-red .game-item-wrapper {
        border-color: #FF2D0A;
    }
    &.ps2-orange .game-item-wrapper {
        border-color: #ff5e00;
    }
    &.ps2-white .game-item-wrapper {
        border-color: #E3E3E6;
    }
}
.game-system__6cb2e951-c73d-4dcc-bbff-5d12e2cfb0f3 { /* GameBoy */
}
.game-system__74cda4ab-6a71-42a5-9813-bc96e42ebf5f { /* XBOX 360 */
    img {
        aspect-ratio: 0.7;
    }
    .game-item-wrapper {
        border: 5px solid #7CAC18c0;
        border-left-width: 0;
    }
    &.x360-classics .game-item-wrapper {
        border-color: #7b8493c0;
    }
}
.game-system__89a697e1-83e8-4e4e-a4d0-02cb06ceec27 { /* Switch */
    img {
        aspect-ratio: 29 / 47;
    }
}
.game-system__45a54bc3-ae74-4382-8763-f1b89cefd2d5 { /* Switch 2 */
    img {
        aspect-ratio: 29 / 47;
    }
    &.digital-only img {
        aspect-ratio: 1;
    }
}
.game-system__c71fc797-8a36-4e47-ab46-f61c2d564369 { /* PlayStation Portable */
    img {
        aspect-ratio: 29 / 50;
    }
    .game-item-wrapper {
        border: 5px solid #eee8;
        border-left-width: 0;
    }
    &.psp-platinum .game-item-wrapper {
        border-color: #AEAEAE;
    }
}
.game-system__db5f1159-b9ec-45e8-9619-9e20912e0ae4 { /* Wii U */
    img {
        aspect-ratio: 0.7;
    }
    .game-item-wrapper {
        border: 5px solid #0199C3;
        border-left-width: 0;
    }
    &.wiiu-mk8-steelbook .game-item-wrapper {
        border: none;
    }
}
.game-system__dcb3142c-e1f2-45ba-8d43-6cf706d2c607 { /* Wii */
    img {
        aspect-ratio: 0.7;
    }
    .game-item-wrapper {
        border: 5px solid #E3E3E6;
        border-left-width: 0;
    }
    &.wii-nsmb .game-item-wrapper {
        border-color: #E4281A;
    }
    &.wii-booklet .game-item-wrapper {
        border: none;
        aspect-ratio: 1 / 1;
    }
}
.game-system__7a068377-cec9-43d1-8d77-5fd086489c15 { /* GameCube */
    img {
        aspect-ratio: 0.7;
    }
    .game-item-wrapper {
        border: 5px solid #141414;
        border-left-width: 0;
    }
    &.gcn-blue .game-item-wrapper {
        border-color: #4b52bd;
    }
}
.game-system__f64dd3d3-b95a-415d-801c-93179f40b3e1 { /* 3DS/2DS */
    img {
        aspect-ratio: 1171 / 1059;
    }
    .game-item-wrapper {
        border: 6px solid #E3E3E6;
        border-left-width: 0;
    }
}

#games-list {
    align-items: end;
    margin-top: 10px;
    .game-item[hidden] {
        display: none !important;
    }
    &:is(:empty, .no-results)::after {
        content: "Keine Ergebnisse";
        font-stretch: 125%;
        font-weight: 200;
        font-size: 18pt;
        color: var(--text-dim);
        justify-self: center;
        text-align: center;
    }
}

#games-search {
    width: 100%;
    min-width: 0;
}

.random-container {
    text-align: center;
    padding-block: 20px;
}

@media (max-width: 800px) {
    .movie-details-container {
        grid-template: "title" max-content
                       "genres" max-content
                       "year" max-content
                       "details" max-content
                       "poster" max-content
                       "description" minmax(0, 1fr)
                     / minmax(0, 1fr);
        row-gap: 10px;
        .movie-poster,
        .game-details-cover {
            position: static;
            width: 100%;
            max-width: 240px;
            height: auto;
            margin-inline: auto;
        }
        .movie-details,
        .movie-description {
            margin-top: 0;
        }
    }
}

@media (max-width: 1100px) {
    header {
        grid-template: "logo toggle" minmax(0, 1fr)
                       "nav nav" max-content / minmax(0, 1fr) max-content;
        #m-nav-toggle {
            --_size: 40px;
            grid-area: toggle;
            display: block;
            width: var(--_size);
            height: var(--_size);
            position: relative;
            margin: 18px;
            cursor: pointer;

            input {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                background: none;
                margin: 0;
                padding: 0;
                border: 0;
                appearance: none;
                cursor: pointer;
            }

            .line {
                display: block;
                left: 0;
                top: -1px;
                position: absolute;
                /* transform-origin: 50% 50%; */
                background: var(--text);
                width: calc(sqrt(2) * var(--_size));
                height: 2px;
                transition: 0.14s ease-out;
                transition-property: translate, scale, rotate;
            }

            input:not(:checked) ~ .line {
                width: var(--_size);
                rotate: 0deg;
                &.line1 {
                    translate: 0px 8px;
                }
                &.line2 {
                    translate: 0px 20px;
                }
                &.line3 {
                    translate: 0px 32px;
                }
            }

            &:hover input:not(:checked) ~ .line {
                &.line1 {
                    translate: 0px 4px;
                }
                &.line3 {
                    translate: 0px 36px;
                }
            }

            input:checked ~ .line {
                translate: -8px 20px;
                &.line1 {
                    rotate: 45deg;
                }
                &.line2 {
                    rotate: 0deg;
                    scale: 0% 100%;
                }
                &.line3 {
                    rotate: -45deg;
                }
            }
        }
        nav {
            flex-direction: column;
            display: none;
        }
        #m-nav-toggle:has(:checked) + nav {
            display: flex;
        }
    }
    .hero {
        margin-top: 0;
    }
}
