:root {
    --cellSizePx: 40px;
    --cellSize: 40;
    --cellNbX: 30;
    --cellNbY: 30;
    --clicSizePx: 38px;
    --pointSizePx: 30px;
    --menuColorR: 74;
    --menuColorG: 72;
    --menuColorB: 91;
    --animSpeedPoint: .5s;
    --animSpeedLine: 2s;
}

/* Désactiver la sélection de texte */
* {
    -webkit-touch-callout: none;
    -webkit-user-callout: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-user-modify: none;
    -webkit-highlight: none;
    user-select: none;
}

body, html {
    font-family: Arial;
    padding: 0px;
    margin: 0px;
    background-color:  rgb(205, 205, 205);

    width: 100%;
    height: 100%;
    overflow: hidden;
}

input[type='number']{
    width: 40px;
} 

#divMain {
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0px;
    margin: 0px;
    
}



/**************************************************/
/***                                            ***/
/***                  GRILLE                    ***/
/***                                            ***/
/**************************************************/
#divGrid {
    position: absolute;
    transform-origin: center;
    transition: transform 1s ease;
    top: 0;
    left: 0;
    width: calc(var(--cellSizePx)*var(--cellNbX));
    height: calc(var(--cellSizePx)*var(--cellNbY));
    padding: 0px;
    margin: 0px;
    background-color:  rgb(219, 219, 219);
}


.classClicable {
    position: absolute;
    display: flex;
    justify-content: center; /* Centre horizontalement */
    align-items: center;    /* Centre verticalement */
    
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;

    width: var(--clicSizePx);
    height: var(--clicSizePx);
    padding: 0px;
    border-radius: 5px;
    background-color: darkblue;
    color: #fff;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
    line-height: var(--clicSizePx);
    opacity: .7;
    cursor: pointer;
    transition: top var(--animSpeedPoint) ease-in, left var(--animSpeedPoint) ease-in;
    overflow:visible;
}

.gelatine {
    animation: gelatine 0.5s ease;
  }
  @keyframes gelatine {
    from, to { transform: scale(1, 1); }
    25% { transform: scale(0.9, 1.1); }
    50% { transform: scale(1.1, 0.9); }
    75% { transform: scale(0.95, 1.05); }
}

.bounce-out {
    animation: bounce-out .5s ease;
  }
  @keyframes bounce-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    25% {
        opacity: .7;    
        transform: scale(1.05);
    }
    100% {
        opacity: 0;
        transform: scale(.1);
    } 
  }

.classDemoContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}
.classDemoColor {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin: 1px;
}

.classRangeWide {
    width: 100%;
}





