::-webkit-scrollbar {
    display: none;
}

@font-face {
	font-family: 'base';
	src: url('media/base.woff2') format('woff2');
}

html {
    --cols-num: 3;
    --rows-num: 3;
}


* {
    user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    margin: 0;
    padding: 0;
    font-family: base;
    font-size: 1.25rem;
    box-sizing: border-box;
    letter-spacing: 1px;
}

dialog[open],
button,
input,
label,
summary,
details,
lb > *,
lb > * > *:first-child,
#field,
*[clickable]
{
    pointer-events: auto;
}



html {
	font-size: 100%;
	overflow: hidden;
    touch-action: none;
}

body {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    background: center top / cover url(media/bg.jpg);
    overscroll-behavior-x: contain;
    overscroll-behavior-y: contain;
    /*overflow: visible;*/
    overflow: hidden;
}

body * {
    color: white;
}

h3 {
    font-size: 1.5rem;
}

input:hover {
    cursor: pointer;
}

input[type=checkbox] {
    display: none;
}

input[type=checkbox].std {
    display: inline-block;
    position: relative;
    width: 1rem;
    appearance: none;
    height: 1rem;
    border: 2px solid;
}

input[type=checkbox].std:checked:after {
    content: "";
    display: inline-block;
    position: absolute;
    left: -2px;
    bottom: 2px;
    width: 100%;
    height: 100%;
    border: solid;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}

button {
    z-index: 20;
    padding: 0.25rem 1rem;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

button:hover {
    filter: sepia(1);
}

h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.5rem;
}

hh {
    display: block;
    margin: 0 auto 2rem;
    font-size: 2.5rem;
}


lb {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 9rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
}

lb > * {
    width: 100%;
    padding: 0.25rem 0.5rem;
    text-align: center;
}


lb > button {
    display: inline-block;
    position: relative;
}

lb > button::after {
    content: "\25BC";
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 0 0 0 0.5rem;
    padding: 0;
    font-size: 75%;
    line-height: 200%;
}

lb[opened] > button {
    filter: opacity(0.5);
}

lb > *:nth-child(n+2) {
    display: none;
    flex-direction: column;
    align-items: center;
    margin: 0;
    background: white;
    border: 1px solid grey;
}

lb[size] > *:nth-child(1) {
    display: none;
}

lb[size] > *:nth-child(n+2) {
    display: flex;
    position: relative;
    padding: 0 0.5rem 0;
}

lb[size] > *:nth-child(n+2) > *:first-child {
    width: 10rem;
    padding: 0.25rem 1rem;
}

lb[opened] > *:nth-child(n+2) {
    display: flex;
    position: relative;
}

lb > *:nth-child(n+2) > *:first-child {
    width: 100%;
    padding: 0.25rem 1rem;
}

prop {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0.5rem 0;
}

prop > *:first-child {
    width: 12ch;
    text-align: right;
    margin-right: 1rem;

}

prop > *:first-child + * {
    width: 4rem;
    padding: 0.25rem 1rem;
    text-align: center;
    box-shadow: 0 0 4px 1px black, 0 2px 1px 0 grey, 2px 2px 1px 0 grey;
    border-radius: 0.25rem;
}


/*  DIALOG  */

dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 0;
    right: 0;
    top: 1rem;
    bottom: auto;
    width: fit-content;
    max-width: 100vw;
    max-height: 100vh;
    height: fit-content;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    box-shadow: 0 0 8px 4px white;
    transition: opacity 0.1s ease;
 }

dialog::backdrop {
    background: rgba(255,255,255,0.5);
}

dialog:not([open]) {
    display: none;
}

#msgbox[open] {
    opacity: 0;
    min-width: 30rem;
    max-width: 50rem;
}

#msgbox .btcont {
    margin: 1rem 0 0 0;
}

#msgbox[state="menu"] .btcont {
    flex-direction: column;
}

dialog > h1 {
    margin: 0 auto 2rem;
    font-size: 2rem;
    text-align: center;
}

dialog > <h1 div {
    margin: 1rem auto;
    text-align: center;
}

dialog > h2 {
    font-size: 1.9rem;
    text-align: center;
}

dialog > p {
    margin: 0.5rem 0;
    padding: 0;
    font-size: 1.75rem;
}


dialog > button {
    flex: 1;
    width: fit-content;
    min-width: 10rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    line-height: 1.5rem;
    font-size: 1.5rem;
    color: black;
    text-shadow: 0 1px 1px white;
    border: none;
    box-shadow: inset 0 -1px 4px black;
}

dialog button[close] {
    margin-top: 1.5rem;
}


.backdrop {
    display: none;
}

div#settings {
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    left: 5.5rem;
    top: 2.25rem;
    width: fit-content;
    overflow: visible;
}

dialog#settings {
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: left;
    gap: 0.5rem;
    position: absolute;
    left: 0;
    top: 0rem;
    width: 70ch;
    min-width: 30ch;
    padding: 1rem 1rem 0.5rem 1rem;
    overflow: hidden;
    border: 1px solid grey;
}

dialog#settings:not([open]) {
    display: none;
}

