:root {
    --red: hsla(352, 97%, 45%, 1);
    --brown: hsla(35, 34%, 30%, 1);
    --lightbrown: hsla(27, 29%, 49%, 1);
    --lighterbrown: hsla(37.71, 51.72% 60.2%, 1);
    --error-color: hsla(14, 94.89%, 46.08%, 1);

    --main-height: 60vh;

    --wheel-spinning-time: 1.25s;
}

/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

#root, #__next {
  isolation: isolate;
}

/* End reset */

/* Base */

html body {
    background-color: var(--red);
    font-family: arial, helvetica, sans-serif;
}

header,
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
}

header {
    height: calc(((100vh - var(--main-height)) / 2) * 7 / 8 - 3px);
}

header img,
footer img {
    max-width: 90vw;
    width: auto;
    max-height: 100%;
    margin-left: 5vw;
    margin-right: 5vw;
}

main {
    position: relative;
    background-image: url("../images/bg-mobile-975a59ced66c400bcc4b7187097e0d02.webp");
    height: var(--main-height);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: bottom;
    overflow: hidden;
    text-align: center;
}

main:after {
    content: '';
    position: absolute;
    bottom: .5rem;
    left: 1rem;
    display: block;
    width: 7.5rem;
    height: .5rem;
    background-image: url("../images/copyright-201b05485e77b784d828d3b6c43fa101.webp");
    background-size: contain;
    background-repeat: no-repeat;
}

footer {
    height: calc(((100vh - var(--main-height)) / 2) * 8 / 7);
}

footer img {
    width: auto;
    margin: 0 auto;
}

main:has(.contact-form) {
    background-image: url("../images/bg-mobile-nochar-6bcd94c4c4f44285efedef9b797984f8.webp");
}

h1,
h3 {
    font-size: 2.5rem;
    line-height: 2rem;
}

h2 {
    font-size: 1.75rem;
    line-height: 1.5rem;
}

h3 {
    margin-bottom: 1rem;
}

a {
    color: var(--brown);
}

.desktop-only {
    display: none;
}

.cta {
    display: inline-block;
}

.cta img {
    width: 100%;
}

.is-font-uderzo {
    font-family: 'UderzoTiTR';
    color: black;
}

.is-small {
    font-size: .75rem;
}

/* Roue */

.group-roue img {
    position: absolute;
    left: 50%;
    bottom: -2%;
    height: 90%;
    transform: translateX(-50%) rotate(0deg);
}

.group-roue .roue {
    animation: wheelSpin var(--wheel-spinning-time) linear infinite;
    bottom: 27.5%;
    height: 58.5%;
}

.group-roue .fleche-roue {
    /* animation: pinSpin calc(var(--wheel-spinning-time) / 12) linear infinite; */
    bottom: 0;
    bottom: 76%;
    height: 10%;
    /* transform: translateX(-50%) rotate(-50deg); */
    transform: translateX(-50%);
    transform-origin: top center;
}

.group-roue .roue.lost {
    animation: wheelSpinToLose calc(var(--wheel-spinning-time) * 5) ease-out forwards;
}

.group-roue .roue.won {
    animation: wheelSpinToWin calc(var(--wheel-spinning-time) * 5) ease-out forwards;
}
/* 
.group-roue .fleche-roue.perdu {
    animation: pinSpinToLose calc(var(--wheel-spinning-time) * 5) ease-out forwards;
} */

@keyframes wheelSpin {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes pinSpin {
    0% { transform: translateX(-50%) rotate(-50deg); }
    75% { transform: translateX(-50%) rotate(10deg); }
    100% { transform: translateX(-50%) rotate(-50deg); }
}

@keyframes wheelSpinToLose {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(1140deg); }
}

@keyframes wheelSpinToWin {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(1080deg); }
}

/* Fin roue */

/* Perdu */
.has-panneau-s {
    position: relative;
    top: 14%;
    width: 94vw;
    height: 50%;
    max-width: 42vh;
    margin: 0 auto;
}

.has-panneau-s > picture img,
.has-panneau-l > picture img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    margin: 0 auto;
}

.has-panneau-s-content {
    position: relative;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 4vw;
}

.cta-edbm {
    width: 37vw;
    max-width: 16vh;
}

.group-perdu .has-panneau-s-content {
    padding-bottom: 1vw;
}

/* Fin perdu */

/* Gagné */

.has-panneau-s.group-gagne {
    width: 96vw;
    height: 50%;
}

.group-gagne-content {
    padding-bottom: 5vw;
}

.has-panneau-s.group-gagne > img {
    width: 100%;
    position: absolute;
}

.cta-gagne {
    width: 30vw;
    min-width: 24vh;
}