/* HTML: <div class="heart"></div> */
.classHeart {
    aspect-ratio: 1;
    --_m: radial-gradient(#000 69%,#0000 70%) 84.5%/50%;
    -webkit-mask-box-image: var(--_m);
               mask-border: var(--_m);
    clip-path: polygon(-41% 0,50% 91%, 141% 0);
}

.classCloud {
    aspect-ratio: 1;
    --g: radial-gradient(50% 50%, #000 98%, #0000) no-repeat;
    mask: var(--g) 100% 100%/30% 60%,var(--g) 70% 0/50% 100%,var(--g) 0 100%/36% 68%,var(--g) 27% 18%/26% 40%,linear-gradient(#000 0 0) bottom/67% 58% no-repeat;
}

.classFlower {
    aspect-ratio: 1;
    --g:/20.56% 20.56% radial-gradient(#000 calc(71% - 1px),#0000 71%) no-repeat;
    mask: 100% 50% var(--g),93.301% 75% var(--g),75% 93.301% var(--g),50% 100% var(--g),25% 93.301% var(--g),6.699% 75% var(--g),0% 50% var(--g),6.699% 25% var(--g),25% 6.699% var(--g),50% 0% var(--g),75% 6.699% var(--g),93.301% 25% var(--g),radial-gradient(100% 100%,#000 38.366%,#0000 calc(38.366% + 1px));
}


.classPetitLu {
        --r: 5px; /* radius of circles */
        aspect-ratio: 1;
        padding: calc(1.5*var(--r));
        background: #e97f02;
        mask: 
          linear-gradient(#000 0 0) no-repeat
           50%/calc(100% - 2*var(--r)) calc(100% - 2*var(--r)), 
          radial-gradient(farthest-side,#000 97%,#0000) 
           0 0/calc(2*var(--r)) calc(2*var(--r)) round;
}


.classStamp {
    --r: 3px; /* control the radius */  
    aspect-ratio: 1;
    padding: calc(2*var(--r));
    background: #b3b39c;
    mask: 
      radial-gradient(var(--r),#0000 97%,#000) round 
       calc(-1.5*var(--r)) calc(-1.5*var(--r))/calc(3*var(--r)) calc(3*var(--r)), 
      linear-gradient(#000 0 0) no-repeat 50%/calc(100% - 3*var(--r)) calc(100% - 3*var(--r));
  }

.classCircleCut {
    --r: 8px; /* cut size */
    aspect-ratio: 1;
    background: #F07818;
    mask: radial-gradient(var(--r) at var(--r),#0000 calc(100% - 1px),#000) calc(-1*var(--r));
  }


.classZigzag {
    --s: 3px;  /* control the size of the spikes */
    --w: 38px; /* preferred image width */
    
    aspect-ratio: 1;
    object-fit: cover;
    padding: calc(2*var(--s));
    box-sizing: border-box;
    background: #0B486B;
    --_m:#0000 0 calc(2*atan(.5)),#000 0 50%;
    mask:
      repeating-conic-gradient(from atan(2) at 50% var(--s),var(--_m))
       calc(2*var(--s)) calc(-1*var(--s))/calc(4*var(--s)) 100% intersect,
      repeating-conic-gradient(from atan(-.5) at var(--s),var(--_m))
       calc(-1*var(--s)) calc(2*var(--s))/100% calc(4*var(--s));
  }

.classPuzzle {
    --r: 4px;  /* control the circle radius */
    --s: 38px; /* control the main size */
  
    width: calc(var(--s) + var(--r));
    aspect-ratio: 1;
    --_l:#0000 calc(100% - 1px),#000;
    --_g:100% 0/calc(100% - var(--r)) calc(100% - var(--r)) no-repeat;
    --_m:/calc(2*var(--r)) calc(2*var(--r)) no-repeat
      radial-gradient(var(--r),#000 calc(100% - 1px),#0000);
    mask: 
      0 calc(50% - var(--r)/2) var(--_m),calc(50% + var(--r)/2) 100% var(--_m),
      radial-gradient(var(--r) at top  ,var(--_l)) var(--_g) intersect,
      radial-gradient(var(--r) at right,var(--_l)) var(--_g);
    background: #774F38;
}




















.classScore {
    display: none;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    border-radius: 10px;
    border: 2px solid white;
    position: fixed;
    width: 36px;
    height: 30px;
    /*line-height: 30px;*/
    user-select: none;
    color: white;
    z-index: 5;
    top: 10px;
    background-color: rgb(113, 113, 113); 
}
#divClicsContainer {    
    right : 105px;     
}
#divScoreContainer {
    right : 60px;
}
#divLeftContainer {
    right : 15px;  
}
#divStarContainer {
    right : 150px;    
    width: auto;
}

#divColorsContainer {
    right : 60px;    
    height: auto;
}

/***********************************************************
                         SNACKBAR
************************************************************/

#snackbar {
    visibility: hidden;
    transform: translateX(-50%);
    min-width: 300px;
    height: 30px;
    line-height: 30px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 9999999;
    left: 50%;
    top: 30px;
    font-size: 17px;
    opacity: .8;
  }
  
  #snackbar.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
  }
  
  @-webkit-keyframes fadein {
    from {bottom: 0; opacity: 0;} 
    to {bottom: 30px; opacity: 1;}
  }
  
  @keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
  }
  
  @-webkit-keyframes fadeout {
    from {bottom: 30px; opacity: 1;} 
    to {bottom: 0; opacity: 0;}
  }
  
  @keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
  }
  
/**************************************************/

/* ===============  ============= */


.classNumber {
    border-radius: 50%;
    background-color: white;
    color: black;
    width: 10px;
    height: 10px;
    line-height: 10px;
    text-align: center;
    font-weight: 500;
    margin: 0px;
    padding: 2px;
}


/*************************************************************************************/



#divMenuContainer {
    position: fixed;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    overflow-y: auto;
    top: -1600px;
    left: 50%;
    width: 90%;
    transform: translateX(-50%);
    height:auto;
    max-height: 80%;
    background-color: rgb(var(--menuColorR), var(--menuColorG), var(--menuColorB));
    color:white;
    border-radius: 10px;
    padding: 0px;
    margin: 0px;
    font-size: 14px;
    user-select: none;
    z-index: 999;
    transition: top 1s ease;
}

#divRankingContainer {
    position: fixed;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    overflow-y: auto;
    top: -1600px;
    left: 50%;
    width: 90%;
    transform: translateX(-50%);
    height:auto;
    max-height: 80%;
    background-color: rgb(var(--menuColorR), var(--menuColorG), var(--menuColorB));
    color:white;
    border-radius: 10px;
    padding: 0px;
    margin: 0px;
    font-size: 14px;
    user-select: none;
    z-index: 999;
    transition: top 1s ease;
}

#divHistoRanking {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
}


