/* alegreya-sans-regular - latin */
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 400;
  src: url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-regular.eot'); /* IE9 Compat Modes */
  src: local(''),
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-regular.woff') format('woff'), /* Modern Browsers */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-regular.svg#AlegreyaSans') format('svg'); /* Legacy iOS */
}

/* alegreya-sans-900 - latin */
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 900;
  src: url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-900.eot'); /* IE9 Compat Modes */
  src: local(''),
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-900.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-900.woff2') format('woff2'), /* Super Modern Browsers */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-900.woff') format('woff'), /* Modern Browsers */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-900.ttf') format('truetype'), /* Safari, Android, iOS */
       url('./fonts/alegreya-sans-v21-latin/alegreya-sans-v21-latin-900.svg#AlegreyaSans') format('svg'); /* Legacy iOS */
}



* {
  font-family: 'Alegreya Sans', sans-serif;
  margin: 0;
  letter-spacing: 0.08rem;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #000;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.d-none {
  display: none;
}

.standard-font {
  font-family: sans-serif;
}

h1 {
  text-align: center;
  margin-top: 2.8rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.7rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1.3rem;
  margin: 0.5rem 0;
}

#canvas-container {
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16/9;
  max-height: 674px;
  background: url('./img/5.Fondo/Capas/5.cielo_1920-1080px.png');
  background-size: cover;
  background-position: left;
  position: relative;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* -----------  SCREENS  ------------ */

.screen {
  background-size: cover;
  inset: 0;
  position: absolute;
  transition: all 500ms ease-in-out;
}

#startscreen {
  background-image: url('./img/9.Intro _ Outro Image/Start Screen/Opcion 1.png');
}
#lostscreen {
  background-image: url('./img/9.Intro _ Outro Image/_Game over_ screen/2.oh no you lost!.png');
}
#wonscreen {
  background-image: url('./img/9.Intro _ Outro Image/_Game over_ screen/you won.png');
}
#gameover-screen {
  background-image: url('./img/9.Intro _ Outro Image/_Game over_ screen/3.Game over.png');
}

.hide-startscreen {
  transform: scale(0);
  opacity: 0;
}

/* ----------  LOADING  ----------- */

#loading-bar {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  aspect-ratio: 10;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  /* border: 1px solid rgb(160, 34, 10, .2) ; */
  overflow: hidden;
}

#status {
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5) 10%, transparent 40%);
  animation: loading-animation 1s linear infinite;
}

@keyframes loading-animation {
  0% {
    transform: translateX(-70%);
  }
  100% {
    transform: translateX(70%);
  }
}

/* ----------  BUTTONS  ----------- */

#button-container {
  position: absolute;
  bottom: 10px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

button {
  padding: 0.4rem 1.2rem;
  font-size: 0.7rem;
  border-radius: 10px;
  font-variant: small-caps;
  font-size: clamp(0.6rem, 1.8vw, 1.5rem);
  color: #ffd900;
  border: none;
  background-color: transparent;
  cursor: pointer;
  box-shadow: 1px 1px 2px 2px #a0220a;
}

.button--foreground {
  background: linear-gradient(#ffc322 10%, #ffd900 30%, #ffd900 70%, #ffc322 90%);
  color: #a0220a;
}

.button--foreground:hover {
  background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
    linear-gradient(#ffc322 10%, #ffd900 30%, #ffd900 70%, #ffc322 90%);
}

button:hover {
  background: linear-gradient(#ffc322 10%, #ffd900 30%, #ffd900 70%, #ffc322 90%);
  color: #a72e16;
}

button:disabled {
  background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3));
  color: #b86352;
  box-shadow: 1px 1px 2px 2px #b86352;
  cursor: default;
}

button:disabled:hover {
  background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3));
  color: #b86352;
}

.animated-btn {
  animation: btn-animation 650ms ease-in-out infinite alternate;
}

@keyframes btn-animation {
  0% {
    box-shadow: 1px 1px 2px 2px rgba(255, 195, 34, 0.8);
  }
  100% {
    box-shadow: 0px 0px 40px 20px rgba(255, 195, 34, 0.8);
  }
}

#bottle-btn {
  display: none;
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  visibility: hidden;
}

#bottle-btn__img {
  height: 100%;
  width: auto;
  transform: rotateZ(15deg);
}

/* -------------  HELP - MODAL  -------------- */

#help-modal {
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.8);
  color: #a72e16;
  padding: 0 50px;
  overflow-y: auto;
}

#close-help {
  background: none;
  width: 30px;
  height: 30px;
  position: absolute;
  right: 20px;
  top: 20px;
  border-radius: 5px;
  cursor: pointer;
  padding: 2px;
}

#close-help:hover {
  background: rgba(0, 0, 0, 0.1);
}

#close-help img {
  width: 100%;
  object-fit: contain;
}

#keys-table td {
  padding: 5px;
  font-size: 1.3rem;
  letter-spacing: 0.08rem;
}

/* -------------  MEDIA QUERIES  --------------- */

@media (max-width: 700px) {
  #bottle-btn {
    display: unset;
  }
}

@media (max-width: 600px), (max-height: 450px) {
  button {
    padding: 0.3rem 0.5rem;
  }

  .animated-btn {
    animation: btn-animation700 650ms ease-in-out infinite alternate;
  }

  @keyframes btn-animation700 {
    0% {
      box-shadow: 1px 1px 2px 2px rgba(255, 195, 34, 0.8);
    }
    100% {
      box-shadow: 0px 0px 20px 10px rgba(255, 195, 34, 0.8);
    }
  }
}

@media (max-width: 550px) {
  #bottle-btn {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 450px), (max-height: 350px) {
  #button-container {
    padding: 0 5px;
    bottom: 5px;
  }
  button {
    padding: 0.15rem 0.25rem;
  }
  .animated-btn {
    animation: btn-animation500 650ms ease-in-out infinite alternate;
  }

  @keyframes btn-animation500 {
    0% {
      box-shadow: 1px 1px 2px 2px rgba(255, 195, 34, 0.8);
    }
    100% {
      box-shadow: 0px 0px 15px 7px rgba(255, 195, 34, 0.8);
    }
  }
}

@media (max-width: 400px) {
  #bottle-btn {
    border-radius: 5px;
    width: 20px;
    height: 20px;
  }
}

@media (min-aspect-ratio: 16/9) {
  #canvas-container {
    height: 100vh;
    width: unset;
  }
}