/* TABLET */

@media screen and (min-width: 48rem) and (max-width: 63.999rem) and (orientation: portrait) {
    
    .has-panneau-s.group-gagne {
        width: 68vw;
    }

    .has-panneau-s-content.group-gagne-content {
        padding-bottom: 6vw;
    }

}

/* DESKTOP */

@media screen and (min-width: 64rem) {
    
    .has-panneau-s.group-gagne {
        height: 81%;
    }

    .group-gagne .has-panneau-s-content:is(#hey, div) {
        top: 22vw;
    }

    .cta-gagne {
        min-width: unset;
        width: 15vw;
    }

}

/* Fin gagné */

/* Jouer */

.has-panneau-s.group-jouer {
    width: 94vw;
}

.has-panneau-s.group-jouer > img {
    width: 100%;
    position: absolute;
}

.group-jouer-content {
    padding-bottom: 10vw;
}

.cta-jouer {
    width: 45vw;
}

.cta-jouer img {
    width: 100%;
}

/* TABLET */

@media screen and (min-width: 48rem) and (max-width: 63.999rem) and (orientation: portrait) {

    .has-panneau-s.group-jouer {
        width: 70vw;
    }

    .has-panneau-s-content.group-jouer-content {
        padding-bottom: 8vw;
    }
}

@media screen and (min-width: 64rem) and (orientation: portrait) {

    .has-panneau-s.group-gagne:is(#hey, div) {
        bottom: 33.25vw;
        width: 41vw;
    }

}

/* DESKTOP */

@media screen and (min-width: 64rem) {

    .has-panneau-s:is(#hey, div) {
        position: absolute;
        top: unset;
        bottom: 29.25vw;
        left: 50%;
        height: auto;
        max-width: unset;
        width: 36vw;
        transform: translateX(-50%);
    }

    .has-panneau-s-content:is(#hey, div) {
        position: absolute;
        top: 21vw;
        bottom: unset;
        left: 50%;
        transform: translateX(-50%);
        padding-bottom: 0;
    }

    .has-panneau-s:is(#hey, div) > picture  {
        position: absolute;
        width: 100%;
    }

    .has-panneau-s:is(#hey, div) > picture img  {
        position: static;
        width: 100%;
    }

    .has-panneau-s.group-jouer {
        width: 33vw;
        height: 52%;
    }

    .has-panneau-s-content.group-jouer-content {
        padding-bottom: 5vw;
    }

    .cta-jouer {
        width: unset;
    }

}

/* Fin Jouer */

/* Form */

.cta-sinscrire {
    width: 40vw;
    margin-top: 1rem;
}

main:has(.group-form) {
    background-image: url("../images/bg-mobile-nochar-6bcd94c4c4f44285efedef9b797984f8.webp");
}

.has-panneau-l {
    position: relative;
    top: 3%;
    width: 96vw;
    height: 94%;
    max-width: 42vh;
    margin: 0 auto;
}

.has-panneau-l-content {
    position: relative;
    height: 90%;
    top: 4.5%;
    left: 6%;
    overflow-y: auto;
    overflow-x: hidden;
    width: 88%;
    padding: .5rem;
}

.has-panneau-l-content::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 0 .125rem hsl(37, 52.7%, 60.2%);
    background-color: hsl(35.2, 38.7%, 32%);
    border-radius: .625rem;
}

.has-panneau-l-content::-webkit-scrollbar {
	width: .625rem;
	background-color: hsl(37, 52.7%, 60.2%);
}

.has-panneau-l-content::-webkit-scrollbar-thumb {
	border-radius: .625rem;
	background-color: hsl(29.3, 33.1%, 51.4%);
    -webkit-box-shadow: inset 0 0 .125rem hsla(35.2, 38.7%, 32%, .5),  inset 0 0 .25rem hsla(35.2, 38.7%, 32%, .25);
    cursor: grab;
}

form {
    margin: 1.25rem 0;
}

fieldset {
    border: none;
    padding: 0;
}

fieldset > div {
    display: grid;
    grid-template-columns: 40% 60%;
    align-items: center;
    margin-bottom: .75rem;
}

label {
    text-align: right;
    padding-right: .5rem;
    line-height: 1rem;
    font-size: .9rem;
}

form input,
form button {
    background: none;
    border: none;
}

fieldset input,
fieldset textarea {
    width: calc((((80vw * .85) - (.5rem * 2)) * .6) - .625rem);
    max-width: 100%;
    background-color: wheat;
    border: 2px solid var(--brown);
    border-radius: .25rem;
}

