/* thanks, coolors.co */
:root {
    --background: #4e7e63;
    --foreground: white;
    --accent: #32513F;
}

html {
    font-size: max(20pt, min(5svw, 3svh));
    /*     font-size: 18pt; */
    background-color: var(--background);
    color: var(--foreground);
    font-family: sans-serif;
    font-size-adjust: none;
    line-height: 1.25rem;
}

::selection {
    color: var(--background);
    background: var(--foreground);
}

main,
footer {
    margin: 0 auto;
    width: max(min(99svw, 30rem), 19rem);
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    text-align: justify;
}

.line {
    display: flex;
    flex-wrap: wrap;
    align-items: first baseline;
    justify-content: space-around;
    column-gap: 1rem;
    row-gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.controls {
    display: flex;
    flex-direction: row;
    align-items: first baseline;
    justify-content: space-between;
    column-gap: 1rem;
}

input {
    display: inline-block;
    background: none;
    box-sizing: border-box;
    outline: none;

    &:focus {
        outline: none;
    }
}

textarea {
    display: inline-block;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 2px solid var(--foreground);
    padding: 0.25rem;
    width: 100%;
    height: 3.2lh;
    background: inherit;
    color: inherit;
    box-sizing: border-box;
    font: 1.0rem monospace;
    letter-spacing: 0.02rem;
    outline: none;
    align-content: last baseline;
    word-break: break-all;

    &:focus {
        outline: none;
    }
}

.button {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-right: 0.25rem;
    text-align: center;
    background: var(--foreground);
    color: var(--background);
    box-shadow: 0pt 6pt var(--accent);
    border: none;

    &:active {
        box-shadow: none;
        transform: translate(0pt, 6pt);
    }

    &:focus {
        color: var(--background);
    }
}

.wide {
    width: 10rem;
}

.slim {
    width: 4rem;
}

.input,
.sprite,
.count,
.image {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: none;
    row-gap: 1rem;
}
.input {
    width: 100%;
    row-gap: 0.25rem;
}

.sprite,
.count,
.image {
    width: 10rem;
}

label,
button,
input[type="submit"] {
    margin-top: none;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    padding-left: 0.5rem;
}

#pixels {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    list-style-type: none;
    width: 100%;
    margin-top: 0;
    padding: 0;
    margin: 0;
}

#pixels li {
    margin: 0;
    line-height: 0;
}

#pixels label {
    display: none;
}

input[type="image"] {
    width: 100%;
    image-rendering: pixelated;
}

/* https://stackoverflow.com/a/56411758 */
#pixels input[type="checkbox"] {
    background-color: #fff;
    border-radius: 1px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    margin: 0;
    cursor: pointer;
    position: relative;
    top: 0;
}

#pixels input[type="checkbox"]:checked {
    background-color: var(--background);
}

.image:hover input[type="image"] {
    opacity: 70%;
}

a {
    color: inherit;
    text-decoration: underline dashed var(--foreground) 1pt;
    border-bottom: none;
}

a:hover {
    opacity: 100%;
    text-decoration: underline solid var(--foreground) 1pt;
}

emph {
    font-weight: bold;
}

footer {
    opacity: 95%;
    font-size: 0.9rem;
    line-height: 125%;
}
footer:hover {
    opacity: 100%;
}
