* {
    border-color: transparent;
    border-style: solid;
    border-width: 0;
    box-sizing: border-box;
    transition-delay: 0s!important;
	user-select: none;
	-webkit-user-select: none;
}

:root {
    --pink: #FF0F80;
    --green: #01843E;
    --blue: #0A81D1;
    --gray-0: #000000;
    --gray-1: #151514;
    --gray-3: #464946;
    --gray-4: #636366;
    --gray-5: #8e8e93;
}

:root {
    --green-w: #538d4e;
    --yellow-w: #b59f3b;
    --gray-0-w: #121213;
    --gray-3-w: #1f1f1e;
    --gray-5-w: #3a3a3c;
    --gray-6-w: #818384;
}

:root {
    --body-bg: var(--gray-0);
    --drawer-bg: var(--gray-0);
    /* --drawer-bg: var(--gray-1); */
    --keyboard-bg: #1c1c1e;
    --line-bg: rgb(255 255 255 / 0.1);

    --cell-bc: var(--pink);

    --active-key-c: var(--blue);
    --special-key-c: var(--gray-4);
    --font-c: white;
    --key-c: var(--gray-5);

    --match: var(--green);
    --tentative: var(--pink);
    --wrong: var(--gray-3);
    --loss: #991844;
}

:root {
    --letter-count: 0;
    --cell-border-width: 2px;
    --cell-font-size: 20px;
    --font-family: 'Radio Canada', sans-serif;
    --font-family-special: "Bellota", serif;
}

:root {
    --true-vh: 100vh;
}

html {
    background-color: var(--body-bg);
    color: var(--font-c);
    font-family: var(--font-family);
    height: var(--true-vh);
    transition: background-color 0.5s ease-in-out;
}

.no-transition * {
    transition: 0s ease-in-out!important;
}

.no-transition .match,
.no-transition .tentative,
.no-transition .wrong {
    transition: 0s ease-in-out!important;
}

body {
    display: grid;
    font-family: var(--font-family);
    grid-template-rows: auto 1fr;
    height: 100%;
    margin: 0;
    position: absolute;
    touch-action: pan-y!important;
    width: 100%;
}

header {
    align-items: center;
    display: flex;
    font-family: var(--font-family-special);
    height: 65px;
    justify-content: space-between;
    padding: 40px 40px 0 40px;
    padding-bottom: 0;
}

.header-buttons {
    position: absolute;
}

.header-buttons:first-child {
    left: min(40px, 7%);
}

.header-buttons:last-child {
    right: min(40px, 7%);
}

header h1 {
    line-height: 75%;
    margin: 0;
    transition: 0.5s ease-in-out;
}

main {
    overflow: hidden;
    position: relative;
    width: 100%;
}

/**** Screen Base ****/

.drawer,
.screen {
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    transition: 0.5s ease-in-out;
    width: 100vw;
}

.drawer {
    background-color: var(--drawer-bg);
    height: calc(100% - 40px);
    top: 40px;
    z-index: 500;
}

.screen#game {
    display: grid;
    grid-template-rows: 1fr 300px;
}

.screen#result { transform: translate(100%, 0); }
aside { transform: translate(0, 100%); }

/**** Color Management ****/

.result.win {
    --body-bg: var(--match);
}

.result.loss {
    --body-bg: var(--loss);
}

html.rules,
html.stats,
html.settings {
    background: var(--drawer-bg);
}

/**** Screen Movement ****/

.result #game { transform: translate(-100%, 0); }
.result #result { transform: translate(0, 0); }
.rules #rules { transform: translate(0, 0); }
.settings #settings { transform: translate(0, 0); }
.stats #stats { transform: translate(0, 0); }
.appearance #appearance { transform: translate(0, 0); }
.history #history { transform: translate(0, 0); }

/**** 9/2/22 Update ****/

main {
    transition: 0.5s ease-in-out;
}

