* {
    box-sizing: border-box;
}

:root {
    --bg: white;
    --fg: black;
    --gray: #d3d3d3;
    --gray-hover: #e4e4e4;
    --contrast-fg: var(--fg);
    --scheme: light;

    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #222;
        --fg: #CCC;
        --gray: #444;
        --gray-hover: #555;
        --contrast-fg: white;
        --scheme: dark;
    }

    body>a>img,
    header>a>img,
    .more>img {
        filter: invert();
    }
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;

    color-scheme: var(--scheme);

    background-color: var(--bg);
    color: var(--fg);
    padding-bottom: max(10dvw, 100px);
}

header>a {
    position: absolute;
    top: 15px;

    &>img {
        width: 2.7em;
        aspect-ratio: 1;
    }

    &:first-child {
        left: 15px;
    }

    &:has(+*) {
        right: 15px;
    }
}

.center {
    display: flex;
    justify-content: center;
    /* horizontal */
    /* align-items: center;     vertikal */
    height: 100vh;
    /* ganze Höhe */
    margin: 0;
}

h1 {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    margin-inline: calc(2.7rem + 2* 15px);
}

.items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.items a {
    display: flex;
    flex-direction: column;
    min-width: 250px;
    width: 25%;
    max-width: 10cm;
    padding: 20px;
    background-color: var(--gray);
    color: var(--contrast-fg);
    border-radius: 20px;

    &:hover {
        background-color: var(--gray-hover);
    }
}

@media (width < 600px) {
    .items {
        flex-direction: column;
        align-items: center;
        padding: 1cm;

        & a {
            width: 100%;
        }
    }
}

.items img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
}

.items p {
    width: 100%;
    -webkit-hyphens: auto;
    /* Safari/Chrome */
    -ms-hyphens: auto;
    /* IE/Edge */
    hyphens: auto;
    /* Standard */
    word-wrap: break-word;
    font-family: Arial, Helvetica, sans-serif;
    margin-bottom: 0;
    padding-inline: 10px;
}

.logo {
    z-index: 0;
    position: fixed;
    right: 2%;
    bottom: 2%;
    width: 10%;
    min-width: 100px;
    /* background-color: rgb(6, 147, 227, 0.2);
    padding: 10px;
    border-radius: 10px; */
}

a {
    text-decoration: none;
    /* keine Unterstreichung */
    color: inherit;
    /* normale Textfarbe statt blau */
}

.canvas {
    width: 50vw;
    height: 50vh;
    cursor: grab;
}

@media (width < 700px) {
    .canvas {
        width: calc(100% - 0.5cm);
        height: 70%;
        /* padding: 0.5cm; */
    }
}

.canvas:active {
    cursor: grabbing;
}

#canvas {
    border-radius: 20px;
    border-style: solid;
    border-width: 10px;
    border-color: darkgray;
}

button {
    position: absolute;
    right: 50%;
    translate: 50% 0;
    width: 7%;
    height: 7%;
    font-size: 200%;
    margin-bottom: 2px;
}

*:has(+.more) {
    flex-grow: 1;
}

.more {
    display: flex;
    flex-direction: row;
    justify-content: end;
    align-items: center;
    height: 2em;
    gap: 0.25em;

    &>* {
        display: block;
    }

    &>span {
        color: lightblue;
        text-decoration: underline;
    }

    &>img {
        flex-grow: 0;
        flex-shrink: 1;
        height: 1.5em;
        width: 1.5em;
    }
}

.langchooser {
    display: flex;
    justify-content: stretch;
    flex-direction: column;

    height: 100dvh;
    width: 100dvw;

    padding: 10px;
    gap: 10px;

    &>h1 {
        margin-bottom: 0;
    }

    &>p {
        all: unset;
        text-align: center;
        margin-bottom: 1em;
    }

    &>.langs {
        flex: 1 1;
        display: flex;
        justify-content: stretch;
        flex-direction: column;
        gap: 10px;

        &>a {
            display: flex;
            flex: 1 1;
            justify-content: center;
            align-items: center;
            border-radius: 5px;

            &.selected {
                --fg: green;
            }

            background-color: color-mix(in srgb, var(--fg) 10%, var(--bg));

            &:hover {
                background-color: color-mix(in srgb, var(--fg) 15%, var(--bg));

                &>span {
                    translate: 0 -0.2em;
                }
            }

            &>span {
                display: inline;
                font-size: 2em;
                font-weight: bold;
            }
        }
    }
}

@media (width > 1300px) {
    .langchooser>.langs {
        flex-direction: row;
    }
}