* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: "Trebuchet MS", Arial, sans-serif;
    background: #8fd9f5;
}

body {
    display: grid;
    place-items: center;
    overflow: hidden;
}


/* =========================================
   CONTENEUR PRINCIPAL DU JEU
   ========================================= */

.game {
    position: relative;

    width: min(
        100vw,
        calc(100vh * 1310 / 1201)
    );

    aspect-ratio: 1310 / 1201;

    overflow: hidden;
}


/* =========================================
   IMAGE DE FOND
   ========================================= */

.bg {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: fill;

    user-select: none;
    pointer-events: none;
}


/* =========================================
   ZONES CLIQUABLES INVISIBLES
   SUR LES PANCARTES DU FOND
   ========================================= */

.zone-pancarte {
    position: absolute;

    z-index: 999999;

    display: block;

    background: transparent;
    border: 0;

    pointer-events: auto;

    cursor: pointer;
}


/* RETOUR AUX JEUX
   Pancarte située à droite */

.zone-retour {
    left: 76%;
    top: 33.5%;

    width: 23%;
    height: 10%;
}


/* FICHE PEDAGOGIQUE
   Pancarte sous Retour aux jeux */

.zone-fiche {
    left: 76%;
    top: 43.5%;

    width: 23%;
    height: 10%;
}


.zone-pancarte:hover,
.zone-pancarte:active,
.zone-pancarte:focus {
    background: transparent;
    outline: none;
}


/* =========================================
   HOTSPOTS
   ========================================= */

.hotspot {
    position: absolute;

    border: 0;

    background: rgba(255, 255, 255, .01);

    color: transparent;

    cursor: pointer;
}


/* Consigne */

.lightbulb {
    left: 22%;
    top: 20.5%;

    width: 5%;
    height: 5.5%;

    z-index: 5;
}


/* =========================================
   BOUTON SON
   ========================================= */

.icon-badge {
    position: absolute;

    z-index: 6;

    border-radius: 50%;
    border: 0;

    cursor: pointer;

    display: grid;
    place-items: center;

    background: rgba(20, 30, 10, .28);

    color: #fff;

    text-shadow: 0 1px 2px #000a;
}

.sound {
    left: 1.5%;
    top: 1.5%;

    width: 6%;
    height: 6%;

    font-size: clamp(
        14px,
        2vw,
        24px
    );
}


/* =========================================
   SCORE
   ========================================= */

.score-box {
    position: absolute;

    z-index: 6;

    left: 78%;
    top: 2.5%;

    width: 20%;

    text-align: center;

    font-weight: 900;

    color: #0a3a5c;

    font-size: clamp(
        14px,
        2vw,
        22px
    );

    background: #fff;

    border-radius: 16px;

    padding: 1.2% 2%;

    box-shadow:
        0 3px 0
        rgba(0, 0, 0, .15);
}

.score-box b {
    color: #d1470f;
}


/* =========================================
   PROGRESSION
   ========================================= */

.steps {
    position: absolute;

    z-index: 9;

    left: 16%;
    top: 26.5%;

    width: 68%;

    display: flex;
    flex-wrap: wrap;

    justify-content: center;

    gap: 1.2%;
}

.step {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    font-weight: 900;
    font-size: 16px;

    color: #6b4a12;

    background:
        rgba(255, 255, 255, .92);

    border:
        3px solid #d69a2b;

    box-shadow:
        0 3px 0
        rgba(0, 0, 0, .15);
}

.step.current {
    background: #ffd23e;

    border-color: #e0a800;

    color: #5a3d00;
}

.step.done {
    background: #8dc63f;

    border-color: #5c9a1f;

    color: #fff;
}


/* =========================================
   OBJETS A COMPTER
   ========================================= */

.objects-zone {
    position: absolute;

    z-index: 2;

    left: 18%;
    top: 33%;

    width: 64%;
    height: 47%;

    display: flex;
    flex-wrap: wrap;

    align-items: center;
    justify-content: center;

    gap: 2%;

    overflow: hidden;
}

.obj {
    width:
        clamp(
            50px,
            9vw,
            110px
        );

    height: auto;

    cursor: pointer;

    transition:
        opacity .15s,
        transform .1s;

    user-select: none;
}

.obj:active {
    transform: scale(.92);
}

.obj.counted {
    opacity: .25;
}


/* =========================================
   REPONSES
   ========================================= */

.answers {
    position: absolute;

    z-index: 7;

    left: 6%;
    top: 85%;

    width: 88%;
    height: 13%;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 1.2%;
}

.answers button {
    position: relative;

    aspect-ratio: 352 / 308;

    border: 0;

    background: none;

    padding: 0;

    cursor: pointer;
}

.answers button img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    filter: none;

    transition: filter .1s;
}

.answers button.selected img {
    filter:
        sepia(1)
        saturate(8)
        hue-rotate(50deg)
        brightness(1);
}

.answers button.correct img {
    filter:
        sepia(1)
        saturate(8)
        hue-rotate(50deg)
        brightness(1);
}

.answers button.wrong img {
    filter:
        sepia(1)
        saturate(8)
        hue-rotate(-58deg)
        brightness(1);
}