.appearance main,
.history main,
.rules main,
.settings main,
.stats main {
    transform: translate(0px, -105px);
}

/**** Animations ****/

#result >  * {
    opacity: 0;
    transform: scale(0);
    transition: 0.5s ease-in-out;
    transition-delay: 0.25s;
}

.result.stats #result >  * {
    opacity: 0;
    transform: scale(0);
    transition: 0.5s ease-in-out;
    transition-delay: 0;
}

.result.settings #result >  * {
    opacity: 0;
    transform: scale(0);
    transition: 0.5s ease-in-out;
    transition-delay: 0;
}

.result #result >  * {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0;
}

/**** Game Grid ****/

#wrapper {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    overflow: hidden;
    padding: 40px;
    width: 100vw;
}

#grid {
	align-self: center;
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(var(--letter-count), 1fr);
    grid-template-rows: repeat(6, 1fr);
    margin: 0 auto;
    transition: 0.5s ease-in-out;
    transition-delay: 0.5s;
    /* transform: translate(0, 100px); */
}

.active #grid {
    transform: translate(0,0);
}

.cell {
    align-items: center;
    border-color: var(--cell-bc);
    border-radius: 8px;
    border-width: var(--cell-border-width);
    color: var(--font-c);
    display: flex;
    font-size: var(--cell-font-size);
    font-weight: 600;
    justify-content: center;
    text-transform: uppercase;
    transition: 0.5s ease-in-out;
}

/**** Attributes ****/

.tentative {
    background-color: var(--tentative)!important;
    border-color: var(--tentative)!important;
    transition: 0.5s ease-in-out!important;
    transition-delay: .25s;
}

.match {
    background-color: var(--match)!important;
    border-color: var(--match)!important;
    transition: 0.5s ease-in-out!important;
    transition-delay: .25s;
}

.wrong {
    background-color: var(--wrong)!important;
    border-color: var(--wrong)!important;
    transition: 0.5s ease-in-out!important;
    transition-delay: .25s;
}

.grow {
    border-width: 3px;
    transform: scale(1.3);
}
.shrink {
    transition: 0.25s ease-in-out;
    transform: scale(0.8);
}

.highlighted {
    border-width: 5px;
    transition: 0.25s ease-in-out;
}

/**** Elements ****/

button {
    background-color: transparent;
    border-color: transparent;
    border-style: solid;
    border-width: 0;
    cursor: pointer;
    padding: 0;
    transition: 0.25s ease-in-out;
}

header button {
    align-items: center;
    display: flex;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    text-align: center;
    transition: 0.5s ease-in-out;
    width: 30px;
}

header button#info {
    border: 2.5px solid var(--font-c);
    border-radius: 100%;
    font-size: 23px;
    font-weight: 700;
}

header button svg {
    flex-shrink: 0;
    height: 25px;
    transition: 0.5s ease-in-out;
    width: 25px;
}

header button svg * {
    transition: 0.5s ease-in-out;
}

header button {
    color: var(--font-c);
    font-size: 30px;
}

.header-buttons {
    display: grid;
    grid-gap: 30px;
    grid-template-columns: 1fr 1fr;
}

/**** Drawer Basics ****/

.drawer-contents {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    margin: 0 auto;
    flex: 1;width: min(500px, 80%);
}

.drawer-header {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    width: min(500px, 80%);
}

.drawer-contents * {
    margin: 0;
}

