/* =========================
   CONTENEDOR GENERAL
========================= */
#screen-clasifica {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f7faff, #eef3ff);
  overflow: hidden;
  animation: fadeIn 0.4s ease;
}

.clasifica-header {
  padding: 12px 16px;
}

.nav-back {
  background: rgb(233, 231, 231);
  border: none;
  font-size: 15px;
  color: #444;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.nav-back:hover {
  background: rgba(0,0,0,0.1);
}

.clasifica-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  padding: 16px 18px;
}

.clasifica-instruccion {
  text-align: center;
  padding: 10px;
}

.clasifica-instruccion h2 {
  font-size: 26px;
  color: #2b2b2b;
  margin-bottom: 6px;
}

.clasifica-instruccion p {
  font-size: 14px;
  color: #6b7280;
}

.clasifica-objetos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  min-height: 96px;
  position: relative;
}

.clasifica-item {
  width: 72px;
  height: 72px;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 18px;
  cursor: grab;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  touch-action: none;
  flex: 0 0 auto;
}

.clasifica-item:hover {
  transform: scale(1.1);
}

.clasifica-item.seleccionado {
  border: 3px solid #4e7cff;
  transform: scale(1.12);
  box-shadow: 0 8px 18px rgba(78,124,255,0.3);
}

.clasifica-item.clasificado {
  opacity: 0.25;
  transform: scale(0.9);
  pointer-events: none;
}

.clasifica-item.arrastrando {
  cursor: grabbing;
  transform: scale(1.15) rotate(-3deg);
  box-shadow: 0 14px 28px rgba(0,0,0,0.2);
  transition: none;
}

.clasifica-categorias {
  display: flex;
  gap: 14px;
}

.clasifica-categoria {
  flex: 1;
  min-height: 160px;
  background: white;
  border-radius: 22px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 3px solid transparent;
}

.clasifica-categoria:hover {
  transform: translateY(-3px);
}

.clasifica-categoria span {
  font-size: 34px;
}

.clasifica-categoria div:last-child {
  margin-top: 10px;
  min-height: 45px;
}

.clasifica-categoria.drag-sobre {
  border-color: #4e7cff;
  background-color: rgba(78,124,255,0.08);
  transform: translateY(-3px) scale(1.04);
}

.clasifica-categoria.acierto {
  animation: clasifica-pulso-ok 0.4s ease;
}
.clasifica-categoria.fallo {
  animation: clasifica-shake 0.4s ease;
}

.clasifica-footer {
  padding: 14px;
}

.clasifica-progreso-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #6dd5ed, #4e7cff);
  width: 0%;
  transition: width 0.35s ease;
}

body.acierto {
  animation: flashGreen 0.4s ease;
}

body.error {
  animation: flashRed 0.4s ease;
}

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

@keyframes flashGreen {
  0% { background: #e6ffe6; }
  100% { background: transparent; }
}

@keyframes flashRed {
  0% { background: #ffe6e6; }
  100% { background: transparent; }
}

@keyframes clasifica-pulso-ok {
  0%   { box-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 0 0 0 rgba(34,197,94,0.5); }
  100% { box-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 0 0 14px rgba(34,197,94,0); }
}

@keyframes clasifica-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@media (max-width: 600px) {
  .clasifica-item {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }

  .clasifica-categorias {
    flex-direction: column;
  }

  .clasifica-categoria {
    min-height: 140px;
  }
}

.sec-topbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.sec-back {
  background: white;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  transition: 0.2s;
}

.sec-back:hover {
  transform: scale(1.05);
  background: #f0f4ff;
}

/* ========== CARD DE INSTRUCCIONES ========== */
.animales-instruccion,
.clasifica-instruccion,
.reloj-instruccion,
.memoria-instruccion,
.sec-instruccion,
.vocal-objetivo-header,
.inicial-instruccion,
.manzanas-instruccion {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 32px;
  margin: 20px auto;
  max-width: 600px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.animales-instruccion h2,
.clasifica-instruccion h2,
.reloj-instruccion h2,
.memoria-instruccion h2,
.sec-instruccion h2,
.vocal-objetivo-header h2,
.inicial-instruccion h2,
.manzanas-instruccion h2 {
  margin: 0 0 12px 0;
  font-size: 1.6rem;
  color: var(--text-dark);
}

.animales-instruccion p,
.clasifica-instruccion p,
.reloj-instruccion p,
.memoria-instruccion p,
.sec-instruccion p,
.vocal-objetivo-header p,
.inicial-instruccion p,
.manzanas-instruccion p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-medium);
}
