/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

html {
    -webkit-text-size-adjust: 100%;
    line-height: 1.15
}

body {
    margin: 0
}

main {
    display: block
}

h1 {
    font-size: 2em;
    margin: .67em 0
}

hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible
}

pre {
    font-family: monospace, monospace;
    font-size: 1em
}

a {
    background-color: transparent
}

abbr[title] {
    border-bottom: none;
    text-decoration: underline;
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted
}

b,
strong {
    font-weight: bolder
}

code,
kbd,
samp {
    font-family: monospace, monospace;
    font-size: 1em
}

small {
    font-size: 80%
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline
}

sub {
    bottom: -.25em
}

sup {
    top: -.5em
}

img {
    border-style: none
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0
}

button,
input {
    overflow: visible
}

button,
select {
    text-transform: none
}

[type=button],
[type=reset],
[type=submit],
button {
    -webkit-appearance: button
}

[type=button]::-moz-focus-inner,
[type=reset]::-moz-focus-inner,
[type=submit]::-moz-focus-inner,
button::-moz-focus-inner {
    border-style: none;
    padding: 0
}

[type=button]:-moz-focusring,
[type=reset]:-moz-focusring,
[type=submit]:-moz-focusring,
button:-moz-focusring {
    outline: 1px dotted ButtonText
}

fieldset {
    padding: .35em .75em .625em
}

legend {
    box-sizing: border-box;
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal
}

progress {
    vertical-align: baseline
}

textarea {
    overflow: auto
}

[type=checkbox],
[type=radio] {
    box-sizing: border-box;
    padding: 0
}

[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button {
    height: auto
}

[type=search] {
    -webkit-appearance: textfield;
    outline-offset: -2px
}

[type=search]::-webkit-search-decoration {
    -webkit-appearance: none
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit
}

details {
    display: block
}

summary {
    display: list-item
}

[hidden],
template {
    display: none
}

:root {
    --max-size: 720px;
    --kbd-height: min(100em/2.15, 25vh);
    --board-width: min(80em, (100vh - var(--kbd-height) - 12vh - 10vh) * 5/6);
    --letter-size: calc(var(--board-width)/5.5);
    --letter-font: calc(var(--letter-size)/1.75);
    --letter-gap: calc(var(--letter-size)/8)
}

body {
    --colorRight: #3aa394;
    --colorPlace: #d3ad69;
    --colorWrong: #312a2c;
    --colorWrongFG: #504a4b
}

body.high {
    --colorRight: #e36322;
    --colorPlace: #0197f6
}

html {
    background-color: #6e5c62;
    font-size: min(var(--max-size)/100, 100vw/100);
    height: 100%;
    margin: 0 auto;
    max-width: var(--max-size);
    overflow: hidden;
    width: 100%
}

* {
    outline: none;
    touch-action: manipulation
}

body {
    color: #fafaff;
    display: flex;
    flex-direction: column;
    font-family: Mitr, sans-serif;
    height: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 100%
}

body,
h1 {
    font-weight: 600
}

h1 {
    font-size: 4vh;
    line-height: 3vh;
    margin: 0;
    text-align: center;
    text-transform: uppercase
}

a {
    color: #ebe
}

header {
    grid-gap: 0 .5vh;
    box-sizing: border-box;
    display: grid;
    flex-shrink: 0;
    grid-template-columns: 6.5vh 1fr 3vh 3vh;
    height: 6vh;
    max-width: 720px;
    padding: 1.5vh;
    width: 100%
}

header #how {
    color: #b7aeb4;
    font-size: 2vh;
    font-weight: 400;
    text-align: center
}

#config_button,
#prestats_button,
header #how {
    align-items: center;
    background-color: transparent;
    border: 2px solid #b7aeb4;
    border-radius: 20%;
    cursor: pointer;
    display: flex;
    height: 3vh;
    justify-content: center;
    padding: 0;
    width: 3vh;
    z-index: 1000
}

header img {
    height: 3vh;
    width: 3vh
}

#notify {
    flex-shrink: 0;
    height: 6vh
}

#msg,
#notify {
    align-items: center;
    display: flex;
    justify-content: center
}

#msg {
    background-color: #009afe;
    border-radius: 1vh;
    box-sizing: border-box;
    font-size: 2.5vh;
    font-weight: 400;
    height: 5vh;
    margin: 0 auto;
    opacity: 0;
    padding: 0 1.5em;
    z-index: 2000
}

