/* 🍬 Fuente y fondo general */
body {
  font-family: 'Quicksand', sans-serif;
  background-color: #fff9f9;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  transition: background 0.4s ease;
  position: relative;
  overflow: hidden;
}

/* 🍑 Frutas flotantes (fondo animado) */
.frutas-fondo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.fruta {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.8;
  animation: flotar 10s linear infinite;
}

/* 🍉 Animación de movimiento vertical */
@keyframes flotar {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% {
    transform: translateY(-10vh) rotate(360deg);
    opacity: 0;
  }
}

/* 🌈 Selector de tema (flotante arriba a la derecha) */
.theme-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #ffffffcc;
  border: 2px solid #ffd6e0;
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 0 10px rgba(255, 182, 193, 0.3);
  z-index: 1000;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.theme-switcher:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 182, 193, 0.5);
}

.theme-switcher select {
  border: none;
  background: transparent;
  font-size: 1.3rem;
  outline: none;
  cursor: pointer;
}

/* 🍭 Contenedor general */
.container {
  text-align: center;
  max-width: 800px; /* antes: 600px */
  padding: 30px; /* un poco más de aire */
  background: #ffffffcc;
  box-shadow: 0 0 20px rgba(255, 182, 193, 0.3);
  border-radius: 20px;
  position: relative;
  z-index: 2;
}

/* 🍭 Títulos */
h1 {
  color: #ff7eb9;
  margin-bottom: 15px;
}

/* 🧁 Info y botones */
.info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

/* 🍬 Botones generales del juego */
.btn-juego {
  background-color: #ffd6e0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
  box-shadow: 0 0 10px rgba(255, 182, 193, 0.3);
  padding: 10px 18px;
}

/* 🌸 Efecto hover para todos */
.btn-juego:hover {
  background-color: #ffb6c1;
}

/* ▶️ Botón "Comenzar" */
#start-btn {
  padding: 8px 15px; /* un poquito más pequeño */
}

/* 🔙 Botón "Volver al inicio" */
.volver-inicio {
  margin-top: 15px;
  text-align: center;
}


.timer {
  font-size: 1rem;
}

/* 🎮 Tablero del juego */
.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px; /* antes 10px */
  margin-bottom: 10px;
  justify-items: center; /* centra las cartas */
}

/* 🃏 Carta base */
.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  cursor: pointer;
  max-width: 110px; /* evita que crezcan demasiado */
}
/* Ambas caras */
.card .cara {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Frente (fruta) */
.cara.frente {
  background-color: #fff;
  transform: rotateY(180deg);
  z-index: 2;
}

/* Dorso */
.cara.dorso {
  background-color: #ffeef5;
  z-index: 1;
}

/* 🎴 Voltear */
.card.flipped {
  transform: rotateY(180deg);
}

/* ✨ Efecto de brillo al acertar */
@keyframes brillo {
  0% { box-shadow: 0 0 0px #ffb6c1; transform: scale(1); }
  50% { box-shadow: 0 0 20px #ffcce5; transform: scale(1.1); }
  100% { box-shadow: 0 0 0px #ffb6c1; transform: scale(1); }
}

.card.acertada {
  animation: brillo 0.8s ease;
  border: 2px solid #ffb6c1;
  background-color: #fff0f6;
}

/* 🏆 Ranking */
.ranking {
  background-color: #fff3f7;
  padding: 10px;
  border-radius: 12px;
  margin-top: 0px;
}

.ranking h2 {
  color: #ff7eb9;
}

#ranking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#ranking-list li {
  background-color: #ffeef5;
  border-radius: 8px;
  margin: 5px 0;
  padding: 8px;
  text-align: left;
}

#ranking-list li strong {
  color: #ff7eb9;
}

#ranking-list li small {
  color: #999;
  font-size: 0.8em;
}

/* 🩷 FORMULARIO */
#player-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff3f7;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 0 10px rgba(255, 182, 193, 0.3);
  animation: fadeIn 0.6s ease forwards;
}

#player-form label {
  font-weight: 600;
  color: #ff7eb9;
  text-align: left;
}

#player-form input,
#player-form select {
  padding: 8px;
  border: 2px solid #ffd6e0;
  border-radius: 10px;
  font-family: 'Quicksand', sans-serif;
  outline: none;
  transition: border 0.3s;
}

#player-form input:focus,
#player-form select:focus {
  border-color: #ffb6c1;
}

#player-form button {
  background-color: #ffd6e0;
  border: none;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

#player-form button:hover {
  background-color: #ffb6c1;
}

#form-msg {
  font-weight: 600;
  margin-top: 5px;
}

/* 🌸 Animaciones */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeIn 0.6s ease forwards;
}

.fade-out {
  opacity: 1;
  transform: translateY(0);
  animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* 🌈 Temas */
.theme-pastel { background: linear-gradient(135deg, #fff9f9, #fff0f5); }
.theme-forest { background: linear-gradient(135deg, #e8f5e9, #d0f0d2); }
.theme-ocean { background: linear-gradient(135deg, #e0f7fa, #c8ebf2); }

.footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  color: #ff69b4;
  opacity: 0.9;
  animation: fadeIn 1.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}