.drawer-row {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.drawer {
    align-items: center;
    border-radius: 15px 15px 0 0;
    display: flex;
    flex-direction: column;
    font-size: 10px;
    gap: 0;
    justify-content: space-between;
    padding: 40px 0;
}

.drawer p {
    font-size: 1.85em;
}

.drawer h2 {
    font-size: 2.75em;
    margin: 0;
}

.drawer h3 {
    font-size: 2em;
    padding: 0 1em 1em 1em;
    text-align: center;
}

.line-data {
    text-align: center;
}

.game-data {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 1em;
    justify-content: center;
    width: 67%;
}

.game-data p {
    align-items: center;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

button.close-button {
	align-items: center;
	display: flex;
	justify-content: center;
    opacity: 0;
    position: absolute;
    right: 45px;
    top: 45px;
    transition: 0.25s ease-in-out;
    transition-delay: .75s;
    width: 20px;
}

button.close-button svg {
    width: 100%;
}

.appearance #appearance button.close-button,
.stats #stats button.close-button,
.rules #rules button.close-button,
.settings #settings button.close-button,
.history #history button.close-button {
    opacity: 1;
}

button svg * {
    fill: var(--font-c)!important;
    transition: 0.5s ease-in-out;
}

button svg circle {
    fill: var(--body-bg)!important;
}

/**** Appearance Screen *****/

select {
    border-radius: 8px;
    padding: 20px;
}

/**** Result Screen ****/

.screen#result {
	display: grid;
	align-items: center;
	justify-content: center;
}

.result-message > p {
	margin: 0;
}

.result-message {
	display: flex;
	text-align: center;
	flex-direction: column;
	font-size: 30px;
	height: 50%;
	justify-content: space-evenly;
    margin-top: -70px;
}

.result-message > p#opener {
    font-family: var(--font-family-special);
    font-weight: 800;
}

#kicker > :nth-child(n + 2) {
    margin-left: 10px;
}

#kicker span {
	align-items: center;
	background-color: #F7D002;
	border-radius: 8px;
	color: black;
	display: inline-flex;
    font-size: 25px;
	font-weight: 700;
	height: 40px;
	justify-content: center;
    opacity: 0;
	text-transform: uppercase;
    transform: scale(0);
    transition: 0.75s cubic-bezier(0.5, 0, 0.5, 1.5);
	width: 40px
}

.visible {
    opacity: 1!important;
	transform: scale(1)!important;
}

.result-message button {
	background-color: var(--drawer-bg);
	border-radius: 50px;
	border-width: 1px;
	color: var(--font-c);
	font-size: 20px;
    font-weight: 600;
    margin: 0 auto;
	padding: 1em 2.5em;
    transform: scale(0);
    transition: 0.75s cubic-bezier(0.5, 0, 0.5, 1.5);
    width: min(250px, 70%);
}

.button-group {
	display: grid;
	grid-gap: 1em;
	grid-template-columns: 1fr;
}

/**** Stats Drawer ****/

.line-data {
    align-self: end;
	display: grid;
	grid-gap: 10px;
	width: 100%;
}

.line-data > div {
	align-items: center;
	background: var(--line-bg);
	border-radius: 4px;
	display: flex;
    font-weight: 600;
	height: 50px;
}
.line-data > div > span:first-child {
    align-items: center;
    background-color: var(--drawer-bg);
    display: flex;
    flex-shrink: 0;
    font-size: 18px;
    height: 100%;
    width: 40px;
}
.line-data > div > span:nth-child(2) {
    background: gray;
    border-radius: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 50px;
    justify-content: flex-end;
}

.line-data > div > span:last-child {
    align-items: center;
    display: flex;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    padding: 20px;
}

.drawer button.close-button {
    color: var(--font-c);
}

.line-data > div > span:nth-child(2) {
    transform: scale(0, 1);
    transform-origin: left;
    transition: 0.75s ease-in-out;
}

.line-data > div > span:last-child {
    opacity: 0;
    transition: 0.5s ease-in-out .5s;
}

.stats .line-data > div > span:nth-child(2) {
    transform: scale(1, 1);
}

.stats .line-data > div > span:last-child {
    opacity: 1;
}

/**** Rules Screen ****/

.basics {
    align-self: center;
    text-align: center;
}

.basics p {
    line-height: 1.5em;
    margin: 0;
}

.basics > :nth-child(n + 2) {
    margin-top: 1em;
}

.basics,
.examples {
    margin: 0 auto;
    width: 500px;
}

