@font-face {
    font-family: 'Typographica';
    src: url("Typographica-Blp5.ttf");
}

@font-face {
    font-family: 'Nevanta';
    src: url('NevantaExtraBold-9MdV5.otf');
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --primary: #f2e5d5;
    --secondary: #c9b8a7;
    --text-color: #1b1813;
    --selection: #b55bff;
    --button-color: rgb(165, 154, 140);
}

.dark-mode {
    --primary: #45362c;
    --secondary: #80735e;
    --text-color: antiquewhite;
}

html {
    transition: 0.5s;
    cursor: default;
    scrollbar-color: transparent transparent;
    --correct: rgba(15, 129, 0, 1);
    --present: rgba(221, 133, 0, 1);
    --absent: rgba(80, 80, 80, 1);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

body {
    display: block;
    margin: 0;
    padding: 0px;
    width: 100%;
    height: 100vh;
    font-family: 'Nevanta';
    text-align: justify;
    background-color: var(--primary);
    overflow: scroll;
    color: white;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
    filter: blur(0px);
    transition: 0.5s;
}

.game {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: space-between;
    width: 100%;
    max-width: 550px;
    max-width: 600px;
    height: 80vh;
    margin: auto;
    padding: 0px;
}

header {
    position: sticky;
    width: 100%;
    min-width: 400px;
    max-height: 75px;
    top: 0px;
    padding: 0;
    background-color: var(--secondary);
    border-radius: 10px;
    text-align: center;
    z-index: 5;
}

.menu {
    display: grid;
    width: 100%;
    grid-template-columns: 25% 50% 25%;
    align-items: center;
    padding: 0;
    border-radius: 0 0 10px 10px;
    background-color: var(--secondary);
    z-index: 20;
}

.menu .game_logo {
    color: rgba(0, 0, 0, 0);
    padding: 0;
    background-image: url("logo.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.theme-toggle {
    display: flex;
    margin: auto;
    scale: 0.8;
    align-items: center;
    background-color: transparent;
}

.toggleWrapper {
    display: flex;
    position: relative;
    padding: 5px;
    transform: none;
}

.toggleWrapper .input {
    display: none;
    position: absolute;
}

.toggle {
    cursor: pointer;
    display: inline-block;
    position: relative;
    width: 90px;
    height: 50px;
    background-color: #83d8ff;
    align-content: center;
    justify-content: center;
    border-radius: 84px;
    transition: background-color 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.toggle__handler {
    display: inline-block;
    z-index: 1;
    width: 47%;
    aspect-ratio: 1/1;
    background-color: #ffcf96;
    border-radius: 50px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: absolute;
    left: 3px;
    transform: translateY(-50%) rotate(-45deg);
}

.toggle__handler .crater {
    position: absolute;
    background-color: #e8cda5;
    opacity: 0;
    transition: opacity 200ms ease-in-out;
    border-radius: 100%;
}

.toggle__handler .crater--1 {
    top: 18px;
    left: 10px;
    width: 4px;
    height: 4px;
}

.toggle__handler .crater--2 {
    top: 28px;
    left: 22px;
    width: 6px;
    height: 6px;
}

.toggle__handler .crater--3 {
    top: 10px;
    left: 25px;
    width: 8px;
    height: 8px;
}

.star {
    position: absolute;
    background-color: #fff;
    transition: all 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
    border-radius: 50%;
}

.star--1 {
    top: 10px;
    left: 35px;
    z-index: 0;
    width: 30px;
    height: 3px;
}

.star--2 {
    top: 18px;
    left: 28px;
    z-index: 1;
    width: 30px;
    height: 3px;
}

.star--3 {
    top: 27px;
    left: 40px;
    z-index: 0;
    width: 30px;
    height: 3px;
}

.star--4,
.star--5,
.star--6 {
    opacity: 0;
    transition: all 300ms 0 cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.star--4 {
    top: 16px;
    left: 11px;
    z-index: 0;
    width: 2px;
    height: 2px;
    transform: translate3d(3px, 0, 0);
}

.star--5 {
    top: 32px;
    left: 17px;
    z-index: 0;
    width: 3px;
    height: 3px;
    transform: translate3d(3px, 0, 0);
}

.star--6 {
    top: 36px;
    left: 28px;
    z-index: 0;
    width: 2px;
    height: 2px;
    transform: translate3d(3px, 0, 0);
}

.input:checked+.toggle {
    background-color: #749dd6;
}

.input:checked+.toggle .toggle__handler {
    background-color: #ffe5b5;
    left: calc(50%);
    transform: translateY(-50%) rotate(0);
}

.input:checked+.toggle .toggle__handler .crater {
    opacity: 1;
}

.input:checked+.toggle .star--1 {
    width: 2px;
    height: 2px;
}

.input:checked+.toggle .star--2 {
    width: 4px;
    height: 4px;
    transform: translate3d(-5px, 0, 0);
}

.input:checked+.toggle .star--3 {
    width: 2px;
    height: 2px;
    transform: translate3d(-7px, 0, 0);
}

.input:checked+.toggle .star--4,
.input:checked+.toggle .star--5,
.input:checked+.toggle .star--6 {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.input:checked+.toggle .star--4 {
    transition: all 300ms 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.input:checked+.toggle .star--5 {
    transition: all 300ms 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.input:checked+.toggle .star--6 {
    transition: all 300ms 400ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.theme-toggle {
    transform: scale(1);
    transition: 0.2s ease-out;
}

.theme-toggle:hover {
    transform: scale(1.05);
    transition: 0.2s ease-out;
}

.burger {
    display: none;
    position: absolute;
    right: 10px;

    .hamburger {
        cursor: pointer;
    }

    .hamburger input {
        display: none;
    }

    .hamburger svg {
        /* The size of the SVG defines the overall size */
        height: 3em;
        /* Define the transition for transforming the SVG */
        transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .line {
        fill: none;
        stroke: var(--text-color);
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 3;
        /* Define the transition for transforming the Stroke */
        transition:
            stroke-dasharray 400ms cubic-bezier(0.4, 0, 0.2, 1),
            stroke-dashoffset 400ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .line-top-bottom {
        stroke-dasharray: 12 63;
    }

    .hamburger input:checked+svg {
        transform: rotate(-45deg);
    }

    .hamburger input:checked+svg .line-top-bottom {
        stroke-dasharray: 20 300;
        stroke-dashoffset: -32.42;
    }

}

.menu .about {
    display: flex;
    width: fit-content;
    margin: auto;
    flex-direction: row;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.menu .menuButton {
    display: flex;
    margin: auto;
    background-color: var(--button-color);
    border: solid 2px var(--text-color);
    width: 40px;
    aspect-ratio: 1/1;
    border-radius: 5px;
    transform: scaleY(1);
    transform-origin: top;
    transition: ease-out 0.2s;
    align-content: center;
    cursor: pointer;
    z-index: 1;
}

.menu .menuButton img {
    width: 50%;
    margin: auto;
    padding: 0px;
    transition: 0.2s;
}

.menu .menuButton:hover {
    transform: scale(1.1);
    filter: brightness(1.05);
    transform-origin: center;
    transition: 0.1s;
}

.menu .menuButton:active {
    transform: scale(0.9);
    filter: brightness(0.9);
    transform-origin: center;
    transition: 0.1s;
}

.chart {
    display: None;
    position: absolute;
    top: 150%;
    left: 50%;
    transform: translatex(-50%);
    background-color: rgba(109, 109, 109, 0.336);
    background-color: var(--secondary);
    color: antiquewhite;
    color: var(--text-color);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    margin: auto;
    padding: 15px;
    height: fit-content;
    text-align: justify;
    z-index: 10;
    border-color: antiquewhite;
    border-width: 5px;
    border-style: solid;
    box-shadow: 0px 0px 15px antiquewhite;
    font-size: 1vw;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: 0.5s;
}

.blurbox {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: -10;
}

.chart h1 {
    text-align: center;
    transition: 0.5s
}

.chart h2 {
    text-align: center;
    transition: 0.5s;
}

.chart li {
    padding: 1vh;
    transition: 0.5s;
}

.chart .simple_button {
    display: flex;
    position: absolute;
    width: fit-content;
    height: fit-content;
    padding: 5px;
    top: 10px;
    right: 10px;
    border-radius: 5px;
    background-color: var(--button-color);
    align-content: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.chart .simple_button img {
    width: 15px;
    aspect-ratio: 1/1;
    rotate: 0deg;
    transition: 0.2s;
}

.chart .simple_button:hover img {
    rotate: 90deg;
    transition: 0.2s;
}

.chart .simple_button:hover {
    filter: brightness(1.1);
    transition: 0.2s;
}

.chart .separator {
    display: block;
    height: 2px;
    width: 80%;
    border-radius: 50px;
    background-color: antiquewhite;
    margin: 20px auto 20px auto;
}

.chart a {
    color: var(--text-color);
    text-decoration: none;
}

.chart a:hover {
    filter: brightness(0.8);
}

.row {
    display: flex;
    margin: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

select {
    height: 30px;
    background-color: var(--button-color);
    border: solid 2px var(--text-color);
    border-radius: 7px;
}

.exemple {
    display: inline-block;
    aspect-ratio: 1/1;
    padding: 0 5px;
    background-color: var(--correct);
    border: solid 2px var(--text-color);
    color: antiquewhite;
    border-radius: 5px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#correctex {
    background-color: var(--correct);
}

#presentex {
    background-color: var(--present);
}

#absentex {
    background-color: var(--absent);
}

input[type="checkbox"] {
    display: none
}

#rules_button:checked+#rules_chart {
    display: block;
}

#settings_button:checked+#settings_chart {
    display: block;
}

.chart section {
    text-align: center;
    align-items: center;
    justify-content: center;
    height: fit-content;
}

.downloadButton {
    display: flex;
    width: fit-content;
    margin: auto;
    padding: 7px;
    border-radius: 10px;
    background-color: var(--button-color);
    border: solid 2px var(--text-color);
    filter: none;
    cursor: pointer;
    transform: scale(1);
    transition: 0.2s;
}

.downloadButton:hover {
    filter: brightness(1.1);
    transform: scale(1.1);
    transition: 0.2s;
}

.downloadButton:active {
    filter: brightness(0.9);
    transform: scale(0.9);
}

.switch {
    --_switch-bg-clr: #c9b8a7;
    --_switch-padding: 4px;
    /* padding around button*/
    --_slider-bg-clr: #80735e;
    /* slider color unchecked */
    --_slider-bg-clr-on: #80735e;
    /* slider color checked */
    --_slider-txt-clr: #ffffff;
    --_label-padding: 1rem 2rem;
    /* padding around the labels -  this gives the switch it's global width and height */
    --_switch-easing: cubic-bezier(0.47,
            1.64,
            0.41,
            0.8);
    /* easing on toggle switch */
    color: white;
    width: fit-content;
    margin: auto;
    display: flex;
    justify-content: center;
    position: relative;
    border-radius: 9999px;
    cursor: pointer;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: relative;
    isolation: isolate;
}

.switch input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.switch>span {
    display: grid;
    place-content: center;
    transition: opacity 300ms ease-in-out 150ms;
    padding: var(--_label-padding);
}

.switch::before,
.switch::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    transition: inset 150ms ease-in-out;
}

/* switch slider */
.switch::before {
    background-color: var(--_slider-bg-clr);
    inset: var(--_switch-padding) 50% var(--_switch-padding) var(--_switch-padding);
    transition:
        inset 500ms var(--_switch-easing),
        background-color 500ms ease-in-out;
    z-index: -1;
    box-shadow:
        inset 0 1px 1px rgba(0, 0, 0, 0.3),
        0 1px rgba(255, 255, 255, 0.3);
}

/* switch bg color */
.switch::after {
    background-color: var(--_switch-bg-clr);
    inset: -0.25rem;
    z-index: -2;
}

/* switch hover & focus */
.switch:active::after {
    inset: 0;
    ;
}

.switch:has(input:checked):hover>span:first-of-type,
.switch:has(input:not(:checked)):hover>span:last-of-type {
    opacity: 1;
    transition-delay: 0ms;
    transition-duration: 100ms;
}

/* switch hover */
.switch:has(input:checked):hover::before {
    inset: var(--_switch-padding) var(--_switch-padding) var(--_switch-padding) 45%;
}

.switch:has(input:not(:checked)):hover::before {
    inset: var(--_switch-padding) 45% var(--_switch-padding) var(--_switch-padding);
}

/* checked - move slider to right */
.switch:has(input:checked)::before {
    background-color: var(--_slider-bg-clr-on);
    inset: var(--_switch-padding) var(--_switch-padding) var(--_switch-padding) 50%;
}

/* checked - set opacity */
.switch>span:last-of-type,
.switch>input:checked+span:first-of-type {
    opacity: 0.75;
}

.switch>input:checked~span:last-of-type {
    opacity: 1;
}

.reset_button {
    display: flex;
    margin: 0 auto;
    width: 40%;
    max-width: 150px;
    border-radius: 10px;
    aspect-ratio: 3/1;
    background-color: var(--secondary);
    padding: 15px;
    gap: 10px;
    align-content: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.reset_button img {
    filter: invert();
    margin: auto;
    width: 20px;
    transition: 0.3s;
}

.reset_button p {
    margin: auto;
}

.reset_button:hover {
    scale: 1.05;
    filter: brightness(1.1);
}

.reset_button:active {
    scale: 0.9;
    filter: brightness(0.9);
}

.reset_button:active img {
    transform: rotate(45deg);
    transition: 0.3s;
}

.grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 5px;
    margin: auto;
    width: 98%;
    max-width: 500px;
    min-width: 300px;
    height: fit-content;
    color: rgb(255, 255, 255);
    z-index: 1;
}

.grid .ligne {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 95%;
    margin: auto;
    gap: 3px;
}

.grid .cell {
    --overlay: "";
    display: flex;
    background-color: var(--secondary);
    border-radius: 8%;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1/1;
    font-size: 30px;
    font-family: 'Nevanta';
    border-style: solid;
    border-color: var(--text-color);
    border-width: 2px;
}

.grid .cell::after {
    position: absolute;
    content: var(--overlay);
    opacity: 0.7;
}

.banner {
    display: None;
    position: fixed;
    width: 80%;
    max-width: 450px;
    height: fit-content;
    margin: auto;
    align-self: center;
    background-color: rgba(51, 51, 51, 0.5);
    color: antiquewhite;
    border-radius: 15px;
    text-align: center;
    z-index: 2;
    border-color: antiquewhite;
    border-width: 5px;
    border-style: solid;
    backdrop-filter: blur(15px);
    font-size: 1.5vw;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 25px;
    gap: 25px;
    transition: 0.5s;
}

p {
    text-align: center;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    margin: auto;
    width: 98%;
    max-width: 500px;
    min-width: 300px;
    aspect-ratio: 5/2;
    z-index: 1;
}

.keyboard .key {
    display: flex;
    background-color: var(--secondary);
    border-radius: 5px;
    text-align: center;
    font-size: 24px;
    font-family: 'Nevanta';
    aspect-ratio: 2/3;
    padding: auto;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0px -5px 0px rgb(0, 0, 0, 0.3);
    cursor: pointer;
    user-select: none;
    transform: translateY(0px);
    transition: 0.2s;
}

.keyboard .key:hover {
    filter: brightness(0.85);
    transition: 0.2s;
}

.keyboard .key:active {
    box-shadow: inset 0px 0px 0px rgb(0, 0, 0, 0);
    transform: translateY(2px);
    transition: 0.1s;
}

.grid .absent {
    background-color: var(--absent);
}

.grid .present {
    background-color: var(--present);
}

.grid .correct {
    background-color: var(--correct);
}

.keyboard .absent {
    background-color: var(--absent);
}

.keyboard .present {
    background-color: var(--present);
}

.keyboard .correct {
    background-color: var(--correct);
}

.keyboard .wide_key {
    grid-column: span 2;
    aspect-ratio: 7/5;
}

.keyboard .wide_key img {
    width: 30%;
    pointer-events: none;
}

.button {
    display: inline;
    position: relative;
    aspect-ratio: 1/1;
    width: fit-content;
    max-height: fit-content;
    padding: 10px;
    border-radius: 10px;
    background-color: rgb(141, 141, 141);
    border-style: solid;
    border-color: transparent;
    align-content: center;
    cursor: pointer;
    transition: 0.5s;
}

.button:hover {
    background-color: rgb(168, 168, 168);
    border-style: solid;
    border-color: antiquewhite;
    transition: 0.5s;
}

.button:active {
    background-color: rgb(120, 120, 120);
    border-style: double;
    transition: 0.1s;
}

.close_button {
    display: inline;
    position: absolute;
    width: 25px;
    height: 25px;
    align-content: center;
    cursor: pointer;
    filter: invert();
    transition: 0.5s;
}

.close_button img {
    rotate: 0deg;
    transition: 0.5s;
}

.close_button:hover img {
    rotate: 90deg;
    transform: scale(1.1);
    transition: 0.5s;
}

#close_button2 {
    top: 10px;
    right: 10px;
}

#close_button3 {
    top: 10px;
    right: 10px;
}

.simple_banner {
    display: flex;
    width: fit-content;
    height: fit-content;
    margin: auto;
    align-self: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: 15px;
    align-content: center;
    justify-content: center;
    text-align: center;
    z-index: 50;
    opacity: 0;
    transition: all 0.3s;
}

@media screen and (max-width: 1024px) {

    .menu .menuButton:hover {
        transform: scale(1);
        filter: brightness(1);
        transform-origin: center;
        transition: 0.1s;
    }

    .menu .menuButton:active {
        transform: scale(0.9);
        filter: brightness(0.9);
        transform-origin: center;
        transition: 0.1s;
    }

    .chart {
        font-size: 3.5vw;
    }

    .downloadButton:hover {
        filter: brightness(1);
        transform: scale(1);
        transition: 0.2s;
    }

    /* rules switch hover */
    .switch:has(input:checked):hover::before {
        inset: var(--_switch-padding) var(--_switch-padding) var(--_switch-padding) 50%;
    }

    .switch:has(input:not(:checked)):hover::before {
        inset: var(--_switch-padding) 50% var(--_switch-padding) var(--_switch-padding);
    }

    /* rules switch active */
    .switch:has(input:checked):active::before {
        inset: var(--_switch-padding) var(--_switch-padding) var(--_switch-padding) 45%;
    }

    .switch:has(input:not(:checked)):active::before {
        inset: var(--_switch-padding) 45% var(--_switch-padding) var(--_switch-padding);
    }

    .banner {
        font-size: 3.5vw;
    }

    .keyboard .key:hover {
        filter: none;
    }

    .keyboard .key:active {
        filter: brightness(1.15);
    }

    .menu a:hover {
        scale: 1;
        background-color: rgba(255, 255, 255, 0);
        color: var(--text-color);
        transition: all 0.2s;
    }

    .menu a:active {
        scale: 1.15;
        color: var(--selection);
        transition: all 0.2s;
    }

    .reset_button:hover {
        scale: 1;
        filter: none;
    }

    .reset_button:active {
        scale: 0.9;
        filter: brightness(0.9);
    }

    .reset_button:active img {
        transform: rotate(45deg);
        transition: 0.3s;
    }
}

@media only screen and (max-width: 400px) {
    .banner {
        width: 70%;
        font-size: 3vw;
    }
}

*::selection {
    pointer-events: none;
}

* {
    -webkit-tap-highlight-color: transparent;
}