@font-face {
  font-family: "Luckiest Guy";
  src: url("fonts/luckiest-guy-v18-latin-regular.woff2") format("woff2"),
    url("fonts/luckiest-guy-v18-latin-regular.woff") format("woff"),
    url("fonts/luckiest-guy-v18-latin-regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "Luckiest Guy", Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  height: 100vh;
  align-items: center;
  flex-direction: column;
  position: relative;
  background-image: url("./images/background1.jpg");
  background-size: cover;
  object-fit: cover;
  background-repeat: no-repeat;
  background-position: center;
  justify-content: center;
  align-items: center;
  background-attachment: fixed;
  overflow: hidden;
}

button{
  cursor: pointer;
}

.start-game {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  background-image: url("./images/icon.png");
  background-size: cover;
  object-fit: cover;
  background-repeat: no-repeat;
  flex-direction: column;
  background-position: center;
  justify-content: center;
  align-items: center;
  background-attachment: fixed;
}

.history {
  font-family: "Luckiest Guy", Verdana, Geneva, Tahoma, sans-serif;
  max-width: 700px;
  padding: 0 30px;
  scale: 1.1;
  display: flex;
  color: aqua;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#orientation {
  display: none;
  position: fixed;
  flex-direction: column;
  gap: 20px;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 2, 2, 1);
  color: white;
  font-size: 24px;
  font-family:"Luckiest Guy", Verdana, Geneva, Tahoma, sans-serif;
  text-align: center;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#orientation img{
  scale: 1.2;
  transform: rotate(60deg);
  animation: spin 2s linear infinite ;
}

@keyframes spin {
  from {
    transform: rotate(0deg) scale(1.2);
  }
  to {
    transform: rotate(135deg) scale(1.2);
  }
}

.settings{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;

}

.settings .fullscreen{
  position: absolute;
  top: 30px;
  left: 20px;
  width: 70px;
  height: 50px;
  z-index: 2;
  cursor: pointer;
}

.settings .img-volume{
  position: absolute;
  top: 90px;
  right: 30px;
  width: 50px;
  height: 50px;
  z-index: 2;
  cursor: pointer;
}

.volume-slider {
  position: absolute;
  top: 100px;
  right: 90px;
  width: 100px;
  height: 20px;
  z-index: 2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #e73b06, #15b86c);
  border-radius: 10px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: aqua;
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: aqua;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.start-game-btn{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 50px;
  border: unset;
  background: transparent;
  cursor: pointer;
}

.start-game-btn img{
  width: 150px;
  height: 70px;

}

.icon-menu{
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  flex-direction: row;
  gap: 24px;
}

.icon-menu img{
  width: 30px;
  height: 30px;
}

.settings .img-setting{
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 2;
}

.container-intructions{
  position: absolute;
  max-width: 700px;
  background-color: rgba(0,0,0,0.9);
  height: auto;
  color: aqua;
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.instructions{
  background-color: rgba(27, 27, 26, 0.9);
  width: 600px;
  height: 550px;
  overflow-y: auto;
}

.instructions::-webkit-scrollbar {
  width: 3px;
}

.instructions::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.9); 
  border-radius: 10px;
}

.instructions::-webkit-scrollbar-thumb {
  background: #00bcd4;
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.9);
}

.instructions::-webkit-scrollbar-thumb:hover {
  background: #0097a7;
}

.instructions {
  scrollbar-width: thin;
  scrollbar-color: #00bcd4 rgba(0,0,0,0.3);
}


.instructions ol img{
  width: 50px;
  height: 50px;
}

.span-key{
  font-size: 60px;
  color: mediumpurple;
}