/* =========================================
   CHOIX DU NIVEAU
   ========================================= */

.level-picker {
    position: absolute;

    z-index: 8;

    left: 1.5%;
    top: 32%;

    width: 17%;
    height: 48%;

    display: flex;
    flex-direction: column;

    gap: 6%;
}

.level-picker button {
    flex: 1;

    width: 100%;

    border: 0;
    border-radius: 22px;

    background:
        linear-gradient(
            #2a9fd6,
            #1a6f9c
        );

    color: #fff;

    font-weight: 900;

    font-size:
        clamp(
            10px,
            1.4vw,
            15px
        );

    cursor: pointer;

    box-shadow:
        0 3px 0 #114a68;
}

.level-picker button.active {
    background:
        linear-gradient(
            #ffd94d,
            #f5b400
        );

    color: #5a3300;

    box-shadow:
        0 3px 0 #b57e00;
}


/* =========================================
   MESSAGE
   ========================================= */

.message {
    position: absolute;

    z-index: 8;

    left: 15%;
    top: 76%;

    width: 70%;

    text-align: center;

    font-weight: 1000;

    font-size:
        clamp(
            13px,
            2vw,
            22px
        );

    color: #0a3a5c;

    text-shadow:
        0 1px 0 #fff;
}


/* =========================================
   ECRAN DE FIN
   ========================================= */

.end-screen {
    position: absolute;

    z-index: 20;

    inset: 0;

    background:
        rgba(30, 50, 10, .6);

    display: none;

    place-items: center;
}

.end-screen.show {
    display: grid;
}

.end-card {
    width: min(
        420px,
        80%
    );

    padding: 28px;

    text-align: center;

    background: #fffaf0;

    border-radius: 26px;

    border:
        5px solid #f5b400;

    box-shadow:
        0 10px 0
        rgba(0, 0, 0, .15);
}

.trophy {
    font-size: 60px;
}

.end-card h2 {
    font-size:
        clamp(
            20px,
            3.4vw,
            30px
        );

    margin: 6px;

    color: #a4390f;
}

.end-card p {
    font-size: 18px;

    font-weight: 800;

    color: #5a3300;
}

.end-card button {
    margin-top: 10px;

    border: 0;

    border-radius: 16px;

    background:
        linear-gradient(
            #8bd93f,
            #5cb82a
        );

    box-shadow:
        0 5px 0 #3e8515;

    padding:
        12px 30px;

    font-weight: 1000;

    font-size: 18px;

    color: #fff;

    cursor: pointer;
}


/* =========================================
   PETITS ECRANS
   ========================================= */

@media (max-width: 700px) {

    .level-picker {
        width: 19%;
    }

    .level-picker button {
        font-size: 9px;

        padding: 2% 0;
    }
}* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: "Trebuchet MS", Arial, sans-serif;
    background: #8fd9f5;
}

body {
    display: grid;
    place-items: center;
    overflow: hidden;
}


/* =========================================
   CONTENEUR PRINCIPAL DU JEU
   ========================================= */

.game {
    position: relative;

    width: min(
        100vw,
        calc(100vh * 1310 / 1201)
    );

    aspect-ratio: 1310 / 1201;

    overflow: hidden;
}


/* =========================================
   IMAGE DE FOND
   ========================================= */

.bg {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: fill;

    user-select: none;
    pointer-events: none;
}


/* =========================================
   PANCARTES INTEGREES DANS L'IMAGE
   Zones cliquables invisibles
   ========================================= */

.zone-pancarte {
    position: absolute;
    z-index: 999999;

    display: block;

    background: transparent;
    border: 0;

    pointer-events: auto;
    cursor: pointer;
}


/* RETOUR AUX JEUX */

.zone-retour {
    left: 76%;
    top: 33.5%;

    width: 23%;
    height: 10%;
}


/* FICHE PEDAGOGIQUE */

.zone-fiche {
    left: 76%;
    top: 43.5%;

    width: 23%;
    height: 10%;
}


/* Zones invisibles même au survol */

.zone-pancarte:hover,
.zone-pancarte:active,
.zone-pancarte:focus {
    background: transparent;
    outline: none;
}


/* =========================================
   HOTSPOT CONSIGNE
   ========================================= */

.hotspot {
    position: absolute;

    border: 0;

    background: rgba(255,255,255,.01);
    color: transparent;

    cursor: pointer;
}

.lightbulb {
    left: 22%;
    top: 20.5%;

    width: 5%;
    height: 5.5%;

    z-index: 5;
}


/* =========================================
   SON
   ========================================= */

.icon-badge {
    position: absolute;
    z-index: 6;

    border-radius: 50%;
    border: 0;

    cursor: pointer;

    display: grid;
    place-items: center;

    background: rgba(20,30,10,.28);

    color: #fff;

    text-shadow: 0 1px 2px #000a;
}

.sound {
    left: 1.5%;
    top: 1.5%;

    width: 6%;
    height: 6%;

    font-size: clamp(14px,2vw,24px);
}


/* =========================================
   SCORE
   ========================================= */

