﻿@import url('https://fonts.googleapis.com/css2?family=SUSE:wght@100..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Funnel+Display:wght@300..800');

/* Document elements */
body {
    background-color: silver;
    font-family: 'Funnel Display', Arial, sans-serif;
    /*font-family: 'SUSE', Arial, sans-serif;*/
    font-size: 1.25em;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100dvh;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-drag: none;
    -moz-user-drag: none;
    -webkit-user-drag: none;
}

/* Overlays */
div.overlay {
    position: fixed;
    display: block;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(1em);
    left: 0;
    top: 0;
    width: 100%;
    height: 100dvh;
    transition: ease .25s;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
}

    div.overlay.show {
        opacity: 1;
        visibility: visible;
    }

div.banner {
    position: fixed;
    background: rgba(0, 0, 0, .5);
    color: white;
    backdrop-filter: blur(1em);
    font-size: 2em;
    text-align: center;
    left: 0;
    top: 50dvh;
    width: 100%;
    padding: .5em 0;
    transition: ease 1s;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

    div.banner.show {
        transition: ease .25s;
        opacity: 1;
        visibility: visible;
    }

div.modal {
    position: fixed;
    flex-direction: column;
    background: black;
    color: white;
    box-shadow: 0 1em 2em 0 rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    width: auto;
    max-width: calc(100vw - 2em);
    height: auto;
    max-height: calc(100dvh - 2em);
    transition: ease .25s;
    transform: translate(calc(50vw - 50%), calc(50dvh - 50%)) scale(.75, .75);
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
}

    div.modal.show {
        opacity: 1;
        transform: translate(calc(50vw - 50%), calc(50dvh - 50%)) scale(1, 1);
        visibility: visible;
    }

    div.modal > * {
    }

    div.modal > div.titlebar {
        background: rgba(255, 255, 255, .125);
        border-bottom: 1px solid rgba(255, 255, 255, .25);
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
        font-weight: bold;
        padding: 1em;
        white-space: nowrap;
    }

    div.modal > div.body {
        overflow-y: auto;
        max-height: calc(100vh - 12em);
        max-height: calc(100vh - 12em);
        padding: 1em;
    }

        div.modal > div.body img {
            display: block;
            margin: 0 auto;
        }

    div.modal > div.options {
        border-top: 1px solid rgba(255, 255, 255, .25);
        padding: 1em;
        text-align: center;
    }

        div.modal > div.options input {
            padding: .5em 1em;
        }

/* Header & nav panel */
header {
    position: fixed;
    display: block;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    padding: .25em;
    z-index: 1000;
}

    header > * {
        display: inline-block;
        border-radius: 6px;
        background: black;
        outline: 3px solid black;
        color: white;
        min-width: 3.25em;
        height: 1.25em;
        margin: .5em;
        padding: 1em 0;
        text-align: center;
        vertical-align: bottom;
    }

    header > a#menu {
        background: gold;
        cursor: pointer;
    }

        header > a#menu:hover {
            background: white;
        }

        header > a#menu > div {
            background: black;
            width: 2em;
            height: 3px;
            position: relative;
        }

            header > a#menu > div:first-child {
                transform: translate(50%, 0);
            }

            header > a#menu > div:last-child {
                transform: translate(50%, calc(1em - 50%));
            }

        header > a#menu > div {
            background: black;
            width: 50%;
            height: 3px;
            position: relative;
        }

    header > *.right {
        float: right;
        transform: translateX(-.5em);
    }

nav {
    position: fixed;
    display: block;
    background: black;
    box-shadow: 1em 0 2em 0 rgba(0, 0, 0, .5);
    left: 0;
    top: 0;
    width: 300px;
    height: 100dvh;
    padding: 0em;
    transition: ease .25s;
    z-index: 1002;
    opacity: 0;
    transform: translateX(-100%);
}

    nav.show {
        opacity: 1;
        transform: translateX(0);
    }

    nav > * {
        display: block;
    }

    nav > a {
        background: gold;
        cursor: pointer;
        font: inherit;
        text-decoration: none;
        text-transform: uppercase;
        text-align: center;
        border: 0;
        border-radius: 6px;
        color: black;
        font-weight: bold;
        margin: 1em;
        padding: .75em;
    }

        nav > a:hover {
            background: white;
        }

/* Articles & sections */
article {
    display: table;
    background: skyblue;
    color: black;
    table-layout: fixed;
    width: 100%;
    height: 100dvh;
}

section {
    display: table-row;
}

/* Tables */
table {
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
}

