

@font-face {
  font-family: Poppins;
  src: url("../fonts/Poppins-Regular.ttf");
}


@font-face {
  font-family: PoppinsBold;
  src: url("../fonts/Poppins-Bold.ttf");
}




body {
    user-select: none;
    font-family: Poppins;
    background: linear-gradient(to bottom, #f7f7f7 0%, #f7f7f7 90%, #ac4c9d 100%);
}

body[data-orientation="portrait"] {
    width: 1080px;
    height: 1920px;
}

body[data-orientation="landscape"] {
    width: 3420px;
    height: 1920px;
}


#iFrameAdapter_wrapper {
    background-image: url("../assets/bg.png");
    background-position: center;
    background-size: cover;
  }


.x-invisible {
  position: absolute;
  right: 1;
  padding: 30px;
  background-color: transparent;
  color: transparent;
  border-color: transparent;
  z-index: 10;
}








  /* HOME */

  .home-container {
    display: flex;
    flex-direction: column;
    gap: 5rem;
    margin: 50px;
    align-items: center;
    text-align: center;
  }

  .logo-container {
    align-self: flex-end;
  }


  .square {
    filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.5));
    width: 50%;
    height: auto;
  }



  .texts-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }


  .banner-below-eoe {
    font-size: 40px;
    background: linear-gradient(to right, rgba(213, 235, 234, 0) 0%, rgba(213, 235, 234, 1) 20%, rgba(213, 235, 234, 1) 80%, rgba(213, 235, 234, 0) 100%);
  }



  .buttons-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: -40px;
  }


  .buttons-container2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 20px;
  }



  .home-buttons {
    padding: 1rem;
    background-color: #3d5aa4;
    border-radius: 1rem;
    color: white;
    width: 550px;
    font-size: 34px;
    border: 15px solid #b1bddb;  
    font-family: PoppinsBold;
  }




  .eoe-title {
    font-size: 120px; 
    font-weight: 900 !important; 
    color: #ac4c9d !important; 
    font-family: PoppinsBold !important;
  }


  .welcome {
    font-size: 70px; 
    font-family: PoppinsBold !important;
  }


  .home-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: #ac4c9d;  /* Puoi personalizzare questo colore */
    color: white;
    text-align: center;
    font-family: Poppins;
    font-size: 17px;
    border-top: 15px solid #c7a4cf;
}
  




  /* RULES */

  .rules-container {
    display: flex;
    flex-direction: column;
    gap: 5rem;
    margin: 50px;
  }

  .rules-second-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: -20px;
  }


  .rules-txt {
    text-align: center;
    margin-right: 130px;
    margin-left: 130px;
  }



  .legenda-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-left: 200px;
  }

  .legenda-row {
    display: flex;
    align-items: center;
    gap: 15px;
  }



  .rules-img-containers {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Evita il ridimensionamento del contenitore */
  }

  .legenda-icons {
    width: 100px;
    height: 100px;
    object-fit: contain;
  }


  .close-btn-container {
    display: flex;
    justify-content: center;
  }












  /*REFERENCES */

  .references-container {

    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin: 50px;

  }








    /*REGISTER/NICKNAME */

    .register-container {

      display: flex;
      flex-direction: column;
      gap: 11rem;
      margin: 50px;

    }


    .keyboard-container {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 2rem;
      margin-top: -50px;
    }


    .insert-initials {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }


    .initials-row {
      display: flex;
      justify-content: center;
      gap: 25px;
      margin-bottom: 150px;
    }

    .initial-cell {
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      
      padding: 3rem;
      width: 5rem; /* Aumentato per evitare overflow del testo */
      height: 5rem; /* Aumentato per una proporzione migliore */
      background-color: #b2bdc2;
      border: 15px solid #dfe3e6;
      border-radius: 25px;
      font-size: 60px;
      font-weight: bold;
  }
  










    /* GAME */

    .wheel {
      width: 75rem;
      height: auto;
      position: absolute;
      top: 50%;
      left: -50%;
      transform: translate(-5%, -50%);
      z-index: 1;
      transition: transform 2s ease-in-out;
      transform-origin: center center;
    }

    .wheel_sel {
      width: 75rem;
      height: auto;
      position: absolute;
      top: 50%;
      left: -50%;
      transform: translate(-5%, -50%);
      z-index: 2;
      transition: transform 2s ease-in-out;
      transform-origin: center center;
      display: none;
    }

    @keyframes spinAnimation {
      0% {
          transform: scale(1); /* Inizia con la dimensione normale */
      }
      10% {
          transform: scale(1.05); /* A metà dell'animazione, ingrandisci */
      }
      20% {
          transform: scale(1); /* Torna alla dimensione normale */
      }
  }

    .spin {
      position: absolute;
      z-index: 100;
      pointer-events: none;
      top: 41.5%;
      left: 1.25%;
      font-size: 67px;
      font-family: PoppinsBold;
      color: #ac4c9d !important;
      -webkit-text-stroke: 30px white;
      paint-order: stroke fill;
      font-family: PoppinsBold;
      animation: spinAnimation 1s infinite;
      text-align: center;
      line-height: 80px;
    }
    

    .arrow {
      position: absolute;
      z-index: 100;
      top: 46%;
      left: 0%;
      width: 157px;
      height: auto;
    }
  


    #volume-slider {
      width: 150px;
      border-radius: 5px;
      appearance: none;
      height: 4px;
      background: #ccc;
      outline: none;
      align-self: center;
      position: absolute;
      top: 98px;
      left: 340px;
      background: linear-gradient(to right, purple 50%, #ccc 50%);
    }

    /* Thumb (pallino) su WebKit (Chrome, Edge, Safari) */
    #volume-slider::-webkit-slider-thumb {
      appearance: none;
      height: 16px;
      width: 16px;
      border-radius: 50%;
      background: purple;
      cursor: pointer;
      border: none;
      align-self: center;
      margin-top: -6px; /* allineamento verticale con la traccia */
    }

    /* Thumb su Firefox */
    #volume-slider::-moz-range-thumb {
      height: 16px;
      width: 16px;
      border-radius: 50%;
      background: purple;
      cursor: pointer;
      border: none;
    }




    .audio-icon {
      position: absolute;
      width: 50px;
      height: auto;
      top: 75px;
      left: 273px;
    }




    

    .game-container {

      display: flex;
      flex-direction: column;
      gap: 1rem;
      margin: 50px;

    }

    .header-game {
      display: flex;
      justify-content: space-between;
    }

    .up-buttons  {
      display: flex;
      gap: 15px;
    }


    .game-buttons {
      height: 100px;
      width: auto; /* meglio auto per preservare proporzioni */
      max-width: 100px; /* limita stretching */
      object-fit: contain; /* assicura che non si deformi */
    }

    .advent-logo-ingame {
      width: 35%;
      height: auto;
    }

    .second-header-game {
      display: flex;
      justify-content: space-between;

    }


    #level-name {
      font-size: 50px;
      font-family: PoppinsBold;
      color: #b2bdc2;
    }



    .timer-game {
      background-color: #d1d1d1;
      border: 10px solid #e8e8e8;
      border-radius: 15px;
      width: 300px;
      align-self: flex-end;
      color: white;
      font-weight: bold;
      font-size: 48px;
      text-align: center;
      margin-top: -10px;
    }






    .game-board {
      position: relative;
      padding: 10px;
      width: 800px;
      height: 1600px;
      margin: auto;
      margin-top: -22px;
      background-image: url("../assets/board1.png");
      background-repeat: no-repeat;
    }

    .game-board2 {
      position: relative;
      padding: 10px;
      width: 960px;
      height: 1600px;
      margin: auto;
      margin-top: -37px;
      background-image: url("../assets/board2.png");
      background-repeat: no-repeat;
    }

    .game-board3 {
      position: relative;
      padding: 10px;
      width: 800px;
      height: 1280px;
      margin: auto;
      margin-top: 50px;
      background-image: url("../assets/board3.png");
      background-repeat: no-repeat;
    }






  .cell {
    width: 50px;
    height: 50px;
    /*background-color: #f4a261;
    border: 2px solid black;*/
    color: transparent;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}






