@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

/* 🎨 Variables de color */
:root {
  --bg: #f0f4f8;
  --text: #1f2937;
  --primary: #3b82f6;
  --secondary: #9333ea;
  --success: #10b981;
  --glass: rgba(255, 255, 255, 0.7);
  --blur: 16px;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f1f5f9;
  --primary: #60a5fa;
  --secondary: #c084fc;
  --success: #34d399;
  --glass: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* 🧠 Contenedor principal */
.game-container {
  max-width: 880px;
  width: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

/* 🎮 Título */
h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 🏆 Panel de puntaje */
.score-panel {
  text-align: center;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.score-panel .score {
  font-weight: 700;
  color: var(--success);
  font-size: 1.4rem;
}

/* ⚙️ Controles */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  font-size: 1rem;
}
select, input[type="checkbox"] {
  padding: 0.5rem 0.7rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: white;
}
label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 📜 Frase en español */
#game-history {
  background: rgba(220, 240, 255, 0.9);
  padding: 1rem;
  border-radius: var(--radius);
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
  color: #1e3a8a;
  font-weight: 500;
}
[data-theme="dark"] #game-history {
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
}

/* 🧩 Tarjetas */
.noun-area {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.card {
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border: 2px solid #999;
  border-radius: 8px;
  background: #fff;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
  cursor: grab;
  width: fit-content;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.card.m { background-color: #bfdbfe; border-color: #60a5fa; }
.card.f { background-color: #fbcfe8; border-color: #f472b6; }
.card.n { background-color: #bbf7d0; border-color: #34d399; }
.card small {
  font-size: 0.85rem;
  color: #64748b;
}
[data-theme="dark"] .card {
  background: #1e293b;
  border-color: #475569;
  color: var(--text);
}

/* 🎯 Zona de respuesta */
.quiz-area {
  width: 100%;
}
.quiz-area > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr 1fr auto auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.drop-slot {
  min-height: 40px;
  padding: 1rem;
  border: 2px dashed #aaa;
  border-radius: 8px;
  text-align: center;
  background: #fff;
  position: relative;
  font-weight: bold;
  font-size: 1.1rem;
  transition: background 0.3s, transform 0.2s, border-color 0.2s;
}
.drop-slot:hover { background: #f3f4f6; }
.drop-slot.drop-accepted {
  animation: slotPulse 0.4s ease;
  border-color: #2563eb;
}
@keyframes slotPulse {
  0% { transform: scale(1); background-color: #e0f2fe; }
  50% { transform: scale(1.05); background-color: #bae6fd; }
  100% { transform: scale(1); background-color: #fff; }
}
[data-theme="dark"] .drop-slot {
  background: #1e293b;
  border-color: #475569;
  color: var(--text);
}
[data-theme="dark"] .drop-slot:hover {
  background: #334155;
}

/* Géneros */
.declined.m { color: #1d4ed8; }
.declined.f { color: #be185d; }
.declined.n { color: #047857; }

/* 🔊 Reproducción */
.replay-btn {
  background: transparent;
  color: var(--primary);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  transition: transform 0.2s;
}
.replay-btn:hover {
  transform: scale(1.2);
  color: #2563eb;
}
[data-theme="dark"] .replay-btn {
  color: #93c5fd;
}

/* 🔘 Botones generales */
button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}
button:hover {
  background: #2563eb;
}
.back-btn {
  width: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  font-size: 1.1rem;
  padding: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

/* 🌙 Botón modo oscuro */
.dark-btn {
  background: var(--primary);
  border-radius: 16px;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  color: white;
  cursor: pointer;
  border: none;
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 10;
  box-shadow: var(--shadow);
}

/* 💬 Frase generada */
.sentence-output {
  grid-column: 1 / -1;
  font-style: italic;
  margin-top: 0.5rem;
}

/* 🧠 Verbos con tooltip */
.verb-container {
  position: relative;
  text-align: center;
}
.tooltip {
  visibility: hidden;
  opacity: 0;
  background-color: #333;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.verb-container:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* ♻️ Botones secundarios */
.reset-btn {
  background: #f97316;
}
.reset-btn:hover {
  background: #ea580c;
}
.speak-all-btn {
  background: #10b981;
}
.speak-all-btn:hover {
  background: #059669;
}
.reset-btn, .speak-all-btn {
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

/* 📱 Responsive: botón volver fijo en móviles */
@media (max-width: 600px) {
  .back-btn {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    margin: auto;
    z-index: 20;
  }
}
/*empiezan otras mejoras,no tocar lo de arriba mucho a menos que sepas lo que haces*/
.logo-container {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  width: 220px;
  height: auto;
  z-index: 5;
}
.logo-container svg {
  width: 100%;
  height: auto;
}

/* Ajustar el isotype para que esté justo a la derecha de 🧠 Deklination Challenge sin inclinación */
.isotype-container {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: rgb(255, 200, 1);
  border-radius: 50%;
  padding: 10px;
}
.isotype-container img {
  width: 40px;
  height: auto;
}
/*otras mejoras abajo*/
/* 🌈 Mejoras muy notorias sin tocar tarjetas ni frase */

/* 🌟 EFECTOS VISUALES MODERNOS Y NOTORIOS — VERSIÓN OPTIMIZADA */

/* 🎇 Fondo animado con luces suaves */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, #93c5fd33, transparent 60%),
              radial-gradient(circle at 80% 60%, #f472b633, transparent 60%);
  z-index: -1;
  animation: backgroundGlow 12s ease-in-out infinite alternate;
}
@keyframes backgroundGlow {
  0% { filter: blur(10px); transform: scale(1); }
  100% { filter: blur(20px); transform: scale(1.05); }
}
[data-theme="dark"] body::before {
  background: radial-gradient(circle at 30% 40%, #33415544, transparent 60%),
              radial-gradient(circle at 70% 60%, #7c3aed33, transparent 60%);
}

/* ✨ Título principal con neon */
h1 {
  text-shadow: 0 0 1px var(--primary), 0 0 1px var(--secondary);
}

/* 🎯 Aparición suave de secciones */
.game-container > *:not(.noun-area):not(#game-history) {
  animation: slideUpFade 0.6s ease-out both;
}
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🔘 Botones con rebote y luz deslizante */
button:not(.card):not(.replay-btn) {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
button:not(.card):not(.replay-btn):hover {
  animation: bounce 0.4s ease;
}
@keyframes bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.1); }
  50%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
button:not(.card):not(.replay-btn)::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  z-index: 0;
  transform: rotate(25deg);
  animation: lightSweep 4s linear infinite;
}
@keyframes lightSweep {
  0% { transform: translateX(-100%) rotate(25deg); }
  100% { transform: translateX(100%) rotate(25deg); }
}

/* ✅ Efecto flash al aceptar respuesta */
.drop-slot.drop-accepted {
  animation: flashPulse 0.4s ease-in-out;
}
@keyframes flashPulse {
  0%   { background-color: #3b82f6; color: white; transform: scale(1); }
  50%  { background-color: #60a5fa; transform: scale(1.1); }
  100% { background-color: white; color: inherit; transform: scale(1); }
}
[data-theme="dark"] .drop-slot.drop-accepted {
  background-color: #2563eb;
  color: white;
}

/* 🌙 Botón modo oscuro con giro y brillo */
.dark-btn:hover {
  animation: rotateShine 0.6s ease-in-out;
}
@keyframes rotateShine {
  0% { transform: rotate(0deg) scale(1); box-shadow: none; }
  50% { transform: rotate(20deg) scale(1.1); box-shadow: 0 0 12px var(--primary); }
  100% { transform: rotate(0deg) scale(1); box-shadow: none; }
}

/* 🎛 Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--secondary));
  border-radius: 8px;
  transition: background 0.3s ease;
}

/*OTRAS MEJORAS VISUALES*/

/* 🪄 EFECTOS SORPRENDENTES Y MÁGICOS */

/* 🎆 Estrellas flotantes animadas */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(white 1px, transparent 1px),
    radial-gradient(white 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
  opacity: 0.3;
  animation: starsScroll 20s linear infinite;
  z-index: 0;
}
@keyframes starsScroll {
  0% { background-position: 0 0, 40px 40px; }
  100% { background-position: 80px 80px, 120px 120px; }
}

/* 🌟 Destellos mágicos al pasar por botones */
button:not(.card):not(.replay-btn)::after {
  content: "";
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: conic-gradient(from 180deg, transparent 0deg, white 90deg, transparent 180deg);
  opacity: 0.2;
  animation: shineSpin 6s linear infinite;
  z-index: -1;
}
@keyframes shineSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 💫 Efecto de sacudida al acertar */
.drop-slot.drop-accepted {
  animation: flashPulse 0.4s ease-in-out, shakeCorrect 0.3s ease;
}
@keyframes shakeCorrect {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* 🔮 Capa mágica que brilla al pasar por encima del contenedor */
.game-container:hover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), transparent, rgba(255,255,255,0.1));
  pointer-events: none;
  animation: magicSweep 1.5s ease-in-out forwards;
  border-radius: var(--radius);
  z-index: 1;
}
@keyframes magicSweep {
  0% { transform: translateX(-100%); opacity: 0; }
  50% { transform: translateX(0); opacity: 0.8; }
  100% { transform: translateX(100%); opacity: 0; }
}

/*cursor magico abajo*/

.bubble-trail {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(0, 255, 234, 0.245); /* color fucsia */
  box-shadow: 0 0 8px rgba(130, 233, 238, 0.518), 0 0 18px rgba(0, 191, 255, 0.547);
  animation: bubbleFloat 1.2s ease-out forwards;
  z-index: 9999;
}

@keyframes bubbleFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-20px) scale(2);
    opacity: 0;
  }
}

/*efectos chispas*/

.spark {
  position: fixed;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgb(0, 85, 255), rgb(0, 140, 255), rgb(0, 255, 208));
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: sparkFire 0.8s ease-out forwards;
  box-shadow: 0 0 8px rgb(0, 110, 255), 0 0 16px rgba(0, 191, 255, 0.633);
}

@keyframes sparkFire {
  0% {
    opacity: 1;
    transform: scale(1) translate(0, 0);
  }
  100% {
    opacity: 0;
    transform: scale(1.5)
      translate(
        calc(60px - 120px * random()),
        calc(60px - 120px * random())
      );
  }
}

/* 🌟 Pop-up de bienvenida */
#welcome-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  animation: fadeIn 0.6s ease-out;
}

.popup-content {
  background: white;
  color: #111827;
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: popIn 0.7s ease;
}
.popup-content h2 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
  color: #3b82f6;
}
.popup-content p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}
.popup-content button {
  background: linear-gradient(to right, #3b82f6, #9333ea);
  color: white;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.popup-content button:hover {
  transform: scale(1.05);
}

@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
// mejora visual de mensaje de feedback//

.voice-feedback {
  margin-top: 0.5em;
  font-weight: bold;
  transition: all 0.3s ease-in-out;
}


.voice-feedback span {
  font-weight: bold;
}
.voice-feedback del {
  color: gray;
  text-decoration: line-through;
}