/* Inputs */
input {
    background: gold;
    cursor: pointer;
    font: inherit;
    border: 0;
    border-radius: 6px;
    color: black;
    font-weight: bold;
    padding: .5em .25em;
}

    input:hover {
        background: white;
    }

    input:disabled {
        background: gray;
        cursor: not-allowed;
    }

/* Content */
hr {
    border: 0;
    background: gray;
    height: 1px;
    margin: 0;
    padding: 0;
}

/* Embedded frames */
iframe {
    border: 0;
}

/* Miscellaneous */
div#pnlHealth {
    visibility: hidden;
    padding-left: 1em;
    padding-right: 1em;
}

    div#pnlHealth > span {
        color: red;
        margin: .25em;
    }

        div#pnlHealth > span.bad {
            color: #444;
        }

div.modal a {
    color: inherit;
    text-decoration: underline;
}

    div.modal a:hover {
        color: gold;
        text-decoration: underline;
    }

div.modal iframe {
    width: calc(100vw - 6em);
    height: calc(100dvh - 20em);
}

section.top {
    color: black;
    height: 100%;
}

section.bottom {
    background: black;
    color: white;
    font-size: 1.25em;
    height: auto;
}

article#pnlIntro > section.top {
    vertical-align: middle;
}

    article#pnlIntro > section.top > div.title {
        display: flex;
        font-size: 1.5em;
        text-align: left;
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
    }

        article#pnlIntro > section.top > div.title > div > * {
            display: block;
            margin: 0;
            padding: 0;
            width: auto;
            height: auto;
        }

        article#pnlIntro > section.top > div.title > div > img.logo {
            height: 1em;
        }

        article#pnlIntro > section.top > div.title > div > span.header {
            font-size: 4em;
            font-weight: bold;
        }

article#pnlIntro > section.bottom > table {
    width: 100%;
    text-align: center;
}

    article#pnlIntro > section.bottom > table td {
        padding: .25em;
    }

        article#pnlIntro > section.bottom > table td input {
            display: block;
            margin: .25em;
            padding: .5em;
            width: calc(100% - .5em);
        }

article#pnlIntro > section.bottom > span {
    display: block;
    color: white;
    font-size: .75em;
    margin: .5em;
    text-align: center;
}

    article#pnlIntro > section.bottom > span.byline {
        color: gray;
    }

article#pnlIntro > section.bottom > table td > div#pnlCategories {
    height: 8em;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

    article#pnlIntro > section.bottom > table td > div#pnlCategories > input {
        display: inline-block;
        vertical-align: bottom;
        width: calc(8em - .5em);
        height: calc(100% - .5em);
        white-space: wrap;
    }

        article#pnlIntro > section.bottom > table td > div#pnlCategories > input.checked {
            background-color: white;
        }

article#pnlGame table.layout {
    height: 100%;
    border-spacing: 0;
}

    article#pnlGame table.layout tr:last-child {
        height: 75%;
    }

    article#pnlGame table.layout div#pnlGallows {
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        width: 100%;
        height: 100%;
        transform: translateY(2px);
    }

article#pnlGame div#pnlWordSpace {
    display: flexbox;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    padding: .5em 0;
    text-align: center;
}

    article#pnlGame div#pnlWordSpace div.word {
        display: inline-block;
        margin: 0 .5em;
        margin-left: 0 .5em;
        padding: .5em;
        white-space: nowrap;
    }

        article#pnlGame div#pnlWordSpace div.word:not(:first-child) {
        }

    article#pnlGame div#pnlWordSpace span.letter {
        display: inline-block;
        border-bottom: 3px solid white;
        margin: .25em;
        padding: 0;
        width: 1.5em;
        min-height: 1.5em;
        vertical-align: bottom;
    }

        article#pnlGame div#pnlWordSpace span.letter.missed {
            color: yellow;
        }

    article#pnlGame div#pnlWordSpace span.nonletter {
        display: inline-block;
        border-bottom: 3px solid transparent;
        margin: .25em;
        padding: 0;
        width: 1.5em;
        min-height: 1.5em;
        vertical-align: bottom;
    }

article#pnlGame table.category {
    margin-top: .5em;
    min-height: 2.5em;
}

    article#pnlGame table.category tr:first-child {
        border-bottom: 1px solid white;
    }

        article#pnlGame table.category tr:first-child td:nth-child(2) {
            border: 1px solid white;
            border-radius: 999em;
            font-variant: small-caps;
            text-align: center;
            padding: .5em;
            width: 66.67%;
        }