@-webkit-keyframes popup {
    0% {
        opacity: 0;
        transform: scale(0)
    }
    25% {
        opacity: 1
    }
    75% {
        transform: scale(1.15)
    }
    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes popup {
    0% {
        opacity: 0;
        transform: scale(0)
    }
    25% {
        opacity: 1
    }
    75% {
        transform: scale(1.15)
    }
    to {
        opacity: 1;
        transform: scale(1)
    }
}

main {
    align-items: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    flex-shrink: 50;
    justify-content: center;
    margin: 1vh 0;
    overflow: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 100%
}

main::-webkit-scrollbar {
    background-color: transparent;
    width: 12px
}

main::-webkit-scrollbar-thumb {
    background: #625256;
    border-radius: 6px
}

main #board {
    display: grid;
    flex-grow: 0;
    gap: var(--letter-gap) 0;
    max-height: 100%;
    width: var(--board-width)
}

main .row {
    display: grid;
    gap: 0 var(--letter-gap);
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: auto
}

@-webkit-keyframes rownope {
    10% {
        transform: translateX(-14px)
    }
    20% {
        transform: translateX(14px)
    }
    30% {
        transform: translateX(-8px)
    }
    40% {
        transform: translateX(8px)
    }
    50% {
        transform: translateX(-4px)
    }
    60% {
        transform: translateX(4px)
    }
    70% {
        transform: translateX(-2px)
    }
    80% {
        transform: translateX(2px)
    }
    90% {
        transform: translateX(-1px)
    }
    to {
        transform: translateX(1px)
    }
}

@keyframes rownope {
    10% {
        transform: translateX(-14px)
    }
    20% {
        transform: translateX(14px)
    }
    30% {
        transform: translateX(-8px)
    }
    40% {
        transform: translateX(8px)
    }
    50% {
        transform: translateX(-4px)
    }
    60% {
        transform: translateX(4px)
    }
    70% {
        transform: translateX(-2px)
    }
    80% {
        transform: translateX(2px)
    }
    90% {
        transform: translateX(-1px)
    }
    to {
        transform: translateX(1px)
    }
}

main .letter {
    --happy-jump: 55%;
    align-items: center;
    aspect-ratio: 1;
    background-color: #615458;
    border-radius: 10%;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-block;
    display: flex;
    font-size: var(--letter-font);
    justify-content: center;
    text-transform: uppercase
}

@-webkit-keyframes happy {
    10% {
        transform: translateY(calc(var(--happy-jump)*-.3))
    }
    20% {
        transform: translateY(calc(var(--happy-jump)*-.58))
    }
    30% {
        transform: translateY(calc(var(--happy-jump)*-.8))
    }
    40% {
        transform: translateY(calc(var(--happy-jump)*-.95))
    }
    50% {
        transform: translateY(calc(var(--happy-jump)*-1))
    }
    60% {
        transform: translateY(calc(var(--happy-jump)*-.95))
    }
    70% {
        transform: translateY(calc(var(--happy-jump)*-.8))
    }
    80% {
        transform: translateY(calc(var(--happy-jump)*-.58))
    }
    90% {
        transform: translateY(calc(var(--happy-jump)*-.3))
    }
    to {
        transform: translateY(0)
    }
}

@keyframes happy {
    10% {
        transform: translateY(calc(var(--happy-jump)*-.3))
    }
    20% {
        transform: translateY(calc(var(--happy-jump)*-.58))
    }
    30% {
        transform: translateY(calc(var(--happy-jump)*-.8))
    }
    40% {
        transform: translateY(calc(var(--happy-jump)*-.95))
    }
    50% {
        transform: translateY(calc(var(--happy-jump)*-1))
    }
    60% {
        transform: translateY(calc(var(--happy-jump)*-.95))
    }
    70% {
        transform: translateY(calc(var(--happy-jump)*-.8))
    }
    80% {
        transform: translateY(calc(var(--happy-jump)*-.58))
    }
    90% {
        transform: translateY(calc(var(--happy-jump)*-.3))
    }
    to {
        transform: translateY(0)
    }
}

@-webkit-keyframes flip {
    0% {
        background-color: transparent;
        border: 4px solid #4c4347;
        transform: perspective(200px) rotateY(0deg)
    }
    49.99999% {
        background-color: transparent;
        border: 4px solid #4c4347;
        transform: perspective(200px) rotateY(90deg)
    }
    50% {
        background-color: var(--color);
        border: none;
        transform: perspective(200px) rotateY(-90deg)
    }
    50.00001% {
        background-color: var(--color);
        border: none
    }
    to {
        background-color: var(--color);
        transform: perspective(200px) rotateY(0deg)
    }
}

@keyframes flip {
    0% {
        background-color: transparent;
        border: 4px solid #4c4347;
        transform: perspective(200px) rotateY(0deg)
    }
    49.99999% {
        background-color: transparent;
        border: 4px solid #4c4347;
        transform: perspective(200px) rotateY(90deg)
    }
    50% {
        background-color: var(--color);
        border: none;
        transform: perspective(200px) rotateY(-90deg)
    }
    50.00001% {
        background-color: var(--color);
        border: none
    }
    to {
        background-color: var(--color);
        transform: perspective(200px) rotateY(0deg)
    }
}