#show_settings {
    appearance: none;
    z-index: 12;
    display: block;
    position: absolute;
    left: 0.75rem;
    top: 0.25rem;
    width: 4rem;
    height: 4rem;
    padding: 0 1rem;
    font-size: 3rem;
    font-weight: bold;
    line-height: 4rem;
    border-radius: 50%;
    background-size: 100% 100%;
}


#show_settings::after {
    content: "";
    position: absolute;
    left: 1.25rem;
    top: 1.5rem;
    width: 1.5rem;
    height: 0.25rem;
    border-top: 0.25rem solid black;
    border-bottom: 0.75rem double black;

}

input[type="checkbox"]#show_settings:not(:checked) + *:not(dialog) {
    display: none;
}


#sound {
    display: none;
}

#sound ~ label {
    z-index: 1;
    position: absolute;
    left: 5rem;
    top: 0;
}

#sound:checked ~ * #sound-off {
    opacity: 0;
}

#sound:not(:checked) ~ * #sound-on {
    opacity: 0;
}

#sound:not(:checked) ~ * #sound-off {
    opacity: 1;
}

#restart {
    z-index: 1;
    position: absolute;
    top: 0.25rem;
    right: 0.75rem;
    width: 4rem;
    height: 4rem;
    padding-left: 1rem;
    font-weight: bold;
    font-size: 3rem;
    border-radius: 50%;
    background-size: 100% 100%;
}

#restart > svg {
    width: 100%;
    height: 100%;
    margin-left: -0.25rem;
    margin-top: -0.25rem;
}

/*  MAIN FIELD  */

#main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    position: absolute;
    left: 0;
    right: 0;
    top: 4.5rem;
    bottom: 0;
    width: auto;
    height: auto;
}

/*
#field {
    display: grid;
    grid-template-columns: repeat(var(--cols-num), 1fr);
    grid-auto-flow: row;
    grid-auto-rows: auto;
    align-content: start;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
}
*/
#field {
    display: grid;
    grid-template-columns: repeat(var(--cols-num), 1fr);
    /*grid-template-rows: repeat(var(--rows-num), 1fr);*/
    /*grid-auto-flow: row;*/
    grid-auto-rows: auto;
    align-content: start;
    justify-content: center;
    gap: 0;
    position: relative;
    width: auto;
    height: 100%;
    max-width: 100%;
    aspect-ratio: var(--cols-num) / var(--rows-num);
    overflow: hidden;
}

#field > * {
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
    text-align: center;
    background-size: 100% 100%;
    transition: transform 0.1s ease;
}

#next {
    z-index: 11;
    position: absolute;
    right: 0;
    bottom: 2rem;
    padding: 0;
    color: yellow;
    line-height: 0;
    font-size: 6rem;
    font-weight: bold;
    text-shadow: 0 0 4px dimgrey, 0 0 8px white;
    text-align: center;
    -webkit-text-stroke: 1px dimgrey;
}

body[state="success"] #next {
    width: 5rem;
    animation: next_success 300ms ease-in-out 1;
}

body:not([state^="success"]) #next,
body[state="success_end"] #next {
    display: none;
}

@keyframes next_success {
    0% {
        filter: blur(4px);
        transform: scale(20);
        pointer-events: none;
    }
}

#score {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 6rem;
    margin: 0 auto;
    padding: 0.25rem 0;
    font-size: 1.5rem;
    text-align: center;
    background-size: 100% 100%;
}

/*
Hey!
You can always change the colors, size, speed and whatever you want.
You can use chat GPT like I did sometimes... ;
I'd love to hear what you think about it!
Jasmine
*/

body[adv] dialog {
    visibility: hidden;
}

body:not([adv]) #spinner {
    display: none;
}

#spinner {
    z-index: 100;
    position: absolute;
    width: 100vw;
    height: 100vh;
    backdrop-filter: brightness(0.025);
    pointer-events: auto;
}

#spinner > * {
    z-index: 111;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 6rem;
    height: 6rem;
    margin: auto;
    overflow: hidden;
}

#spinner > *::before {
    content: "";
    position: absolute;
    width: 80%;
    height: 80%;
    z-index: 1;
    background: url(favicon.png);
    background-size: 100% 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /*background: conic-gradient( rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 255, 255, 1), rgba(0, 0, 255, 1), rgba(127, 0, 255, 1), rgba(255, 0, 0, 1) );
    animation: spin 1.5s linear infinite;*/
}

#spinner > *::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: conic-gradient( rgba(255, 0, 0, 1), rgba(255, 127, 0, 1), rgba(255, 255, 0, 1), rgba(0, 255, 0, 1), rgba(0, 255, 255, 1), rgba(0, 0, 255, 1), rgba(127, 0, 255, 1), rgba(255, 0, 0, 1) );
    /*animation: border-animation 5s linear infinite;
    -webkit-animation: border-animation 5s linear infinite;*/
    animation: spin 1.5s linear infinite;*/
}



@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


/*
 ** max-aspect-ratio: 1/1
 */

@media (max-aspect-ratio: 1/1) {

html {
    font-size: 3cqw;
}

dialog {
    max-width: 100vw;
}

#field {
    width: 100%;
    height: auto;
}


}