article#pnlGame div#pnlLetterSpace {
    padding: .25em;
}

    article#pnlGame div#pnlLetterSpace table {
        width: 100%;
    }

        article#pnlGame div#pnlLetterSpace table td {
            padding: .25em;
        }

            article#pnlGame div#pnlLetterSpace table td input {
                display: block;
                width: 100%;
                height: 100%;
            }

                article#pnlGame div#pnlLetterSpace table td input.correct {
                    background: black;
                    outline: 3px solid rgb(0, 192, 0);
                    color: rgb(0, 192, 0);
                }

                article#pnlGame div#pnlLetterSpace table td input.incorrect {
                    background: black;
                    outline: 3px dotted red;
                    color: red;
                }

::-webkit-scrollbar {
    display: initial;
}

:hover::-webkit-scrollbar {
    display: initial;
}

::-webkit-scrollbar-track:horizontal {
    border-top: 1px solid #ccc;
}

::-webkit-scrollbar-track:vertical {
    border-left: 1px solid #ccc;
}

::-webkit-scrollbar,
::-webkit-scrollbar-corner {
    background-color: transparent;
}

    ::-webkit-scrollbar:horizontal {
        height: 7px;
    }

    ::-webkit-scrollbar:vertical {
        width: 7px;
    }

::-webkit-scrollbar-track:horizontal {
    border-top: 0;
}

::-webkit-scrollbar-track:vertical {
    border-left: 0;
}

::-webkit-scrollbar-track:hover {
    background-color: rgba(128, 128, 128, .0625);
}

::-webkit-scrollbar-thumb {
    background-color: rgba(128, 128, 128, .75);
}

    ::-webkit-scrollbar-thumb:hover {
        background-color: rgba(192, 192, 192, .75);
    }

    ::-webkit-scrollbar-thumb:active {
        background-color: rgba(96, 96, 96, .75);
    }

@media screen and (max-width: 750px), (max-height: 750px) {
    body {
        font-size: 1em;
    }

    article#pnlIntro > section.top > div.title {
        font-size: 1.125em;
    }

    article#pnlGame div#pnlWordSpace {
        font-size: .75em;
    }
}

@media screen and (max-width: 400px), (max-height: 400px) {
    body {
        font-size: .75em;
    }

    header {
        font-size: calc(4em/3);
    }

    article#pnlGame div#pnlLetterSpace {
        overflow-x: auto;
        padding-left: calc(50vw - 1.75em);
        padding-right: calc(50vw - 1.75em);
        text-align: center;
        white-space: nowrap;
    }

        article#pnlGame div#pnlLetterSpace table {
            display: inline-block;
            width: auto;
        }

            article#pnlGame div#pnlLetterSpace table tr {
                display: inline-block;
                padding: 0;
                width: auto;
            }

            article#pnlGame div#pnlLetterSpace table td {
                display: inline-block;
                padding: .25em;
            }

                article#pnlGame div#pnlLetterSpace table td input {
                    display: block;
                    width: 3em;
                    height: 3em;
                }
}

@media screen and (min-aspect-ratio: 1/1) and (max-aspect-ratio: 1/1) and (max-width: 480px) {
    header > #menu {
        transform: translateX(calc(50vw - 100% - 1em));
    }

    header > #lblScore {
        transform: translateX(calc(-50vw + 100% + 1em));
    }

    article#pnlIntro section.top {
        font-size: .67em;
    }

    article#pnlIntro section.bottom {
        font-size: .9em;
    }

    article#pnlGame div#pnlLetterSpace {
        overflow-x: auto;
        padding-left: calc(50vw - 1.75em);
        padding-right: calc(50vw - 1.75em);
        text-align: center;
        white-space: nowrap;
    }

        article#pnlGame div#pnlLetterSpace table {
            display: inline-block;
            width: auto;
        }

            article#pnlGame div#pnlLetterSpace table tr {
                display: inline-block;
                padding: 0;
                width: auto;
            }

            article#pnlGame div#pnlLetterSpace table td {
                display: inline-block;
                padding: .25em;
            }

                article#pnlGame div#pnlLetterSpace table td input {
                    display: block;
                    width: 3em;
                    height: 3em;
                }
}

@media screen and (max-width: 360px), (max-height: 360px) {
    /* TODO: Add "too small" message styling here */
}

@media screen and (max-height: 480px) {
    /*header > *:not(#menu) {
                background: #444;
                color: white;
            }*/

    header > div#pnlHealth > span.bad {
        color: black;
    }

    /*div#pnlHealth {
                visibility: visible;
            }*/

    div.banner {
        top: 0;
        /*background-color: rgba(128, 128, 128, .5);*/
        transform: translateY(calc(50dvh - 50%));
    }

    /*article#pnlGame {
                background: black;
            }

                article#pnlGame div#pnlGallows {
                    display: none;
                }*/
}

@media screen and (display-mode: standalone) {
    body,
    article {
        height: 100svh;
    }
}