@-webkit-keyframes type {
    0% {
        color: transparent;
        transform: perspective(200px) translateZ(0)
    }
    24.99999% {
        color: transparent
    }
    25% {
        color: #fafaff;
        transform: perspective(200px) translateZ(30px)
    }
    to {
        color: #fafaff;
        transform: perspective(200px) translateZ(0)
    }
}

@keyframes type {
    0% {
        color: transparent;
        transform: perspective(200px) translateZ(0)
    }
    24.99999% {
        color: transparent
    }
    25% {
        color: #fafaff;
        transform: perspective(200px) translateZ(30px)
    }
    to {
        color: #fafaff;
        transform: perspective(200px) translateZ(0)
    }
}

main .letter.ontype {
    -webkit-animation: type .15s ease-out 0s none;
    animation: type .15s ease-out 0s none
}

main .letter.empty {
    background-color: transparent;
    border: .125em solid #4c4347
}

main .letter.right {
    --color: var(--colorRight)
}

main .letter.place,
main .letter.right {
    -webkit-animation: flip .5s linear 0s forwards;
    animation: flip .5s linear 0s forwards
}

main .letter.place {
    --color: var(--colorPlace)
}

main .letter.wrong {
    --color: var(--colorWrong);
    -webkit-animation: flip .5s linear 0s forwards;
    animation: flip .5s linear 0s forwards
}

main .letter.done {
    background-color: var(--colorRight);
}

#kbd .right {
    background-color: var(--colorRight)!important
}

#kbd .place {
    background-color: var(--colorPlace)
}

#kbd .wrong {
    background-color: var(--colorWrong);
    color: var(--colorWrongFG)
}

#kbd .place,
#kbd .right,
#kbd .wrong {
    transition: background-color .5s ease-in-out, color .5s ease-in-out
}

#kbd {
    grid-gap: 1em 1em;
    box-sizing: border-box;
    display: grid;
    flex-shrink: 0;
    grid-template-columns: repeat(32, 1fr);
    grid-template-rows: repeat(3, 33%);
    height: var(--kbd-height);
    padding: 0em 3em 3em;
    width: 100%;
    margin-top: 10em;
}

#kbd button {
    align-items: center;
    background-color: #4c4347;
    border: none;
    border-radius: 8%;
    color: #fafaff;
    cursor: pointer;
    display: flex;
    font-size: min(4em, calc(var(--kbd-height)/6));
    font-weight: 500;
    grid-column: span 3;
    justify-content: center
}

#kbd #board-a {
    grid-column: 2/span 3
}

#kbd #board-z {
    grid-column: 3/span 3
}

#kbd #board-backspace {
    grid-column: 30/span 3
}

#kbd #board-enter {
    font-size: min(3.6em, calc(var(--kbd-height)/7));
    grid-column: 25/span 8;
    grid-row: span 3 1
}

#modal {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 92vh;
    justify-content: center;
    left: calc((100vw - min(var(--max-size), calc(100vw - 4vh)))/2);
    max-width: var(--max-size);
    pointer-events: none;
    position: absolute;
    top: 6vh;
    width: calc(100vw - 4vh)
}

#config,
#help,
#stats {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(34, 30, 32, .75);
    border-radius: 10px;
    box-sizing: border-box;
    display: none;
    line-height: 5em;
    max-height: 100%;
    overflow: auto;
    pointer-events: auto;
    width: 100%;
    z-index: 1000
}

#config {
    grid-gap: 1em 0;
    align-items: center;
    font-size: 3em;
    font-weight: 300;
    grid-template-columns: 70% 30%;
    grid-template-rows: repeat(auto, 1fr);
    line-height: 1.35em;
    padding: 1.7em 2em;
}

#config p {
    margin-block-start: 0em;
    margin-block-end: 0em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}

#p_menor {
    color: #f2e8c4;
    font-size: 20px;
    font-style: italic;
}

#config div {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
}

#config p i {
    color: #9f9e9e;
    display: block;
    font-size: .75em;
    line-height: 1em;
    margin: 0
}

#config span {
    text-align: right
}

#config .s2 {
    grid-column: 1/span 2
}

#config label {
    cursor: pointer
}

#config_version {
    color: #9f9e9e;
    font-size: .75em;
    font-weight: 300;
    -webkit-user-select: all;
    -moz-user-select: all;
    user-select: all;
}

#help.show,
#stats.show {
    display: block
}

#config.show {
    display: grid
}

#help {
    padding: 5em
}

#helpclose {
    color: #666;
    font-size: 4em;
    font-weight: 300;
    position: absolute;
    right: .5em;
    top: .1em
}

#help h2 {
    font-size: 4em;
    font-weight: 500;
    margin: 0
}