input[type=checkbox],
input[type=radio] {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0;
    border: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.checkbox + .checkbox {
    margin-top: 20px;
}

/* input[type=checkbox] ~ label:before,
input[type=radio] ~ label:before {
    box-shadow: inset 0 0 0 .125rem var(--text-color);
} */

input[type=checkbox]:focus ~ label:before,
input[type=radio]:focus ~ label:before {
    box-shadow: 0 0 0 .063rem hsla(0, 0%, 100%, .5), 0 0 0 .125rem hsla(0, 0%, 100%, .25),  inset 0 0 0 .063rem hsla(358, 41.3%, 28%, .5), inset 0 0 0 .125rem hsla(358, 41.3%, 28%, .25);
}

input[type=checkbox]:focus ~ label,
input[type=radio]:focus ~ label {
    text-decoration: underline;
}

input[type=checkbox] ~ label,
input[type=radio] ~ label {
    user-select: none;
}

input[type=checkbox]:checked ~ label:after,
input[type=radio]:checked ~ label:after {
    opacity: 1;
}

input[type=checkbox] + label,
input[type=radio] + label {
    position: relative;
    display: flex;
    margin-left: 1rem;
    gap: .625rem;
    align-items: center;
    font-size: .75rem;
    line-height: .938rem;
    padding-right: 0;
    cursor: pointer;
    text-align: left;
}

input[type=checkbox] + label:before,
input[type=radio] + label:before {
    content: '';
    position: relative;
    z-index: 1;
    display: block;
    box-sizing: border-box;
    width: 1.25rem;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 1.25rem;
    border: .125rem solid var(--brown);
    transition: box-shadow var(--transition-time);
    box-shadow: inset 0 0 0 .063rem var(--lightbrown);
}

input[type=checkbox] + label:after,
input[type=radio] + label:after {
    content: '';
    position: absolute;
    z-index: 0;
    display: block;
    box-sizing: border-box;
    width: 1.2rem;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 1.25rem;
    background: wheat;
    opacity: 0;
    transition: opacity var(--transition-time);
}

.error-msgs {
    display: none;
    margin-top: .75rem;
}

/* Client side validation */

.error-msgs {
    border: .125rem solid var(--error-color);
    margin-left: 5%;
    padding: .3rem .5rem;
    border-radius: .25rem;
    background-color: wheat;
}

.error-msgs,
.error-msgs p {
    display: none;
}

.error-msgs p {
    width: 100%;
    color: var(--error-color);
    font-weight: 400;
    font-size: .75rem;
    line-height: .85rem;
    text-align: left;
}

.error-msgs p + p {
    margin-top: 0.15rem;
}

input:not([type="checkbox"]):not([type="date"]):invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--error-color);
}

div:has( > input:not([type="checkbox"]):not([type="date"]):invalid:not(:placeholder-shown):not(:focus)) label {
    color: var(--error-color);
}