.classCadre {
    border-radius: 10px;
    font-size: 14px;
    user-select: none;
    width: auto;
    text-align: center;
    color: black;
    background-color:  rgb(205, 205, 205);

    padding: 5px;
    margin: 10px;

}
.classSousCadre {
    border-radius: 10px;
    padding: 5px;
    margin: 5px;
    user-select: none;
    width: auto;
    border: 1px solid rgb(var(--menuColorR), var(--menuColorG), var(--menuColorB));
    text-align: left;    
}
.classHoriz {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}
.classBouton {
    background-color: rgb(var(--menuColorR), var(--menuColorG), var(--menuColorB));
    color: #fff;
    cursor: pointer;
    text-align: center;
    border-radius: 10px;
    padding: 5px;
    margin: 5px;
    font-size: 18px;
    user-select: none;
}
.classBoutonCfg {
    font-size: 14px;
}



/******************************************************/

datalist {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    /*writing-mode: vertical-lr;*/
    width: 100%;
  }
  
  option {
    padding: 0;
  }
  

.rangeParams {
    width: 150px;
}
.rangePlayers {
    width: 100%;
}

/******************************************/


/**************************************************/
/***                                            ***/
/***             Boutons Flottants              ***/
/***                                            ***/
/**************************************************/
.overBtn {
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    border-radius: 50%;
    border: 4px solid white;
    background-color: lightgray;
    position: fixed;
    left: 10px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    user-select: none;
}

.underBtn {
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    border-radius: 50%;
    border: 4px solid white;
    background-color: lightgray;
    width: 30px;
    height: 30px;
    line-height: 30px;
    user-select: none;
}

#divMenuBtn {
    top: 10px;
    border-radius: 25%;
    font-size: 14px;
    font-weight: bold;
    user-select: none;
    width: auto;
    text-align: center;
    background-color: rgb(205, 205, 205);
    padding-left: 5px;
    padding-right: 5px;
    margin: 0px;
}

#divFullScreen {
    top: 60px;
}

#divSound {
    top: 110px;
}

#divDirection {
    top: 160px;
}


#svgFond {
    padding: 0px;
    margin: 0px;
    z-index: 2;
}









.divDotStart {
    position: absolute;
    width: 20px; /* Largeur totale du damier */
    height: 20px; /* Hauteur totale du damier */
    margin: -10px; /* Décalage négatif pour centrer le point */
    border-radius: 0px;
    background-color: #fff;
    background-image: linear-gradient(45deg, #0f0 25%, transparent 25%, transparent 75%, #0f0 75%), linear-gradient(45deg, #0f0 25%, transparent 25%, transparent 75%, #0f0 75%);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}
.divDotFinish {
    position: absolute;
    width: 20px; /* Largeur totale du damier */
    height: 20px; /* Hauteur totale du damier */
    margin: -10px; /* Décalage négatif pour centrer le point */
    border-radius: 0px;
    background-color: #fff;
    background-image: linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%), linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}

/*==========================================*/

/* Définir l'animation de clignotement */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}
.blinking {
    animation: blink 1s infinite; /* 1s est la durée de l'animation, infinite signifie qu'elle se répète indéfiniment */
}

.connected-point {
    background-color: darkblue;
    color: #fff;
    text-align: center;
    font-size: 10px;
    border-radius: 50%;
    width: var(--pointSizePx);
    height: var(--pointSizePx);
    line-height: var(--pointSizePx);
    margin: calc(var(--pointSizePx) * -.5);
    position: absolute; /* Position absolue pour pouvoir les placer sur la grille */
    user-select: none;
    opacity: 0;
    /*transition: opacity .5s ease;*/
    z-index: 10;
}

.pointCrashed {
    --b: 2px; /* thickness */
    --s: 1px; /* space around */             
    --c: #B90504;
    font-size: 8px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid var(--c);
    box-sizing: border-box;
    --g:conic-gradient(var(--c) 0 0) no-repeat 50%/;
    background: 
      var(--g) var(--b) calc(100% - 2*var(--s)),
      var(--g) calc(100% - 2*var(--s)) var(--b);
    rotate: 45deg;
}