.player {
  width: 50px;
  height: 50px;
  bottom: 130px;
  left: 70px;
  background-color: #e9d6e9;
  border: 4px solid #ac4c9d;
  border-radius: 50%;
  position: absolute;
  transition: all 0.5s ease-in-out;
}

.player1 {
  background-color: #e9d6e9;
  border: 4px solid #ac4c9d;
}

.player2 {
  background-color: #e09027;
  border: 4px solid #834d08;
}

.player3 {
  background-color: #3d5aa4;
  border: 4px solid #1d2b4e;
}

.player4 {
  background-color: #497738;
  border: 4px solid #26461b;
}

.player5 {
  background-color: #e2e2e2;
  border: 4px solid #5f5f5f;
}


.player1bg {
  background-color: #ac4c9d;
  border: 4px solid #e9d6e9;
}

.player2bg {
  background-color: #834d08;
  border: 4px solid #e09027;
}

.player3bg {
  background-color: #1d2b4e;
  border: 4px solid #3d5aa4;
}

.player4bg {
  background-color: #26461b;
  border: 4px solid #497738;
}

.player5bg {
  background-color: #5f5f5f;
  border: 4px solid #e2e2e2;
}




.popup{
  position:fixed; inset:auto; top:50%; left:50%;
  transform:translate(-50%,-50%);         /* niente scale() */
  width:400px;        /* 800px su desktop, si adatta su mobile */
  overflow:auto;                           /* scorre se serve */
  scrollbar-width:none; -ms-overflow-style:none;
  background:#f3f0f3 center/cover no-repeat;
  border:10px solid #c2b2ba; border-radius:15px;
  padding:clamp(24px, 4vw, 48px);
  font-size:clamp(28px, 2.2vw, 40px);     /* testo che si adatta */
  text-align:center; color:#000;
  opacity:0; transition:opacity .5s; z-index:2;
}

