/* =============================================
   TARJETAS DE JUEGOS Y ALUMNOS — EVIN
   ============================================= */

/* ── Grid de tarjetas ────────────────────────────────────── */
.game-list,
.student-list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ── Tarjeta JUEGO — estilo carrusel ──────────────────────── */
.card-juego {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  padding: 0;
  background: transparent;
}

.card-juego:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.22);
}

/* Cabecera con gradiente e ilustración — igual que el slide */
.card-juego-header {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  overflow: hidden;
}

/* Patrón decorativo igual que el slide */
.card-juego-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.07) 0%, transparent 50%);
  pointer-events: none;
}

.card-juego-texto {
  flex: 1;
  z-index: 1;
}

.card-juego-tag {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
  backdrop-filter: blur(4px);
}

.card-juego-titulo {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.card-juego-ilustracion {
  flex: 0 0 auto;
  width: clamp(70px, 15vw, 110px);
  height: clamp(70px, 15vw, 110px);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
  animation: cardFloat 4s ease-in-out infinite;
}

.card-juego-ilustracion svg {
  width: 100%;
  height: 100%;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .card-juego-ilustracion { animation: none; }
}

/* Cuerpo de la tarjeta */
.card-juego-body {
  background: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-juego-body .badge {
  align-self: flex-start;
}

.card-juego-body p {
  font-size: 0.88rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-juego-body .card-meta {
  font-size: 0.82rem;
  color: #64748b;
}

.card-juego-body .card-botones {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-juego-body .btn {
  flex: 1;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  min-height: 44px;
  border-radius: 999px;
  background: #e63946;
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.card-juego-body .btn:hover { background: #c1121f; }

.card-juego-body .btn-secundario {
  flex: 1;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  min-height: 44px;
  border-radius: 999px;
  background: transparent;
  color: #1a2e4a;
  font-weight: 700;
  border: 2px solid #1a2e4a;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.card-juego-body .btn-secundario:hover {
  background: #1a2e4a;
  color: #fff;
}

/* Gradientes por juego */
.juego-grad-memoria     { background: linear-gradient(135deg, #1d3557 0%, #4361ee 100%); }
.juego-grad-grid        { background: linear-gradient(135deg, #0f4c75 0%, #1b6ca8 100%); }
.juego-grad-radar       { background: linear-gradient(135deg, #1b4332 0%, #2a9d8f 100%); }
.juego-grad-diferencias { background: linear-gradient(135deg, #3d0066 0%, #9b5de5 100%); }
.juego-grad-rasgos      { background: linear-gradient(135deg, #7a0c14 0%, #e63946 100%); }
.juego-grad-puzzle      { background: linear-gradient(135deg, #004d40 0%, #00897b 100%); }
.juego-grad-default     { background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%); }

/* ── Tarjeta base (alumnos) ───────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid #e8e8e8;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2e4a;
  margin: 0;
}

.card p {
  font-size: 0.92rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}

/* Badge de nivel */
.badge {
  display: inline-block;
  width: auto;
  align-self: flex-start;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-fácil   { background: #dcfce7; color: #166534; }
.badge-medio   { background: #fef9c3; color: #713f12; }
.badge-difícil { background: #fee2e2; color: #7f1d1d; }

/* ── Tarjetas de ALUMNOS ──────────────────────────────────── */
.card-alumno { position: relative; }

.alumno-evin-icon { display: none; }

.foto-carnet,
.avatar-alumno {
  display: block !important;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #4361ee;
  margin-bottom: 0.25rem;
  object-fit: cover;
  flex-shrink: 0;
}

.perfil-avatar {
  width: 72px;
  height: 72px;
  border: 3px solid rgba(255,255,255,0.3);
}

.badge-progreso {
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  width: auto;
}

.progreso-alto  { background: #dcfce7; color: #166534; }
.progreso-medio { background: #fef9c3; color: #713f12; }
.progreso-bajo  { background: #fee2e2; color: #991b1b; }

.card-acciones {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
}

.card-acciones .btn,
.card-acciones button {
  width: 100%;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.card-acciones .btn            { background: #4361ee; color: #fff; }
.card-acciones .btn:hover      { background: #3050cc; }
.card-acciones .btn-secundario { background: transparent; color: #1a2e4a; border: 2px solid #1a2e4a; }
.card-acciones .btn-secundario:hover { background: #1a2e4a; color: #fff; }
.card-acciones .btn-danger     { background: #e63946; color: #fff; }
.card-acciones .btn-danger:hover { background: #c1121f; }

/* ── Header de alumnos ────────────────────────────────────── */
.alumnos-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.alumnos-header input { flex: 1; min-width: 200px; }

.alumnos-header .btn {
  white-space: nowrap;
  padding: 0.5rem 1.25rem;
  min-height: 44px;
  border-radius: 999px;
  background: #4361ee;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}

/* ── Alto contraste ───────────────────────────────────────── */
body.alto-contraste .card-juego-body {
  background: #111 !important;
  border: 2px solid #fff !important;
}

body.alto-contraste .card-juego-body p,
body.alto-contraste .card-juego-body .card-meta {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body.alto-contraste .card-juego-body h3 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .game-list,
  .student-list { grid-template-columns: 1fr; }
  .card-acciones { flex-direction: column; }
  
}
