body {
    font-family: 'Comic Neue', cursive;
    /* Fondo homogéneo de la app */
    background:
    radial-gradient(780px 480px at 18% 12%, rgba(255,212,92,.22), transparent 60%),
    radial-gradient(680px 520px at 82% 18%, rgba(97,214,255,.16), transparent 62%),
    radial-gradient(780px 520px at 52% 115%, rgba(124,123,255,.18), transparent 60%),
    radial-gradient(520px 380px at 40% 55%, rgba(59,231,196,.10), transparent 65%),
    linear-gradient(180deg, #0a1c2e 0%, #05111d 42%, #030a12 100%);
    background-attachment: fixed;
    background-size: cover;
    color: #fff7e3;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100dvh;
    text-align: center;
    flex-direction: column;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 5px;
}
/* Contenedor principal del juego */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    padding-top: 20px; /* 🔹 Espacio extra para evitar solapamiento */
    flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


@media (orientation: landscape) {
  .game-container {
    max-height: 100vh;
    height: 100vh;
    max-width: 90vw;         /* No forzamos tanto el ancho en horizontal */
    padding: 10px 20px 10px;
    overflow: hidden;
  }
}

/* TABLET vertical */
@media (min-width: 768px) {
  .game-container {
    max-width: 500px;
  }
}

/* Escritorio medio */
@media (min-width: 1024px) {
  .game-container {
    max-width: 600px;
  }
}

/* Escritorio grande */
@media (min-width: 1440px) {
  .game-container {
    max-width: 680px;
  }
}

/* Header del juego */
.wrapper {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* Puntuación */
.score-counter {
    font-size: 1.4em;
    color: var(--brand);
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 10px;
}

/* Área de juego */
.game-board {
    width: 100%;
    max-width: 350px;
    height: 450px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    margin-top: 70px; /* 🔹 Espacio extra para el área superior */
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Zona de espera del animal */
.waiting-animal {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 55px; /* 🔹 Ajuste para que quede visible sin solaparse */
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
}


/* Tamaño del animal en espera */
.waiting-animal img {
    width: 70px; /* 🔹 Ajusta este tamaño según el diseño */
    height: 70px;
    object-fit: contain;
}

/* Tamaño de los animales dentro del tablero */
.animal-ball {
    width: 50px; /* 🔹 Ajusta este tamaño según necesidad */
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
}



/* Logo del juego */
.game-logo {
    height: 50px;
    object-fit: contain;
}


#next-animal-container {
    font-size: 1em;
    color: #FFF;
}

#next-animal{
    width: 50px;
}


/* Zona de spawn (donde aparece el animal a arrastrar) */
#spawn-area {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

#current-animal {
    cursor: grab;
}

/* Tablero de juego (recipiente) */
#game-board {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    border: 2px solid #654321;
}

/* Línea límite superior */
#limit-line {
    position: absolute;
    top: 5%;
    width: 100%;
    height: 5px;
    background: red;
    opacity: 0.7;
}

/* Animales dentro del juego */
.animal {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    transition: transform 0.1s linear;
}

/* Pie de juego */
.game-footer {
    margin-top: 10px;
}

.reset-button {
    background: #FF4C4C;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.reset-button:hover {
    transform: scale(1.1);
}

.goBack-button {
    background: blue;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.reset-button:hover {
    transform: scale(1.1);
}

.animal-ball {
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    position: absolute;
}

/* Colores por animal */
.animal-ball.chicken { background-color: var(--brand); }  /* Amarillo pollo */
.animal-ball.hen { background-color: #FFA500; }      /* Naranja gallina */
.animal-ball.goat { background-color: #90EE90; }     /* Verde cabra */
.animal-ball.sheep { background-color: #E6E6E6; }    /* Gris oveja */
.animal-ball.cat { background-color: var(--brand); }      /* Dorado gato */
.animal-ball.dog { background-color: #D2B48C; }      /* Marrón claro perro */
.animal-ball.pig { background-color: #FFC0CB; }      /* Rosa cerdo */
.animal-ball.horse { background-color: #8B4513; }    /* Marrón oscuro caballo */
.animal-ball.cow { background-color: #FFFACD; }      /* Amarillo claro vaca */

.modal.hidden {
  display: none;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 20, 10, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#game-board canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
#game-board {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1.1; 
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  border: 2px solid #654321;
  position: relative;
  flex-shrink: 0;
}


.game-footer {
  padding: 10px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
}