.score-box {
    position: absolute;
    z-index: 6;

    left: 78%;
    top: 2.5%;

    width: 20%;

    text-align: center;

    font-weight: 900;

    color: #0a3a5c;

    font-size: clamp(14px,2vw,22px);

    background: #fff;

    border-radius: 16px;

    padding: 1.2% 2%;

    box-shadow: 0 3px 0 rgba(0,0,0,.15);
}

.score-box b {
    color: #d1470f;
}


/* =========================================
   PROGRESSION
   ========================================= */

.steps {
    position: absolute;
    z-index: 9;

    left: 16%;
    top: 26.5%;

    width: 68%;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 1.2%;
}

.step {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    font-weight: 900;
    font-size: 16px;

    color: #6b4a12;

    background: rgba(255,255,255,.92);

    border: 3px solid #d69a2b;

    box-shadow: 0 3px 0 rgba(0,0,0,.15);
}

.step.current {
    background: #ffd23e;
    border-color: #e0a800;
    color: #5a3d00;
}

.step.done {
    background: #8dc63f;
    border-color: #5c9a1f;
    color: #fff;
}


/* =========================================
   OBJETS A COMPTER
   ========================================= */

.objects-zone {
    position: absolute;
    z-index: 2;

    left: 18%;
    top: 33%;

    width: 64%;
    height: 47%;

    display: flex;
    flex-wrap: wrap;

    align-items: center;
    justify-content: center;

    gap: 2%;

    overflow: hidden;
}

.obj {
    width: clamp(50px,9vw,110px);
    height: auto;

    cursor: pointer;

    transition:
        opacity .15s,
        transform .1s;

    user-select: none;
}

.obj:active {
    transform: scale(.92);
}

.obj.counted {
    opacity: .25;
}


/* =========================================
   REPONSES
   ========================================= */

.answers {
    position: absolute;
    z-index: 7;

    left: 6%;
    top: 85%;

    width: 88%;
    height: 13%;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 1.2%;
}

.answers button {
    position: relative;

    aspect-ratio: 352 / 308;

    border: 0;

    background: none;

    padding: 0;

    cursor: pointer;
}

.answers button img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    filter: none;

    transition: filter .1s;
}

.answers button.selected img {
    filter:
        sepia(1)
        saturate(8)
        hue-rotate(50deg)
        brightness(1);
}

.answers button.correct img {
    filter:
        sepia(1)
        saturate(8)
        hue-rotate(50deg)
        brightness(1);
}

.answers button.wrong img {
    filter:
        sepia(1)
        saturate(8)
        hue-rotate(-58deg)
        brightness(1);
}


/* =========================================
   CHOIX DU NIVEAU
   ========================================= */

.level-picker {
    position: absolute;
    z-index: 8;

    left: 1.5%;
    top: 32%;

    width: 17%;
    height: 48%;

    display: flex;
    flex-direction: column;

    gap: 6%;
}

.level-picker button {
    flex: 1;

    width: 100%;

    border: 0;
    border-radius: 22px;

    background:
        linear-gradient(
            #2a9fd6,
            #1a6f9c
        );

    color: #fff;

    font-weight: 900;

    font-size: clamp(10px,1.4vw,15px);

    cursor: pointer;

    box-shadow: 0 3px 0 #114a68;
}

.level-picker button.active {
    background:
        linear-gradient(
            #ffd94d,
            #f5b400
        );

    color: #5a3300;

    box-shadow: 0 3px 0 #b57e00;
}


/* =========================================
   MESSAGE
   ========================================= */

.message {
    position: absolute;
    z-index: 8;

    left: 15%;
    top: 76%;

    width: 70%;

    text-align: center;

    font-weight: 1000;

    font-size: clamp(13px,2vw,22px);

    color: #0a3a5c;

    text-shadow: 0 1px 0 #fff;
}


/* =========================================
   ECRAN DE FIN
   ========================================= */

.end-screen {
    position: absolute;
    z-index: 20;

    inset: 0;

    background: rgba(30,50,10,.6);

    display: none;

    place-items: center;
}

.end-screen.show {
    display: grid;
}

.end-card {
    width: min(420px,80%);

    padding: 28px;

    text-align: center;

    background: #fffaf0;

    border-radius: 26px;

    border: 5px solid #f5b400;

    box-shadow: 0 10px 0 rgba(0,0,0,.15);
}

.trophy {
    font-size: 60px;
}

.end-card h2 {
    font-size: clamp(20px,3.4vw,30px);

    margin: 6px;

    color: #a4390f;
}

.end-card p {
    font-size: 18px;

    font-weight: 800;

    color: #5a3300;
}

.end-card button {
    margin-top: 10px;

    border: 0;
    border-radius: 16px;

    background:
        linear-gradient(
            #8bd93f,
            #5cb82a
        );

    box-shadow: 0 5px 0 #3e8515;

    padding: 12px 30px;

    font-weight: 1000;
    font-size: 18px;

    color: #fff;

    cursor: pointer;
}


/* =========================================
   PETITS ECRANS
   ========================================= */

@media (max-width:700px) {

    .level-picker {
        width: 19%;
    }

    .level-picker button {
        font-size: 9px;
        padding: 2% 0;
    }
}