* {
    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
   ========================================= */

.game {
    position: relative;
    width: min(100vw, calc(100vh * 1341 / 1173));
    aspect-ratio: 1341 / 1173;
    overflow: hidden;
}


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

.bg {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: fill;

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


/* =========================================
   PANNEAUX 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: 0;
    top: 0;

    width: 23%;
    height: 12%;
}


/* FICHE PEDAGOGIQUE */

.zone-fiche {
    right: 0;
    top: 0;

    width: 23%;
    height: 12%;
}


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


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

.hotspot {
    position: absolute;

    border: 0;

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

    cursor: pointer;
}

.lightbulb {
    left: 21%;
    top: 19.5%;

    width: 5.5%;
    height: 6.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: 64%;
    top: 74.5%;

    width: 20%;

    text-align: center;

    font-weight: 900;

    color: #6b4a12;

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

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

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


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

.steps {
    position: absolute;

    z-index: 9;

    left: 16%;
    top: 26%;

    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: 32%;

    width: 64%;
    height: 44%;

    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: 15%;
    top: 80%;

    width: 70%;
    height: 16%;

    display: flex;

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

    gap: 2%;
}

.answers button {
    position: relative;

    width: 17%;

    aspect-ratio: 100 / 89;

    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:
        hue-rotate(78deg)
        saturate(1.3)
        brightness(1.02);
}

.answers button.correct img {
    filter:
        hue-rotate(78deg)
        saturate(1.3)
        brightness(1.05);
}

.answers button.wrong img {
    filter:
        hue-rotate(-38deg)
        saturate(1.6)
        brightness(.98);
}


/* =========================================
   NIVEAUX
   ========================================= */

.level-picker {
    position: absolute;

    z-index: 8;

    left: 1.5%;
    top: 31%;

    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(
            #5a9c2f,
            #3f7a1c
        );

    color: #fff;

    font-weight: 900;

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

    cursor: pointer;

    box-shadow: 0 3px 0 #2c5a11;
}

.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: 70.5%;

    width: 70%;

    text-align: center;

    font-weight: 1000;

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

    color: #a4390f;

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


/* =========================================
   MOBILE
   ========================================= */

@media (max-width:700px) {

    .level-picker {
        width: 19%;
    }

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