body {
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 10px;
  box-sizing: border-box;
  background-color: #f4f4f4;
}

* {
  box-sizing: border-box;
}

h1 {
  margin: 10px 0;
}

#configuracion,
#panel-grupos {
  margin: 10px 0;
}

#configuracion input,
#configuracion select,
#configuracion button,
#selectorGrupo {
  padding: 6px;
  font-size: 16px;
  margin: 4px;
}

#tablero {
  display: grid;
  gap: 8px;
  justify-content: center;
  align-content: center;
  margin: 15px auto;
  max-width: 98vw;
}

.carta {
  width: var(--ancho-carta);
  height: var(--alto-carta);
  background-color: #ffffff;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.imagen-carta {
  width: 100%;
  height: 100%;
  display: block;
}

.imagen-carta.contain {
  object-fit: contain;
}

.imagen-carta.fill {
  object-fit: fill;
}

.imagen-carta.cover {
  object-fit: cover;
}

/* ============================= */
/* 🔥 VENTANA DE VICTORIA */
/* ============================= */

.modal-victoria {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-victoria.oculto {
  display: none;
}

.modal-contenido {
  background: white;
  padding: 25px;
  border-radius: 18px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  text-align: center;
  animation: aparecer 0.3s ease;
}

.modal-contenido h2 {
  margin-top: 0;
  color: #1565c0;
}

.imagen-victoria {
  width: 220px;
  max-width: 90%;
  height: auto;
  margin: 10px auto;
  display: block;
}

.modal-contenido p {
  font-size: 16px;
  margin: 10px 0;
}

.modal-contenido button {
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background-color: #2196f3;
  color: white;
  cursor: pointer;
}

.modal-contenido button:hover {
  background-color: #1976d2;
}

/* Animación suave */
@keyframes aparecer {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}