.popup-quit {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 640px;
  background-size: cover;
  background-position: center;
  transform: translate(-50%, -50%) scale(1);
  background-color: #f0f2f3;
  border: 20px solid #b2bdc2;
  border-radius: 30px;
  color: black;
  padding: 40px;
  text-align: center;
  font-size: 40px;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  z-index: 1000;
}

.popup-error {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 200px;
  background-size: cover;
  background-position: center;
  transform: translate(-50%, -50%) scale(1);
  background-color: #f0f2f3;
  border: 10px solid #b20000;
  border-radius: 15px;
  color: rgb(71, 0, 0);
  padding: 20px;
  text-align: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  z-index: 2;
}





.answer-input {
  margin-right: 20px;
  display: none;
}


@keyframes fadeInScale {
     0% {
        opacity: 0;
        transform: scale(0.6);
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes blink {
  0%, 30%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}



.answer-label {
  display: block;
  font-size: 32px;
  padding: 8px;
  cursor: pointer;
  color: black;
  font-family: Poppins;
}

.answer-label-animate {
  opacity: 0;
  transform: scale(0.8);
  animation-name: fadeInScale;
  animation-duration: 0.4s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}


.answer-label-blink {
  animation: blink 3s infinite;
  animation-fill-mode: both
}


.answer-label:hover {
  background-color: #ac4c9d;
  color: white !important;
}
.confirm-button {
  margin-top: -15px;
  padding: 20px 40px;
  font-size: 36px;
  background-color: #3d5aa4;
  border: 10px solid #b1bddb;
  color: white;
  border-radius: 2rem;
  cursor: pointer;
  font-family: PoppinsBold;
  margin-left: 30px;
  margin-right: 30px;

}








.popup-title {
  color: #3d5aa4; 
  font-weight: 900; 
  font-size: 80px; 
  font-family: PoppinsBold;
}



/* Stile per il popup della domanda */
.knowledge-popup {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 600px;
  height: auto;
  background-color: #f7edf5;
  border-radius: 48px;
  padding: 50px;
  text-align: left;
  border: 24px solid #ac4c9d;
  color: #ac4c9d;
  font-family: PoppinsBold;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.5s, transform 0.5s;
  z-index: 100;
}

.answer-button {
  margin: 20px;
  padding: 10px;
  width: 100%;
  font-family: Poppins;
  font-size: 32px;
  text-align: left;
  color: black;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.answer-button:hover {
  background-color: #ac4c9d;
  color: white;
}



.action-text {
  color: #ac4c9d;
  font-family: PoppinsBold;
  font-size: 48px;
  text-align: center;
}

.contextchance-text {
  color: black;
  font-family: Poppins;
  font-size: 40px;
  text-align: center;
  line-height: 50px;
}




.no-answer-err {
    color: red;
    font-size: 28px;
    font-family: 'Poppins';
    text-align: center;
    display: none;
}




.game-finished-popup {
  font-family: PoppinsBold;
  color: black;
  width: 600px;
  height: auto;
  border-radius: 64px;
}




.movement-popup {

  font-family: PoppinsBold;
  width: 600px;
  height: auto;
  border-radius: 64px;
  color: black;
}

.move-action-text {
  font-family: PoppinsBold;
  font-size: 64px;
  text-align: center;
}

.move-contextchance-text {
  color: black;
  font-family: Poppins;
  font-size: 40px;
  text-align: center;
}


.final-gotoranking {
  padding: 20px;
  background-color: #3d5aa4;
  border-radius: 2rem;
  color: white;
  width: 500px;
  font-size: 44px;
  border: 20px solid #b1bddb;
  font-family: PoppinsBold;
}

.continue-close {
  padding: 20px;
  background-color: #3d5aa4;
  border-radius: 2rem;
  color: white;
  width: 500px;
  font-size: 44px;
  border: 20px solid #b1bddb;
  font-family: PoppinsBold;
  align-self: center;
}












/*LEADERBOARD*/


.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  margin: 50px;
  justify-content: center;
  align-items: center;
}




.rankingContainer {
  font-family: PoppinsBold;
  color: purple;
  width: 800px;
  background: transparent;
  border-radius: 10px;
  padding: 20px;
  /*max-height: 655px;  Imposta l'altezza massima della classifica 
  overflow-y: auto;  /* Abilita lo scroll verticale */
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 44px;
  border-collapse: separate;  /* Modifica da 'collapse' a 'separate' */
  border-spacing: 15px; /* Aggiunge spazio tra tutte le celle */
  text-align: center;
}
th, td {
  padding: 20px;
}
.medal {
  width: 90px;
  height: 90px;
}
.gold { background-color: gold; border-radius: 50%; }
.silver { background-color: silver; border-radius: 50%; }
.bronze { background-color: #cd7f32; border-radius: 50%; }
.no-medal { background-color: lightgray; border-radius: 50% }

.letters {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.letter-box {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1e9f6;
  color: purple;
  font-weight: bold;
  border-radius: 5px;
}

td {
  padding: 8px 12px; /* Ridotto il padding orizzontale e verticale per una tabella più compatta */
}

/* Aggiungi un po' di padding alla cella del tempo per maggiore spazio */
td.time-cell {
  padding: 5px 15px; /* Ridotto il padding verticale per diminuire l'altezza */
  background-color: #f1e9f6;
  border-radius: 50px;
  color: purple;
  font-size: 28px; /* Modificato il font-size per rendere il testo più piccolo */
  height: 40px; /* Impostato un'altezza fissa per la cella del tempo */
  line-height: 40px; /* Allineato il testo verticalmente */
}


.medal img {
  width: 60px;  /* Imposta una larghezza fissa */
  height: 60px; /* Imposta un'altezza fissa */
  object-fit: contain; /* Mantiene il rapporto d'aspetto */
}











/* MULTIPLAYER */

.multiplayer-container {
    display: flex;
    flex-direction: column;
    gap: 5rem;
    margin: 50px;
    align-items: center;
    text-align: center;
}


.room-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin: 50px;
    align-items: center;
    text-align: center;
}

#room-code {
  font-size: 125px;
  color: #ac4c9d;
  font-family: PoppinsBold;
  text-transform: uppercase;
  user-select: all;
}

.findroom-container {
  display: flex;
    flex-direction: column;
    gap: 3rem;
    margin: 50px;
    align-items: center;
    text-align: center;
}


#code-insert {
  padding: 1rem;
  width: 500px;
  font-family: PoppinsBold;
  text-align: center;
  font-size: 70px;
  background-color: #b2bdc2;
  border: 15px solid #dfe3e6;
  border-radius: 15px;
  text-transform: uppercase;
  margin-bottom: 50px;
}


.players-list {
  padding-inline-start: 0;
  font-size: 48px;
  list-style: none;
}

.player-in-list {
  background-color: #ac4c9d;
  color: white;
  padding: 3px;
  width: 300px;
  margin-bottom: 10px;
}

.player-in-list-host {
  background-color: #3d5aa4;
  color: white;
  padding: 3px;
  width: 300px;
  margin-bottom: 10px;
}




#btnstartmultiplayer:disabled {
  background-color: #d1d1d1;
  border: 15px solid #e8e8e8;
  color: black;
}


