/* ======================================================
   🌈 VARIABLES GLOBALES
   ====================================================== */
:root {
  --font-main: 'Quicksand', sans-serif;

  /* 🎨 Colores base */
  --color-text: #333333;
  --color-white: #ffffff;
  --color-border: #ffd6e0;
  --color-shadow: rgba(255, 182, 193, 0.3);
  --color-accent: #ffb6c1;

  /* 🌈 Gradientes */
  --pastel-bg1: #fff0f5;
  --pastel-bg2: #ffe6f2;

  --forest-bg1: #e8f5e9;
  --forest-bg2: #d0f0d2;

  --ocean-bg1: #e0f7fa;
  --ocean-bg2: #c8ebf2;

  /* ✨ Transiciones */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.4s ease;
}

/* ======================================================
   🧁 ESTILO BASE
   ====================================================== */
body {
  margin: 0;
  font-family: var(--font-main);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  transition: background 0.6s ease;
  position: relative;
  color: var(--color-text);
}

/* 🌈 Temas */
.theme-pastel { background: linear-gradient(135deg, var(--pastel-bg1), var(--pastel-bg2)); }
.theme-forest { background: linear-gradient(135deg, var(--forest-bg1), var(--forest-bg2)); }
.theme-ocean  { background: linear-gradient(135deg, var(--ocean-bg1), var(--ocean-bg2)); }

/* ☁️ Fondo animado */
.clouds {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.cloud {
  position: absolute;
  background: radial-gradient(circle at 30% 30%, #ffffff, #fdfdfd, rgba(255, 255, 255, 0.9));
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.95;
  animation: moveCloud 60s linear infinite;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.8);
  z-index: 1;
}

.cloud:nth-child(1) { width: 120px; height: 70px; top: 15%; animation-duration: 70s; }
.cloud:nth-child(2) { width: 150px; height: 90px; top: 35%; animation-duration: 85s; }
.cloud:nth-child(3) { width: 100px; height: 60px; top: 55%; animation-duration: 60s; }
.cloud:nth-child(4) { width: 180px; height: 100px; top: 25%; animation-duration: 90s; }

@keyframes moveCloud {
  0% { transform: translateX(-10vw); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(110vw); opacity: 0; }
}

/* 🌈 Selector de tema */
.theme-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #ffffffcc;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 0 10px var(--color-shadow);
  z-index: 1000;
  backdrop-filter: blur(4px);
  transition: all var(--transition-medium);
}

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

/* 🧁 Contenedor principal */
.container {
  background: #ffffffbb;
  border-radius: 25px;
  box-shadow: 0 0 20px var(--color-shadow);
  padding: 30px;
  text-align: center;
  z-index: 2;
  position: relative;
  backdrop-filter: blur(8px);
}

/* ======================================================
   🧍‍♂️ FORMULARIO DE JUGADOR
   ====================================================== */
#player-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff3f7;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 10px var(--color-shadow);
}

#player-form input {
  padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--color-border);
  outline: none;
  font-size: 1rem;
  transition: border var(--transition-medium);
  text-align: center;
}

#player-form input::placeholder {
  color: #ff9eb9;
  font-style: italic;
}

#player-form button {
  background: linear-gradient(90deg, var(--color-accent), #ff7eb9);
  color: var(--color-white);
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-medium);
}

#player-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.6);
}

.avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

#player-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 0 8px var(--color-shadow);
}

#avatar-style,
#difficulty {
  padding: 8px;
  border-radius: 10px;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  cursor: pointer;
  font-weight: 600;
  transition: border var(--transition-medium);
}

#avatar-style:hover,
#difficulty:hover {
  border-color: var(--color-accent);
}

/* ======================================================
   🎮 INFORMACIÓN DURANTE EL JUEGO
   ====================================================== */
#player-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 10px;
}

#player-avatar-game {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 0 6px var(--color-shadow);
}

.info {
  display: none;
  justify-content: space-between;
  align-items: center;
  width: 400px;
  margin: 15px auto 0;
  background: #fff3f7cc;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 8px 15px;
  box-shadow: 0 0 10px var(--color-shadow);
  font-weight: 600;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 3;
}

.info.visible {
  display: flex;
}

.game-stats {
  display: flex;
  gap: 15px;
  font-size: 1.1rem;
}

/* ======================================================
   🍓 ÁREA DE JUEGO
   ====================================================== */
#game-area {
  position: relative;
  width: 400px;
  height: 500px;
  margin: 15px auto 10px;
  background: #fffafcaa;
  border-radius: 15px;
  box-shadow: 0 0 15px var(--color-shadow);
  overflow: hidden;
  display: none;
  z-index: 2;
}

.fruit {
  position: absolute;
  top: 0;
  font-size: 2rem;
}

#basket {
  position: absolute;
  bottom: 10px;
  left: 0;
  font-size: 3rem;
  width: 60px;
  text-align: center;
  transition: left 0.08s linear;
  display: none;
  box-sizing: border-box;
  pointer-events: none;
}

/* ======================================================
   🏆 RANKING FINAL
   ====================================================== */
#ranking {
  display: none;
  background: #fff3f7;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 0 15px var(--color-shadow);
}

#ranking h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--color-text);
}

.difficulty-block {
  background: rgba(255, 255, 255, 0.65);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px var(--color-shadow);
  animation: fadeIn 0.6s ease;
}

.difficulty-block h3 {
  margin: 0 0 6px 0;
  font-size: 1.2rem;
  color: var(--color-text);
}

.difficulty-block ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.difficulty-block ol li {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 4px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.difficulty-block ol li:hover {
  transform: translateX(4px);
}

#restart-btn {
  margin-top: 15px;
  background: var(--color-accent);
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-white);
  transition: background var(--transition-medium);
}

#restart-btn:hover {
  background: #ff8bb0;
}

/* ======================================================
   🌑 Pantalla de muerte
   ====================================================== */
#death-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 3rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#death-overlay.visible {
  display: flex;
  opacity: 1;
}

/* ======================================================
   ⚠️ PANEL DE PENALIZACIONES
   ====================================================== */
#penalties {
  position: absolute;
  right: -250px;
  top: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--color-border);
  border-radius: 15px;
  padding: 12px 15px;
  box-shadow: 0 0 10px var(--color-shadow);
  text-align: left;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  z-index: 5;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#penalties.hidden {
  opacity: 0;
  transform: translateX(50px);
  pointer-events: none;
}

#penalties h3 {
  margin-top: 0;
  text-align: center;
  color: #ff6699;
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 182, 193, 0.4);
}

#penalties ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

#penalties li {
  margin: 5px 0;
  padding: 5px 8px;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

#penalties li:hover {
  background: rgba(255, 182, 193, 0.15);
}

#penalties strong {
  color: #d6336c;
}

/* ✨ Animación suave */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ❌ contador de frutas perdidas */
.game-stats span.missed {
  color: #d6336c;
  font-weight: 700;
}

.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); }
}