.examples > :last-child {
    margin-bottom: 0;
}

.examples {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}

.example {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 2em;
    justify-content: center;
    text-align: center;
}

.sample-word {
	align-items: center;
	background-color: var(--drawer-bg);
	border-color: var(--cell-bc);
	border-radius: 8px;
	border-style: solid;
	border-width: 2px;
	display: inline-flex;
    font-size: 30px;
    font-weight: 700;
	height: 90px;
	justify-content: center;
	width: 90px;
}

.sample-word > :nth-child(n + 2) {
	margin-left: 10px;
}

/**** Keyboard ****/

#keyboard {
    background-color: var(--keyboard-bg);
	display: grid;
	grid-gap: 5px;
	grid-template-rows: 1fr 1fr 1fr;
    padding: min(12px, 4%) 5px;
    transform: translate(0, 300px);
    transition: 0.5s ease-in-out;
    transition-delay: 0.5s;
	width: 100vw;
}

.active #keyboard {
    transform: translate(0, 0);
}

.row-1,
.row-2,
.row-3 {
	display: flex;
	gap: 5px;
	justify-content: space-between;
	max-width: 100%;
}

.spacer.half {
	flex: .5;
}

#keyboard  > div button svg {
    height: 2rem;
    margin-left: -2px;
}

#keyboard  > div button svg * {
	fill: var(--text-color);
}

button.key {
	align-items: center;
	background-color: var(--key-c);
    border-radius: 8px;
    box-shadow: 0px 1px 0px 0px rgb(0 0 0 / 10%);
	color: var(--font-c);
	display: flex;
    flex: 1;
	font-size: 20px;
    font-weight: 700;
	justify-content: center;
	padding: 0;
    position: relative;
    text-transform: uppercase;
    transition: 0.2s cubic-bezier(0.33, 1.1, 0.3, 1)!important;
    transition-delay: 0s!important;
    z-index: 1;
}

.touched-btn {
    color: transparent!important;

}

button.key.touched-btn {
    box-shadow: 0px -55px 10px 10px #00000085;
}

.key.backspace.touched-btn, .key.enter.touched-btn {
    box-shadow: 0 0 0 0;
}

span.extra {
    align-items: center;
    background-color: var(--key-c);
    border-radius: 10px;
    bottom: calc(100% - 8px);
    color: transparent;
    display: none;
    height: 100%;
    justify-content: center;
    position: absolute;
    transform: scale(1.25);
    transform-origin: bottom;
    width: 100%;
}

button.key.match span.extra {
    background-color: var(--match);
}
button.key.tentative span.extra {
    background-color: var(--tentative);
}
button.key.wrong span.extra {
    background-color: var(--wrong);
}

.touched-btn span.extra {
    color: var(--font-c);
    display: flex;
}

.key.backspace,
.key.enter {
    background-color: var(--special-key-c);
	flex: 1.5;
}

.key.enter.active {
    background-color: var(--active-key-c);
}

button.key.wrong {
    background-color: var(--wrong);
}

/**** Settings Drawer ****/

#settings .drawer-row {
    height: auto;
}

.buttons-pair {
    border-color: var(--font-c);
    border-radius: 50px;
    border-width: 2px;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

section.drawer-row.nav {
    background-color: var(--font-c);
    display: grid;
    grid-gap: 1px;
    justify-content: stretch;
    transition: 0.5s ease-in-out;
}

.settings.btn .appearance svg path {
    fill: var(--drawer-bg)!important;
    transition: 0.5s ease-in-out!important;
    transition-delay: 0s!important;
}

.info.appearance svg {
    max-width: 30px;
}

#settings button.settings.btn {
    align-items: center;
    background-color: var(--drawer-bg);
    border-color: var(--font-c);
    border-radius: 0;
    display: flex;
    font-weight: 500;
    padding: 25px 0;
    position: relative;
    text-align: left;
    transition: 0.5s ease-in-out;
    width: 100%;
}