.waiting {
  font-size: 85px;
  color: #ac4c9d;
  font-family: PoppinsBold;
}












/*LANDSCAPE MODE*/




body[data-orientation="landscape"] .game-buttons {
    height: 100px;
    width: auto; /* meglio auto per preservare proporzioni */
    max-width: 100px; /* limita stretching */
    object-fit: contain; /* assicura che non si deformi */
}

body[data-orientation="landscape"] .advent-logo-ingame {
    width: auto;
    height: 200px;
}

body[data-orientation="landscape"] .game-board {
    margin-top: -150px;
    margin-left: 56%;
    background-repeat: no-repeat;
}

body[data-orientation="landscape"] .game-board2 {
    margin-top: -175px;
    margin-left: 56%;
    background-repeat: no-repeat;
}

body[data-orientation="landscape"] .game-board3 {
    margin-top: 13px;
    margin-left: 56%;
    background-repeat: no-repeat;
}

body[data-orientation="landscape"] .wheel {
    left: 400px;
}

body[data-orientation="landscape"] .wheel_sel {
    left: 400px;
}


body[data-orientation="landscape"] .popup {
  margin-left: 1%;
}

body[data-orientation="landscape"] .advent-logo-ingame {
  width: 13%;
  height: auto;
}


body[data-orientation="landscape"] .arrow {
  left: 26%;
}

body[data-orientation="landscape"] .audio-icon {
  left: 350px;
}

body[data-orientation="landscape"] #volume-slider {
  left: 415px;
}

body[data-orientation="landscape"] .spin {
  left: 24%;
  top: 42.5%;
}


body[data-orientation="landscape"] .legenda-container {
  margin-left: 42%;
}


body[data-orientation="landscape"] .home-footer {
  font-size: 20px;
  padding: 20px 0;
}


body[data-orientation="landscape"] .header-game {
  margin-left: 2%;
  margin-right: 2%;
}

body[data-orientation="landscape"] .second-header-game {
  margin-left: 2%;
  margin-right: 2%;
}