#divNextPoint {
    background-color: white;
    color: #fff;
    text-align: center;
    font-size: 10px;
    border-radius: 50%;
    width: var(--pointSizePx);
    height: var(--pointSizePx);
    line-height: var(--pointSizePx);
    margin: calc(var(--pointSizePx) * -.5);
    position: absolute; /* Position absolue pour pouvoir les placer sur la grille */
    /*box-shadow: inset 0 0 0 5px darkblue; /* Bordure interne rouge de 5px */
    /*transition: opacity .5s ease;*/
    user-select: none;
    z-index: 10;
    opacity: 0;
}
.classMovePoint {
    background-color: white;
    color: #fff;
    text-align: center;
    font-size: 10px;
    border-radius: 50%;
    width: var(--pointSizePx);
    height: var(--pointSizePx);
    line-height: var(--pointSizePx);
    margin: calc(var(--pointSizePx) * -.5);
    position: absolute; /* Position absolue pour pouvoir les placer sur la grille */
    user-select: none;
    transition: top .4s ease,left .4s ease;
    z-index: 9;
    opacity: 0;
}
#divNextLine {
    position: absolute;
    /*background: linear-gradient(0deg, #00f 12.5%, transparent 12.5%, transparent 37.5%, #00f 37.5%, #00f 62.5%, transparent 62.5%, transparent 87.5%, #00f 87.5%);
    background-size: 10px 10px;*/
    opacity: 0;
    width: 3px; /* Épaisseur de la ligne */
    border-radius: 3px;
    /*transition: opacity .5s ease;*/
    z-index: 6;
    opacity: 0;
}



#divCadreZoom {
    position: absolute;
    background-color: rgba(0, 0, 255, 0.5);
    width: calc(var(--cellSizePx) * 3);
    height: calc(var(--cellSizePx) * 3);
    border-radius: 5px;
    padding: 0px;
    margin: 0px;
    z-index: 4;
    opacity: 0;
    transition: opacity .5s ease, top .5s ease, left .5s ease;
}
#divCadreZoom2 {
    position: absolute;
    background-color: rgba(0, 0, 255, 0.2);
    width: calc(var(--cellSizePx) * 3);
    height: calc(var(--cellSizePx) * 3);
    border-radius: 5px;
    padding: 0px;
    margin: 0px;
    z-index: 5;
    opacity: 0;
    transition: opacity .5s ease, top .5s ease, left .5s ease;
}



.tracePoint {
    position: absolute;
    width: var(--pointSizePx);
    height: var(--pointSizePx);
    line-height: var(--pointSizePx);
    margin: calc(var(--pointSizePx) * -.5);
    background-color: rgba(12, 64, 11, 0.8); /* Couleur semi-transparente */
    border-radius: 10%; /* Pour des points arrondis */
    pointer-events: none; /* Empêche l'interaction avec les points */
}


#divTitleTrackName {
    position: absolute;
    left: 30px;
    top: -70px;
    z-index: 5;
    color:#fff;
    font-size: 40px;
}

/**************************************************/
/***                                            ***/
/***                  LOADING                   ***/
/***                                            ***/
/**************************************************/

/* Couvrir tout l'écran */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /*background-color: rgba(var(--menuColorR), var(--menuColorG), var(--menuColorB));*/
    color: white;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    
    z-index: 9999; /* Au-dessus de tout */
}
/* Spinner de chargement simple */
.loading-spinner {
    border: 8px solid #f3f3f3; /* Couleur de fond */
    border-top: 8px solid rgb(var(--menuColorR), var(--menuColorG), var(--menuColorB)); /* Couleur de l'animation */
    border-radius: 50%;
    margin: 20px;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
/* Animation pour le spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/**************************************************/
/***                                            ***/
/***                  RIBBON                    ***/
/***                                            ***/
/**************************************************/


/* HTML: <div class="ribbon">Your text content</div> */
.ribbon {
    position: fixed; /* Positionnement fixe par rapport à la fenêtre */
    top: 10px;
    left: 50%; /* Positionne l'élément au centre de la fenêtre */
    transform: translateX(-50%);
    opacity: 0;
    font-size: 14px;
    user-select: none;
    text-align: center;
    color: #fff;
    transition: opacity 1s ease;

    --s: 1.8em; /* the ribbon size */
    --d: .8em;  /* the depth */
    --c: .8em;  /* the cutout part */
    
    padding: var(--d) calc(var(--s) + .5em) 0;
    line-height: 1.8;
    background:
      conic-gradient(from  45deg at left  var(--s) top var(--d),
       #0008 12.5%,#0000 0 37.5%,#0004 0) 0   /50% 100% no-repeat,
      conic-gradient(from -45deg at right var(--s) top var(--d),
       #0004 62.5%,#0000 0 87.5%,#0008 0) 100%/50% 100% no-repeat;
    clip-path: polygon(0 0,calc(var(--s) + var(--d)) 0,calc(var(--s) + var(--d)) var(--d),calc(100% - var(--s) - var(--d)) var(--d),calc(100% - var(--s) - var(--d)) 0,100% 0, calc(100% - var(--c)) calc(50% - var(--d)/2),100% calc(100% - var(--d)),calc(100% - var(--s)) calc(100% - var(--d)),calc(100% - var(--s)) 100%,var(--s) 100%,var(--s) calc(100% - var(--d)),0 calc(100% - var(--d)),var(--c) calc(50% - var(--d)/2));
    background-color: #D95B43; /* the main color */
    width: fit-content;
  }