form:has(input:required:not([type="checkbox"]):not([type="date"]):invalid:not(:placeholder-shown):not(:focus)) .error-msgs,
form:has(input#form_lastname:invalid:not(:placeholder-shown):not(:focus)) p[data-error="lastname"],
form:has(input#form_firstname:invalid:not(:placeholder-shown):not(:focus)) p[data-error="firstname"],
form:has(input#form_zipcode:invalid:not(:placeholder-shown):not(:focus)) p[data-error="zipcode"],
form:has(input#form_email:invalid:not(:placeholder-shown):not(:focus)) p[data-error="email"],
form:has(input#form_phone:invalid:not(:placeholder-shown):not(:focus)) p[data-error="phone"] {
    display: block;
}

/* End Client side validation */

/* TABLET */

@media screen and (min-width: 48rem) and (max-width: 63.999rem) and (orientation: portrait) {

    header {
        height: calc((100vh - 100vw) * 293 / 544);
    }

    main {
        height: 100vw;
    }

    footer {
        height: calc((100vh - 100vw) * 251 / 544);
    }

    /* ROUE */

    .group-roue .roue {
        height: 59%;
        bottom: 27%;
    }

    .group-roue .fleche-roue {
        height: 11%;
        bottom: 75.5%;
    }

    /* PANNEAU S */

    .has-panneau-s {
        top: 14.5%;
        max-width: unset;
    }

    /* GAGNE */

    .cta-gagne {
        width: 38vw;
    }

    .cta-gagne img {
        width: 100%;
    }

    /* PERDU */

    .group-perdu .has-panneau-s-content {
        padding-bottom: 4vw;
    }

    .cta-edbm img {
        width: 100%;
    }

    /* FORM */

    fieldset > div {
        grid-template-columns: 36% 64%;
    }
}

/* Desktop */

@media screen and (min-width: 64rem) {

    /* BASE */

    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }

    main {
        background-image: url("../images/bg-03d37a968673d4d0bae8ca9d478b737e.webp");
    }

    /* HEADER */

    header img {
        max-height: 100%;
    }

    main:has(.contact-form) {
        background-image: url("../images/bg-nochar-ee41913abbba8e33bb4e36d098b21e3b.webp");
    }
    
    .group-roue .roue {
        bottom: 4.5vw;
        height: initial;
        width: calc(474 / 1920 * 100vw);
    }
    
    .group-roue .fleche-roue {
        bottom: 25.5vw;
        width: calc(68 / 1920 * 100vw);
        height: initial;
    }

    .has-panneau-s {
        top: 39%;
        height: 76%;
        width: unset;
        max-width: 49vh;
    }

    /* PERDU */

    .group-perdu .has-panneau-s-content,
    .group-gagne .has-panneau-s-content {
        padding-bottom: 2%;
    }

    .group-perdu .has-panneau-s-content:is(#hey, div) {
        top: 22vw;
    }

    .cta-edbm {
        width: 11vw;
        max-width: unset;
    }

    /* FORM */

    main:has(.group-form) {
        background-image: url("../images/bg-03d37a968673d4d0bae8ca9d478b737e.webp");
    }

    .has-panneau-l {
        width: 28vw;
        max-width: unset;
    }

    .has-panneau-l-content {
        width: 25vw;
        left: 50%;
        transform: translateX(-50%);
    }

    fieldset input,
    fieldset textarea {
        width: 100%;
    }

    .cta-sinscrire {
        width: auto;
        cursor: pointer;
    }
}

/* DATEPICKER */
.the-datepicker__deselect-button:is(a, #hey) {
    color: var(--brown);
}

.the-datepicker__main:is(div, #hey) {
    background-color: wheat;
    border: .125rem solid var(--brown);
    transform: translateX(.313rem);
}

.the-datepicker__main a.the-datepicker__button:is(span, #hey),
.the-datepicker__main a.the-datepicker__button:is(a, #hey) {
    color: var(--brown);
}

.the-datepicker__main td.the-datepicker__cell--selected a.the-datepicker__button .the-datepicker__button-content:is(span, #hey),
.the-datepicker__main td.the-datepicker__cell--selected.the-datepicker__cell--highlighted a.the-datepicker__button .the-datepicker__button-content:is(span, #hey) {
    background-color: burlywood;
}

.the-datepicker__main select.the-datepicker__select:is(select, #hey) {
    background-color: burlywood;
    border: .125rem solid var(--brown);
}

.the-datepicker__main td.the-datepicker__cell a.the-datepicker__button:hover .the-datepicker__button-content:is(span, #hey) {
    background-color: antiquewhite;
}

@media (min-aspect-ratio: 1920/950) {

    main {
        background-image: url("../images/bg-notop-3a0468adf508a241a95ce6f3174af15f.webp");
    }

    .has-panneau-s:is(#hey, div) {
        bottom: 26vw;
    }

    .group-roue .roue {
        bottom: 2.5vw;
    }
    
    .group-roue .fleche-roue {
        bottom: 23.5vw;
    }
}

/* LEGAL */

main:has( > .legal) {
    background: white;
}

main:has( > .legal):after {
    content: none;
}

footer .menu-legal {
    display: flex;
    justify-content: center;
    gap: .5rem;
    position: absolute;
    bottom: .75rem;
    left: 0.75rem;
    right: .75rem;
}

footer .menu-legal a {
    font-size: .5rem;
    text-decoration: underline;
    color: black;
}

.legal {
    background-color: hsla(27, 29%, 49%, .25);
    position: relative;
    z-index: 10;
    max-height: 100%;
    overflow-y: auto;
}

.legal::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 0 .125rem hsl(37, 52.7%, 60.2%);
    background-color: hsl(35.2, 38.7%, 32%);
    border-radius: .625rem;
}

.legal::-webkit-scrollbar {
	width: .625rem;
	background-color: hsl(37, 52.7%, 60.2%);
}

.legal::-webkit-scrollbar-thumb {
	border-radius: .625rem;
	background-color: hsl(29.3, 33.1%, 51.4%);
    -webkit-box-shadow: inset 0 0 .125rem hsla(35.2, 38.7%, 32%, .5),  inset 0 0 .25rem hsla(35.2, 38.7%, 32%, .25);
    cursor: grab;
}

.legal a,
.legal a:not([href]):not([class]) {
    color: var(--brown);
    text-decoration: underline;
}

.legal a:hover {
    color: var(--lightbrown);
}

@media screen and (min-width: 64rem) {

    footer .menu-legal {
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-end;
        gap: 0;
    }
}