@font-face {
  font-family: "8bitlim";
  src: url("./fonts/8bitlim.ttf") format("truetype");
}

html {
  background-image: url("./images/background1.png");
  background-size: cover;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: cursor 0.3s;
  font-family: "8bitlim";
  src: url("./fonts/8bitlim.ttf") format("truetype");
}

body {
  background-image: url("./images/stars.gif");
  background-repeat: no-repeat;
  background-size: cover;
  height: 100%;
}

.title-image {
  padding: 50px;
}

.title-image:hover {
  filter: brightness(150%);
}

.button-container {
  position: fixed;
  top: 20px;
  right: 20px;
}

#btnChangeBackground {
  background: none;
  border: none;
  padding: 0;
}

#btnFlapman {
  background: none;
  border: none;
  padding: 0;
  margin-right: 40px;
  font-family: "8bitlim";
  src: url("./fonts/8bitlim.ttf") format("truetype");
  letter-spacing: 3px;
  transition: transform 0.3s ease;
}

#btnFlapman:hover {
  filter: brightness(150%);
  transform: scale(1.05);
}

/* Flapman speaking animation */
@keyframes flapman-pulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 10px #7B68EE);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 0 20px #9370DB);
  }
  50% {
    transform: scale(1.05) rotate(0deg);
    filter: drop-shadow(0 0 30px #BA55D3);
  }
  75% {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 20px #9370DB);
  }
}

@keyframes flapman-glow {
  0%, 100% {
    box-shadow: 0 0 10px #7B68EE, 0 0 20px #7B68EE, 0 0 30px #7B68EE;
  }
  50% {
    box-shadow: 0 0 20px #BA55D3, 0 0 40px #BA55D3, 0 0 60px #BA55D3;
  }
}

.flapman-speaking {
  animation: flapman-pulse 0.5s ease-in-out infinite;
}

#btnFlapman:has(.flapman-speaking) {
  animation: flapman-glow 1s ease-in-out infinite;
  border-radius: 50%;
}

#btnImage {
  width: 200px;
  height: 200px;
}

.btnImage2 {
  width: 1000px;
}

button img {
  margin-top: 15px;
  width: 200px;
  height: 200px;
}

button {
  background: transparent;
  border: none;
  padding: 0;
}

.tittle:hover {
}

.audioButtons {
  position: fixed;
  left: 20px;
  bottom: 20px;
  height: 146px;
  width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}


.audioButtons button {
  background: transparent;
  border: none;
  padding: 0;
  margin-right: 10px;
}

/* .audioButtons img {
  width: 40px;
  height: 40px;
} */

.audioButtons .background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.audioButton {
  z-index: -10;
}

.next {
  width: 75px;
  height: 80px;
  margin-bottom: 20px;
  margin-right: 10px;
}

.play {
  width: 30px;
  height: 30px;
}

.previous {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  margin-left: 31px;
}

.pause {
  width: 30px;
  height: 30px;
  margin-right: 5px;
}

.audioButton:hover {
  filter: brightness(150%);
}

.extra-image {
  position: fixed;
  bottom: -20px;
  right: 20px;
  z-index: 9999;
  width: 280px;
  height: auto;
  max-width: 35vw;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.extra-image:hover {
  filter: brightness(150%);
  cursor: url("./images/sword.png"), auto;
}

/* Flapman container for positioning - starts on LEFT */
#flapmanLink {
  position: fixed;
  bottom: -20px;
  left: 20px;
  right: auto;
  z-index: 9999;
  transition: left 0s, right 0s;
}

#flapmanLink .extra-image {
  position: relative;
  bottom: auto;
  right: auto;
  left: auto;
  transform: scaleX(-1); /* Flipped to face right initially */
}

/* Flying animation keyframes */
@keyframes fly-to-left {
  0% {
    transform: translateX(0) rotate(0deg) scaleX(1);
  }
  15% {
    transform: translateX(20px) rotate(-15deg) scaleX(1);
  }
  30% {
    transform: translateX(0) rotate(-25deg) scaleX(1);
  }
  100% {
    transform: translateX(calc(-100vw + 100px)) rotate(-15deg) scaleX(1);
  }
}