.icon-menu button, .footer button{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 140px;
  height: 40px;
  border: unset;
  background: transparent;
  background: linear-gradient(90deg, #e73b06, #15b86c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 20px;
  cursor: pointer;
  margin: 5px 10px;
  padding: 20px;
  gap: 10px;
}

.icon-menu button:hover{
  border: #0097a7 solid 2px;

}

.title {
  background: linear-gradient(90deg, #e73b06, #15b86c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 32px;
}

.start-game-btn:hover {
  font-size: 20px;
  font-weight: 700;
}

.start-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.game-zone {
  position: relative;
  align-items: center;
  justify-content: center;
}

.game-zone img {
  width: 150px;
  height: auto;
}

.infos {
  position: absolute;
  top: 10px;
  z-index: 2;
}

.infos h1 {
  font-size:32px;
  font-weight: 100;
  background: linear-gradient(90deg, #e73b06, #15b86c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  scale: 1.2;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

canvas {
  width: 900px;
  height: 600px;
}

.mobile-buttons {
  width: 100%;
  position: absolute;
  bottom: 30px;
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  margin-bottom: 5px;
}

.mobile-buttons .left-side {
  position: absolute;
  left: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(3, 60px);
  gap: 6px;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.left-side button:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.left-side button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.left-side button:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}

.left-side button:nth-child(4) {
  grid-column: 2;
  grid-row: 3;
}

.mobile-buttons .right-side {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(3, 60px);
  gap: 5px;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.right-side button:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.right-side button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.right-side button:nth-child(3) {
  grid-column: 2;
  grid-row: 3;
}

.mobile-buttons button {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: unset;
  touch-action: none;
}

.mobile-buttons button img {
  width: 60px;
  height: 60px;
}

.game-over,
.you-win {
  position: absolute;
  z-index: 1000;
  background: none;
  border: none;
  cursor: pointer;
}

.game-over img{
  width: 70px;
  height: 70px;
  margin: 30px;
} 

.restart-game-btn{
  background: transparent;
  border: none;
  cursor: pointer;
}

.win-game{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  gap: 120px;
  margin-top: -50px;
}

.restart-game-win, .restart-game{
  font-family:"Luckiest Guy", Verdana, Geneva, Tahoma, sans-serif;
  color: aqua;
  background: linear-gradient(90deg, #e73b06, #15b86c);
  font-weight: bold;
  font-size: 24px;
  border: none;
  cursor: pointer;
  width: 110px;
  height: 50px;
  border-radius: 10px;
  scale: 1.5;
  margin: 50px;
}


.p-controls{
  position: absolute;
  top: 30px;
  right: 100px;
  font-family:"Luckiest Guy", Verdana, Geneva, Tahoma, sans-serif;
  color: aqua;
  font-weight: bold;
  font-size: 16px;
  border: none;
  cursor: pointer;
  width: auto;
  height: auto;
  border-radius: 10px;
  scale: 1.2;
}

.click-settings{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.click-settings img{
  width: 30px;
  height: 30px;
}


.restart-game-btn img{
  width: 150px;
  height: 70px;
}

.you-win img {
  width: 900px;
  height: 605px;
}

.d-flex {
  display: flex !important;
}

.d-none {
  display: none !important;
}

/* Popup Styles */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.popup-content {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  font-family: "Luckiest Guy", Arial, sans-serif;
  font-size: 24px;
  color: #333;
  max-width: 400px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

footer{
  position: absolute;
  bottom: 0;
  padding: 10px;
}

.footer button{
  width: 180px;
  scale: 1.3;
  z-index: 1000;

}

.footer button img{
  width: 30px;
  height: 30px;
}

@media (max-width: 870px) {
  .title {
    font-size: 24px;
  }

  .start-game {
    height: 100vh;
    width: 100%;
  }

  .history {
    font-size: 16px;
    font-weight: 400;
  }

  .contain {
    height: 220px;
    overflow-y: auto;
  }

  .mobile-buttons .left-side, .mobile-buttons .right-side{
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(3, 30px);
    gap: 3px;
  }
  
  .mobile-buttons button{
    z-index: 1000;
  }

  .mobile-buttons button img {
    width: 30px;
    height: 30px;  
  }

  canvas{
    aspect-ratio: 16/7.5;
  }
}

@media (max-width: 500px) {
  .infos {
    display: none;
  }

  .start-game {
    height: 100vh;
    width: 100%;
  }

  canvas,
  .you-win img {
    height: 100vh;
    width: 100%;
  }

  .title {
    font-size: 20px;
  }
  .card {
    padding: 5px;
  }
}

@media (max-height: 500px) {
  .infos h1 {
    display: none;
  }

  canvas,
  .you-win img {
    height: 100vh;
    width: 100%;
  }

  .history {
    height: 100vh;
  }

  .card {
    gap: 12px;
    height: 95%;
    padding: 0;
  }
  
  .settings .fullscreen{
    top: 10px;
    left: 10px;
    width: 40px;
    height: 30px;
  }

  .p-controls{
    top: 10px;
    right: 60px;
    font-size: 12px;
    scale: 1;
  }
  
  .volume-slider {
    top: 80px;
    right: 70px;
    width: 90px;
    height: 12px;
  }


  .settings .img-setting{
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .settings .img-volume{
    position: absolute;
    top: 70px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .container-intructions{
    position: absolute;
    width: 80%;
    height: 100vh;
    color: aqua;
    border-radius: 20px;
    padding: 5px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    
  }

  .instructions{
    background-color: rgba(0,0,0,0.9);
    width: 100%;
    height: 100%;
    overflow-y: auto;
    margin: 10px;
  }

  .icon-menu{
    width: 100%;
    margin-left: 20px;
    margin-right: 20px;
  }

  .span-key{
    font-size: 30px;
    color: orange;
  }

}