span.info {
    align-items: center;
    background-color: var(--font-c);
    border-color: var(--font-c);
    border-radius: .25em;
    border-width: 2px;
    color: var(--drawer-bg);
    display: flex;
    font-size: 27px;
    font-weight: 800;
    height: 50px;
    justify-content: center;
    margin-right: 15px;
    transition: 0.5s ease-in-out;
    width: 50px;
}

#settings button.settings.btn > svg {
    position: absolute;
    right: 0;
    transition: 0.5s ease-in-out;
    width: 30px;
}

[name="default-toggle"] {content: 'dark';}

@media (prefers-color-scheme: light) {

    [name="default-toggle"] {content: 'light';}

}

#settings .drawer-row button.reset-btn {font-size: 175%;}

.toggle {
    border-color: var(--font-c);
    border-radius: 50px;
    border-width: 2px;
    display: flex;
    position: relative;
}

.toggle-btn {
    flex: 1;
    transition: 0.5s ease-in-out;
}

.toggle-btn.active {
    color: var(--drawer-bg)!important;
}

.toggle .background-color {
    background-color: var(--font-c);
    border-radius: 50px;
    display: block;
    height: 100%;
    left: 0;
    position: absolute;
    transition: 0.5s ease-in-out;
    width: 50%;
    z-index: -1;
}

.toggle.dark .background-color,
.toggle.default .background-color {
    transform: translate(100%, 0);
}

#settings .drawer-row button {
    border-radius: 50px;
    color: var(--font-c);
    font-size: 25px;
    font-weight: 600;
    padding: .75em 0;
    text-align: center;
}

.light-dark-button-toggles {
    display: grid;
    grid-gap: 1em;
}

/**** Light Mode ****/

/* From Setting */

.classic {
    --body-bg: var(--gray-0-w);
    --keyboard-bg: var(--gray-0-w);
    --drawer-bg: var(--gray-0-w);
    /* --drawer-bg: var(--gray-3-w); */
    --cell-bc: var(--gray-5-w);
    --key-c: var(--gray-6-w);
    --active-key-c: var(--gray-6-w);
    --special-key-c: var(--gray-6-w);
    --wrong: var(--gray-5-w);
    --match: var(--green-w);
    --tentative: var(--yellow-w);
}

.light {
    --body-bg: #fafafa;
    --cell-bc: #f84489;
    --drawer-bg: #fafafa;
    /* --drawer-bg: #ebebeb; */
    --font-c: #333333;
    --keyboard-bg: #ebebeb;
    --key-c: #ffffff;
    --special-key-c: #abb0ba;
    --line-bg: rgb(0 0 0 / 0.1);
    --match: #79e6b0;
    --tentative: #fcb5d0;
    --wrong: #cccccc;
    --loss: #F6CBD9;
}

.dark {
    --body-bg: black;
    --cell-bc: #FF0F80;
    --drawer-bg: black;
    /* --drawer-bg: #151514; */
    --font-c: white;
    --keyboard-bg: #1c1c1e;
    --key-c: #8e8e93;
    --special-key-c: #636366;
    --active-key-c: #0A81D1;
    --line-bg: rgb(255 255 255 / 0.1);
    --match: #01843E;
    --tentative: #FF0F80;
    --wrong: #464946;
    /* --wrong: #353B3C; */
    --loss: #991844;
}

/* From System */

