@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

body {
    background-color: #000;
    color: #aaa;
    color-scheme: dark;
    margin: 0;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    font-size: calc(max(1rem, 2.2vh));
}

a {
    color: #55a;
}

a:hover {
    color: #66a;
}

#main {
    background-color: #111;
    max-width: 52em;
    margin: 1em auto auto auto;
    padding: 1em;
}

#maingame {
    display: flex;
    flex-direction: column;
}

@media screen and (max-width: 480px) {
    #maingame {
        flex-direction: column-reverse;
    }
}

.row {
    display: flex;
    flex-direction: row;
    gap: 2px;
    margin-bottom: 2px;
    justify-items: center;
}

.poembox {
    flex: 6;
    min-height: calc(max(30vh, 12em) - 2em);
    padding-bottom: 2em;
}

.wordguesshalfrow {
    flex: 6;
    width: 50%;
    display: flex;
    flex-direction: row;
    gap: 2px;
}

@media screen and (max-width: 480px) {
    .wordguessrow {
        flex-direction: column;
        gap: 2px;
    }

    .wordguesshalfrow {
        width: auto;
    }
}

.wordguess {
    flex: 2;
    width: 33.33%
}

.wordguessel {
    transition: background-color 0.2s ease-in-out;
    font-weight: bold;
    box-sizing: border-box;
    width: 100%;
    height: 1.4em;
    padding: 0 4px 0 4px;
    overflow: hidden;
    white-space: nowrap;
    animation-duration: 4s;
    animation-fill-mode: both;
}

@keyframes fadeOut {
    0% {opacity: 1;}
    100% {opacity: 0;}
}

.inputrow {
    align-items: center;
}

#wordinput {
    flex: auto;
    max-width: 83.33%;
    margin: 0.2em 0 0.2em 0;
    background-color: #111;
    color: #aaa;
    border: 1px solid #fff;
    text-align: center;
    font-size: 2em;
    text-transform: uppercase;
}

#scoredisplay {
    width: 16.67%;
    margin-left: 0.25em;
    font-size: 2.2em;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
}

@media screen and (max-width: 480px) {
    .btnrow {
        flex-direction: column;
    }
}

.mainbtn {
    display: inline-block;
    flex: 1;
    width: 99%;
    appearance: none;
    background-color: #339;
    border: 2px solid #999;
    color: #999;
    font-size: calc(min(1.5em, 4.8vw));
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}

.mainbtn:hover {
    background-color: #44a;
}

.mainbtn:active {
    background-color: #339;
}

.menubtn {
    margin-top: 0.5em;
}

.abtn {
    font-size: 1.5em;
}

#panelguard {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(0 0 0 / 85%);
}

#panelbox1 {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

#panelbox2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: calc(min(100% - 2em, 40em));
}

#panelbox3 {
    max-height: calc(100% - 2em);
}

.panelspacer {
    max-width: auto;
    max-height: auto;
    width: auto;
    height: auto;
    flex: auto;
}

.panel {
    position: relative;
    max-height: calc(100% - 2em);
    overflow-y: auto;
    background-color: #222;
    border: 2px solid #888;
    border-radius: 0.25em;
    padding: 1em;
    box-shadow: 6px 6px #000;
}

.panel p {
    font-size: 1.2em;
    text-align: justify;
}

button.close {
    position: absolute;
    right: 0.2em;
    top: -0.1em;
    appearance: none;
    background: none;
    border: none;
    font-size: 2em;
    color: #888;
    cursor: pointer;
}

button.close:hover {
    color: #aaa;
}

button.close:active {
    color: #fff;
}

#intropanel, #helppanel {
    background: url("/assets/img/limeduck-bg-t.webp"), #222;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.dateinp {
    background-color: #111;
    color: #aaa;
    font-size: 2em;
    margin-top: 1em;
}

.statsbtn {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.85;
    margin: 0.25em;
    color: #999;
    font-weight: bold;
}

.statsbtn:hover {
    opacity: 1;
}

.statsbtn:active {
    opacity: 0.85;
}

.statsimg {
    width: 8em;
    vertical-align: bottom;
}

.sadbox {
    display: none;
}

/* 159vh:
 * The ads are 8em wide at the left and right of the screen.
 * Two ads = 16em, plus 4 for margins = 20em.
 * The main game is 52em, so we can only display ads on the side if the screen
 * is 72em wide. BUT, we redefined our ems to be 2.2vh above. 72*2.2=158.4.
 */
@media screen and (min-width: 159vh) {
    .sadbox {
        display: block;
        position: fixed;
        top: 0;
        bottom: 0;
    }

    #ad1box {
        left: calc(50% - 36em);
        right: calc(50% + 28em);
    }

    #ad2box {
        left: calc(50% + 28em);
        right: calc(50% - 36em);
    }

    .sad {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

.badbox {
    display: none;
}

@media screen and (max-width: 159vh) {
    .badbox {
        display: block;
        position: relative;
        width: 100%;
        height: 8em;
    }

    .bad {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}
