html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;              /* pas de defilement : le canvas EST la page */
    background: #231F20;
}
canvas {
    display: block;
}
body {
    margin: 0;
}
/* Le conteneur colle a la zone visible. 100dvh suit la barre d'adresse mobile
   (100vh la depasse sur iOS/Android : canvas coupe ou etire). */
#unity-container {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}
/* Taille CSS seulement : JAMAIS d'attributs width/height poses a la main sur le
   canvas, c'est Unity qui fixe le buffer (taille CSS x devicePixelRatio). */
#unity-canvas {
    width: 100%;
    height: 100%;
    background: #231F20;
    touch-action: none;            /* pas de zoom / defilement du navigateur sur le jeu */
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
/* L'ECRAN DE CHARGEMENT SE PROPORTIONNE A L'ECRAN.
   Tout est en vmin (le plus petit cote de l'ecran) avec des bornes : un petit
   telephone en paysage ne voit plus le logo manger toute la place, un grand
   ecran ne le voit pas minuscule. */
#loading-cover {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#unity-loading-bar {
    flex: 0 1 auto;
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 2.5vmin, 22px);
    padding: clamp(10px, 4vmin, 40px);
}
#unity-logo {
    text-align: center;
    line-height: 0;
}
#unity-logo img {
    /* Jamais plus de la moitie de la largeur, ni d'un tiers de la hauteur. */
    width: auto;
    height: auto;
    max-width: min(55vw, 520px);
    max-height: 32vh;
    max-height: 32dvh;
    object-fit: contain;
}
#unity-progress-bar-empty {
    width: min(70vw, 520px);
    height: clamp(8px, 1.8vmin, 18px);
    border-radius: 8px;
    /* La piste vide, visible : on voit ou va la barre. */
    border: 1px solid rgba(159, 232, 255, 0.45);
    background: rgba(159, 232, 255, 0.10);
    padding: 2px;
    overflow: hidden;
}
#unity-progress-bar-full {
    width: 0%;
    
    height: 100%;
    border-radius: 8px;

    background: linear-gradient(90deg, rgba(52,152,86,1) 0%, rgba(52,139,75,1) 35%, rgba(51,101,49,1) 60%, rgba(48,89,41,1) 100%);
animation: glowing 2s infinite;

}
.light #unity-progress-bar-empty {
    border-color: black;
}
.light #unity-progress-bar-full {
    background: black;
}

#unity-fullscreen-button {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    background: url('fullscreen-button.png') no-repeat center;
    background-size: contain;
}

.spinner,
.spinner:after {
  border-radius: 50%;
  width: 5em;
  height: 5em;
}
.spinner {
  margin: 10px;
  font-size: clamp(5px, 1.2vmin, 10px);   /* le cercle suit la taille de l'ecran */
  position: relative;
  text-indent: -9999em;
  border-top: 1.1em solid rgba(255, 255, 255, 0.2);
  border-right: 1.1em solid rgba(255, 255, 255, 0.2);
  border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
  border-left: 1.1em solid #ffffff;
  transform: translateZ(0);
  animation: spinner-spin 1.1s infinite linear;
}
@keyframes spinner-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes glowing {
 0% {
   box-shadow: 0 0 5px #3498db, 0 0 10px #3498db, 0 0 15px #3498db,
     0 0 20px #3498db, 0 0 25px #3498db;
 }
 50% {
   box-shadow: 0 0 20px #9b59b6, 0 0 30px #9b59b6, 0 0 40px #9b59b6,
     0 0 50px #9b59b6, 0 0 60px #9b59b6;
 }
 100% {
   box-shadow: 0 0 5px #3498db, 0 0 10px #3498db, 0 0 15px #3498db,
     0 0 20px #3498db, 0 0 25px #3498db;
 }
}

/* Le pourcentage du chargement, sous la barre. */
#unity-progress-text {
    font-family: "Heebo", "Rubik", Arial, sans-serif;
    font-size: clamp(14px, 3.6vmin, 28px);
    font-weight: 700;
    letter-spacing: 1px;
    color: #9fe8ff;
    text-shadow: 0 0 10px rgba(91, 200, 245, 0.6);
    font-variant-numeric: tabular-nums;   /* les chiffres ne dansent pas */
    direction: ltr;
}
