@font-face {
    font-family: 'Typographica';
    src: url("Typographica-Blp5.ttf");
}

@font-face {
    font-family: 'Nevanta';
    src: url('NevantaExtraBold-9MdV5.otf');
}

:root {
    --primary: #f2e5d5;
    --secondary: #c9b8a7;
    --text-color: #1b1813;
    --selection: #b55bff;
}

.dark-mode {
    --primary: #45362c;
    --secondary: #80735e;
    --text-color: antiquewhite;
}

html {
    transition: 0.5s;
    cursor: default;
    scrollbar-color: transparent transparent;
}

body {
    display: block;
    margin: auto;
    padding: 0px;
    width: 100%;
    height: 100vh;
    font-family: 'Nevanta';
    text-align: justify;
    background-color: var(--primary);
    overflow: scroll;
    color: white;
    align-items: center;
    z-index: 2;
    filter: blur(0px);
    transition: 0.5s;
}

.game {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-content: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 550px;
    max-width: 600px;
    height: 100%;
    margin: auto;
    padding: 0px;
}

.fichier {
    display: none;
}

header {
    position: sticky;
    width: 100%;
    min-width:  400px;
    height: fit-content;
    top: 0px;
    background-color: var(--secondary);
    border-radius: 10px;
    text-align: center;
    z-index: 100;
}

.menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: fit-content;
    font-size: 2vh;
    padding: 0 5px;
    border-radius: 0 0 10px 10px;
    background-color: var(--secondary);
    z-index: 100;
}

.menu .logo {
    width: 8vh;
}

.menu .game_logo {
    color: rgba(0, 0, 0, 0);
    background-image: url("logo.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.menu ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.theme-toggle {
    position: static;
    display: flex;
    align-items: center;
    background-color: transparent;
}

.logo img {
    width: 100%;
    height: auto;
}

.menu a {
    text-decoration: none;
    color: var(--text-color);
    border-radius: 5px;
    font-size: 1.1em;
    padding: 5px 10px;
    transition: 0.2s;
    cursor: pointer;
}

.menu a:hover:not(.logo) {
    background-color: var(--primary);
    color: var(--selection);
    transition: all 0.2s ease;
}

.menu ul li {
    display: inline-block;
    width: fit-content;
}

.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;
    }

}

.rules {
    display: flex;
    position: absolute;
    background-color: rgb(135, 135, 135);
    border-radius: 0px 0px 50px 50px;
    width: 35px;
    height: 35px;
    right: 5px;
    transform: scaleY(1);
    transform-origin: top;
    transition: ease-out 0.2s;
    align-content: center;
    cursor: pointer;
    z-index: 1;
}

.rules:hover {
    height: 55px;
    transform-origin: top;
    transition: ease-out 0.2s;
}

.rules img {
    width: 50%;
    margin: auto;
    padding: 1px;
    transition: 0.2s;
}

.chart {
    display: None;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translatex(-50%);
    background-color: rgba(109, 109, 109, 0.336);
    color: antiquewhite;
    border-radius: 5px;
    width: 90%;
    max-width: 600px;
    margin: auto;
    padding: 10px;
    height: fit-content;
    text-align: justify;
    z-index: 11;
    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;
    backdrop-filter: blur(15px);
}

.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: rgb(141, 141, 141);
    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 {
    background-color: rgb(168, 168, 168);
    transition: 0.2s;
}

.difficulty {
    display: flex;
    width: 100%;
    grid-row: 1;
    grid-column: 1fr 1fr 1fr;
    gap: 25px;
    align-items: center;
    justify-content: center;
}

.toggle_button {
    width: 15%;
    max-width: 50px;
    aspect-ratio: 2/1;
    background-color: antiquewhite;
    padding: 5px;
    border-radius: 50px;
    align-items: center;
    cursor: pointer;
    transform: scale(1);
    transition: 0.25s;
}

.toggle_button:hover {
    transform: scale(1.1);
    transition: 0.25s;
}

.toggle_button .button_dot {
    display: block;
    position: relative;
    left: 0%;
    width: 50%;
    height: 100%;
    background-color: rgb(199, 186, 168);
    border-radius: 50px;
    transition: ease-out 0.25s;
}

.difficulty_cell {
    display: flex;
    position: relative;
    width: 50%;
    height: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.difficulty_cell h3 {
    display: flex;
    grid-template-columns: 1fr 1fr;
}

.explain_button {
    display: flex;
    padding: 2px;
    font-size: 0.5em;
    width: 15px;
    aspect-ratio: 1/1;
}

#s_facile,
#s_difficile {
    display: none;
    position: absolute;
    width: 100%;
    top: 75%;
    height: fit-content;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: 15px;
    padding: 5px;
    text-align: center;
    align-content: center;
    justify-content: center;
}

.difficulty_cell #explain_button1:hover .difficulty_cell #s_facile {
    display: block;
}

.explain_button:hover {
    text-decoration: underline;
}

.grid {
    display: grid;
    position: relative;
    grid-template-rows: repeat(6, 16%);
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 5px;
    margin: auto;
    top: 50px;
    width: 80vw;
    max-width: 350px;
    min-width: 300px;
    aspect-ratio: 5/6;
    color: rgb(255, 255, 255);
    z-index: 1;
}

.grid .ligne {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.grid .cell {
    display: flex;
    background-color: var(--secondary);
    border-radius: 5px;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-family: 'Nevanta';
    border-style: solid;
    border-color: rgb(196, 186, 174);
    border-width: 4px;
}

.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;
    position: relative;
    margin: auto;
    top: 130px;
    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(1.15);
    transition: 0.2s;
}

.keyboard .key:active {
    box-shadow: inset 0px 0px 0px rgb(0, 0, 0, 0);
    transform: translateY(1px);
    transition: 0.1s;
}

.grid .absent {
    background-color: rgba(80, 80, 80, 1);
}

.grid .present {
    background-color: rgba(221, 133, 0, 1);
}

.grid .correct {
    background-color: rgba(15, 129, 0, 1);
}

.keyboard .absent {
    background-color: rgb(80, 80, 80);
}

.keyboard .present {
    background-color: rgb(221, 133, 0);
}

.keyboard .correct {
    background-color: rgb(15, 129, 0);
}
.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 (min-width: 700px) {
    .rules {
        right: 20%;
        width: 45px;
        height: 45px;
    }

    .keyboard .key:hover {
        transform: scale(1);
    }
}

@media screen and (max-width: 1024px) {
    .chart {
        font-size: 3.5vw;
    }

    .banner {
        font-size: 3.5vw;
    }

    .keyboard .key:hover{
        filter: none;
    }

    .keyboard .key:active {
        filter: brightness(1.15);
    }
}

@media only screen and (max-width: 400px) {
    .banner {
        width: 70%;
        font-size: 3vw;
    }
}

*::selection {
    pointer-events: none;
}