#help p {
    color: #bbb;
    font-size: 3em;
    font-weight: 300;
    line-height: 1.35em
}

#help .example .letter {
    font-size: 3.5em
}

#help .letter {
    align-items: center;
    border: .125em solid #4c4347;
    border-radius: 10%;
    box-sizing: border-box;
    color: #fafaff;
    display: inline-flex;
    font-weight: 500;
    height: 2em;
    justify-content: center;
    margin: 0 .05em;
    width: 2em
}

#help p .letter {
    font-size: 1em;
    height: 1.75em;
    vertical-align: 15%;
    width: 1.75em
}

#help .letter.right {
    background-color: var(--colorRight);
    border: none
}

#help .letter.place {
    background-color: var(--colorPlace);
    border: none
}

#help .letter.wrong {
    background-color: #191516;
    border: none;
    color: #5e5c5c
}

#help p b {
    color: #fafaff;
    font-weight: 500
}

#help p img {
    height: 1.5em;
    margin: 0;
    vertical-align: baseline;
    width: 1.5em
}

#stats {
    padding: 2em 3em 8em;
    pointer-events: auto
}

#stats h2 {
    font-size: 4em;
    font-weight: 500;
    margin: .5em 0 0;
    text-align: center
}

#statstable {
    color: #bbb;
    display: grid;
    font-size: 3em;
    font-weight: 300;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    line-height: 1em;
    padding: 2em 0;
    text-align: center
}

#statstable b {
    color: #fafaff;
    font-size: 2em;
    grid-row: 1;
    padding-bottom: .5em
}

#statstable p {
    align-items: center;
    display: flex;
    grid-row: 2;
    height: 2em;
    justify-content: center;
    margin: 0
}

#histo {
    grid-gap: .2em .1em;
    display: grid;
    font-size: 3em;
    font-weight: 300;
    grid-template-columns: 1.25em 1fr;
    grid-template-rows: repeate(7, 1fr);
    margin: 0 auto 1em;
    width: 85%
}

#histo b {
    font-weight: 500;
    text-align: center
}

#histo span div {
    background-color: #009afe;
    box-sizing: border-box;
    font-weight: 300;
    min-width: 9%;
    padding: 0 .75em;
    text-align: right
}

#histo span div.dark {
    background-color: #4c4347
}

#histo p {
    font-size: .75em;
    grid-column: 1/span 2;
    margin: 0;
    text-align: right
}

#histo p img {
    height: 2em;
    width: 2em
}

#statsnext {
    display: grid;
    font-size: 3em;
    font-weight: 300;
    grid-template-columns: 1fr 1fr;
    margin: 3em auto 1em
}

#statsnext hr {
    background-color: #504a4c;
    border: none;
    height: 100%;
    width: 100%
}

#statsnext div {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center
}

#statsnext div p {
    color: #bbb;
    margin: 0
}

#statsnext div b {
    display: block;
    font-size: 2em;
    margin-top: .3em
}

#statsnext button {
    align-items: center;
    background-color: #009afe;
    border: none;
    border-radius: .25em;
    color: #fafaff;
    cursor: pointer;
    display: flex;
    font-size: 1.25em;
    justify-content: center;
    padding: .75em 1.25em
}

#statsnext button img {
    margin-left: .5em;
    width: 1.25em
}

#loader {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 40px;
    height: 40px;
    margin: -76px 0 0 -76px;
    border: 2px solid #6e5c62;
    border-radius: 50%;
    border-top: 2px solid #9e9e9e;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}

@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* Add animation to "page content" */

.animate-bottom {
    position: relative;
    -webkit-animation-name: animatebottom;
    -webkit-animation-duration: 1s;
    animation-name: animatebottom;
    animation-duration: 1s
}

@-webkit-keyframes animatebottom {
    from {
        bottom: -100px;
        opacity: 0
    }
    to {
        bottom: 0px;
        opacity: 1
    }
}

@keyframes animatebottom {
    from {
        bottom: -100px;
        opacity: 0
    }
    to {
        bottom: 0;
        opacity: 1
    }
}

input[type=checkbox] {
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: 0
}

input.toggle {
    aspect-ratio: 53/32;
    background-color: #312a2d;
    border: .1em solid #fafaff;
    border-radius: 1em;
    display: inline-block;
    height: 1.75em;
    margin: 0;
    position: relative
}

input.toggle:after {
    aspect-ratio: 1;
    background-color: transparent;
    border: .1em solid #fafaff;
    border-radius: 50%;
    content: "";
    height: 1.2em;
    left: .1em;
    position: absolute;
    top: .075em;
    transition: all .5s cubic-bezier(.68, -.55, .265, 1.55)
}

input.toggle:checked:after {
    background-color: #fafaff;
    transform: translatex(1.05em)
}