@keyframes fly-to-right {
  0% {
    transform: translateX(0) rotate(0deg) scaleX(-1);
  }
  15% {
    transform: translateX(-20px) rotate(15deg) scaleX(-1);
  }
  30% {
    transform: translateX(0) rotate(25deg) scaleX(-1);
  }
  100% {
    transform: translateX(calc(100vw - 100px)) rotate(15deg) scaleX(-1);
  }
}

.extra-image.flying-left {
  animation: fly-to-left 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  pointer-events: none;
}

.extra-image.flying-right {
  animation: fly-to-right 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  pointer-events: none;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  color: white;
  /* background-color: rgba(255, 255, 255, 0.4); */
}

.modal-content {
  background-color: rgba(255, 255, 255, 0.2);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  border-radius: 30px;
  width: 40%;
  position: relative;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Estilo para las áreas del mapa */
.area-highlight {
  opacity: 1; /* Cambia la opacidad al pasar el mouse */
  transition: opacity 0.3s ease-in-out; /* Agrega una transición suave */
}

/* Cambia la opacidad de vuelta al quitar el mouse */
.area-highlight:hover {
  opacity: 0.7; /* Cambia la opacidad al pasar el mouse sobre el área */
  background-color: lightyellow; /* Cambia el color de fondo al pasar el mouse sobre el área */
}

/* Estilo para un overlay de resaltado */
.highlight-overlay {
  position: absolute;
  background-color: rgba(
    255,
    255,
    0,
    0.5
  ); /* Color amarillo semitransparente */
  z-index: 10;
  display: none; /* Inicialmente oculto */
}

/* Añade estas clases para gestionar las transiciones */
.transition-background {
  transition: background-image 0.5s ease-in-out;
}

.transition-extra-image {
  transition: opacity 0.5s ease-in-out;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets */
@media screen and (max-width: 1024px) {
  .title-image {
    padding: 30px;
    max-width: 80vw;
    height: auto;
  }

  .extra-image {
    width: 200px;
  }

  #flapmanLink {
    bottom: -15px;
    left: 10px;
  }

  .button-container {
    top: 10px;
    right: 10px;
  }

  button img {
    width: 150px;
    height: 150px;
  }

  #btnFlapman {
    margin-right: 20px;
  }
}

/* Mobile landscape */
@media screen and (max-width: 768px) {
  .title-image {
    padding: 20px;
    max-width: 70vw;
  }

  .extra-image {
    width: 150px;
  }

  #flapmanLink {
    bottom: -10px;
    left: 10px;
  }

  .button-container {
    top: 5px;
    right: 5px;
  }

  button img {
    width: 100px;
    height: 100px;
  }

  #btnFlapman {
    margin-right: 10px;
  }

  .tittle {
    text-align: center;
  }
}

/* Mobile portrait */
@media screen and (max-width: 480px) {
  html, body {
    overflow-x: hidden;
  }

  .section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  .tittle {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .title-image {
    padding: 15px;
    max-width: 90vw;
    width: 100%;
    height: auto;
  }

  .button-container {
    position: fixed;
    top: 5px;
    right: 5px;
  }

  button img {
    width: 70px;
    height: 70px;
  }

  #btnFlapman {
    margin-right: 5px;
  }

  .extra-image {
    width: 120px;
    max-width: 30vw;
  }

  #flapmanLink {
    bottom: 5px;
    left: 5px;
  }

  .modal-content {
    width: 90%;
    margin: 20% auto;
    padding: 15px;
  }
}

/* Very small screens */
@media screen and (max-width: 360px) {
  .title-image {
    padding: 10px;
  }

  button img {
    width: 50px;
    height: 50px;
  }

  .extra-image {
    width: 90px;
  }

  #flapmanLink {
    bottom: 5px;
    left: 5px;
  }
}