@media (prefers-color-scheme: light) {
    :root {
        --body-bg: #fafafa;
        --cell-bc: #f84489;
        --drawer-bg: #ebebeb;
        --font-c: #333333;
        --keyboard-bg: #ebebeb;
        --key-c: #ffffff;
        --special-key-c: #abb0ba;
        --match: #79e6b0;
        --tentative: #fcb5d0;
        --wrong: #cccccc;
        --loss: #F6CBD9;
    }
    .result-message button {
        background-color: #046c38;
        color: white;
    }
    .light {
        --body-bg: #fafafa;
        --cell-bc: #f84489;
        --drawer-bg: #ebebeb;
        --font-c: #333333;
        --keyboard-bg: #ebebeb;
        --key-c: #ffffff;
        --special-key-c: #abb0ba;
        --line-bg: rgb(0 0 0 / 0.1);
        --match: #79e6b0;
        --tentative: #fcb5d0;
        --wrong: #cccccc;
        --loss: #F6CBD9;
    }

    .dark {
        --body-bg: black;
        --cell-bc: #FF0F80;
        --drawer-bg: #151514;
        --font-c: white;
        --keyboard-bg: #1c1c1e;
        --key-c: #8e8e93;
        --special-key-c: #636366;
        --active-key-c: #0A81D1;
        --line-bg: rgb(255 255 255 / 0.1);
        --match: #01843E;
        --tentative: #FF0F80;
        --wrong: #464946;
        --loss: #991844;
    }

}

.active-input {
	transform: scale(0.85);
}

.appearance {
    align-items: center;
    display: grid;
    grid-gap: 5px;
    width: 100%;
}

.basics p {font-size: 19px; text-align: left;}

.basics {padding: 0 10px;}

#rules .drawer-row:last-child > h3 {padding-left: 10px;align-self: flex-start;}

#rules .drawer-row:last-child {justify-content: flex-end;height: auto;}

#rules .drawer-header {align-items: flex-start;justify-content: flex-start;padding-left: 10px;}

.drawer#rules {padding-top: 75px;}

.drawer#settings {padding-top: 75px;}

#settings .drawer-header {justify-content: flex-start;}

#settings .drawer-row:last-child > h3 {align-self: flex-start;padding-left: 0;}

details {
    background-color: var(--gray-5);
    border-radius: 8px;
    color: var(--font-c);
    font-size: 20px;
    padding: 10px;
    overflow: hidden;
}

details ul {
    display: grid;
    grid-gap: 10px;
    grid-template-columns: 1fr 1fr;
    list-style: none;
    padding: 10px 0 0 0;
}

details li button {
    background-color: var(--bac-4);
    border-radius: 8px;
    color: var(--font-c);
    display: block;
    padding: 20px;
    text-align: left;
    width: 100%;
}

details summary {
    background-color: var(--gray-5);
    cursor: pointer;
    padding: 20px;
}

summary::marker {
    font-size: 0;
}

@media screen and (max-width: 800px) {

    .line-data > div,
    .line-data > div > span:nth-child(2) {
        height: 30px;
    }

    .drawer p {
        font-size: 1.5em;
    }

    .basics p {font-size: 19px;}

    .sample-word {
        height: 65px;
        width: 65px;
    }

    .line-data {
        grid-gap: 5px;
    }

    .line-data > div > span:first-child {
        width: 20px;
    }

    .line-data > div > span:last-child {
        padding: 20px 10px;
    }

    .light-dark-button-toggles {
        align-self: start;
    }

    #settings .drawer-row button {
        font-size: 18px;
    }

    span.info {
        font-size: 18px;
        height: 30px;
        width: 30px;
    }

    #settings button.settings.btn svg {
        width: 20px;
    }

    .basics, .examples {
        width: 100%;
    }

    header {
        padding-left: 0;
        padding-right: 0;
    }

    .header-buttons {
        grid-gap: 15px;
        grid-template-columns: 21px 21px;
        grid-template-rows: 21px;
        width: 50px;
    }

    #grid {
        grid-gap: 5px;
    }

    header button svg {
        width: 50%;
    }

    header button {
        height: 65px;
        padding: 0;
        width: 65px;
    }

    #keyboard > div button svg {
        height: 1rem;
    }

    .screen#game {
        grid-template-rows: 1fr 200px;
    }

    .row-1, .row-2, .row-3 {
        grid-gap: 3px;
    }
}

@media screen and (max-width: 450px) {
    button.key {
        font-size: 15px;
        border-radius: 5px;
    }
}
