/* ============================================================
   Hub principal — Mundo Mágico
   Usa brand.css + ui-kit.css del /compartido/.
   ============================================================ */

.hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 24px 60px;
}

/* ----- Header con selfie manga ----- */
.hub-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
@media (min-width: 720px) {
  .hub-header { text-align: left; justify-content: flex-start; }
}

.hub-selfie {
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 6px solid var(--surface);
  box-shadow: 0 12px 28px rgba(0,0,0,0.15),
              0 0 0 4px var(--accent);
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-8px) rotate(1deg); }
}

.hub-titulos { flex: 1; min-width: 280px; }
.hub-titulo {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 0;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 2px 4px 0 rgba(244, 168, 184, 0.25);
}
.hub-sub-titulo {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin: 4px 0 8px;
  color: var(--fg-soft);
}
.hub-tagline {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fg-soft);
  font-style: italic;
}

/* ----- Grid de juegos ----- */
.hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 720px) {
  .hub-grid { grid-template-columns: 1fr 1fr; }
}

/* ----- Tarjeta de juego ----- */
.juego-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s var(--ease-bouncy),
              box-shadow 0.25s var(--ease-bouncy),
              border-color 0.25s ease;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  animation: pop-in 0.5s var(--ease-bouncy) both;
}
.juego-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--firma, var(--accent)) 0%, transparent 55%);
  opacity: 0.15;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.juego-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12),
              0 0 0 4px var(--firma, var(--accent));
  border-color: var(--firma, var(--accent));
}
.juego-card:hover::before { opacity: 0.28; }

.juego-emoji {
  font-size: 5rem;
  text-align: center;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}
.juego-nombre {
  margin: 0 0 4px;
  font-size: 1.6rem;
  text-align: center;
  color: var(--fg);
}
.juego-subtitulo {
  margin: 0 0 14px;
  text-align: center;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1rem;
}
.juego-descripcion {
  margin: 0 0 16px;
  color: var(--fg-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
  text-align: center;
}
.juego-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 20px;
  justify-content: center;
}
.tag-cozy {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  color: var(--fg-soft);
}
.juego-cta { text-align: center; }
.cta-proximo {
  display: inline-block;
  padding: 12px 22px;
  background: var(--bg);
  color: var(--fg-soft);
  font-style: italic;
  border-radius: var(--r-pill);
  border: 2px dashed var(--border);
}

.juego-proximamente { opacity: 0.65; cursor: not-allowed; }
.juego-proximamente:hover { transform: none; box-shadow: var(--shadow-card); border-color: var(--border); }
.juego-proximamente:hover::before { opacity: 0.15; }

/* ----- Footer ----- */
.hub-footer {
  margin-top: 60px;
  text-align: center;
  color: var(--fg-soft);
  font-size: 0.95rem;
}
.hub-separador { margin: 0 12px; opacity: 0.5; }

/* ============================================================
   LOGIN OVERLAY — cubre todo el sitio
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: var(--bg);
}
.login-fondo {
  position: absolute; inset: 0;
  z-index: -1;
  overflow: hidden;
}
.login-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(28px) brightness(0.6) saturate(1.2);
  transform: scale(1.15);
}
.login-fondo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(253, 249, 240, 0.55) 0%,
    rgba(244, 168, 184, 0.55) 100%);
}

.login-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.login-hero { margin-bottom: 32px; }
.login-selfie {
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 6px solid var(--surface);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25),
              0 0 0 4px var(--accent);
  object-fit: cover;
  object-position: center top;
  margin-bottom: 18px;
  animation: bob 4s ease-in-out infinite;
}
.login-titulo {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin: 0 0 8px;
  line-height: 1.15;
  text-shadow: 2px 4px 0 rgba(244, 168, 184, 0.25);
}
.login-sub {
  font-size: 1.05rem;
  color: var(--fg-soft);
  margin: 0;
}

/* Grid de perfiles */
.perfiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 540px;
  margin: 0 auto 28px;
}
@media (max-width: 520px) {
  .perfiles-grid { grid-template-columns: 1fr; }
}

.perfil-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px;
  background: var(--surface);
  border: 4px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: var(--font-display);
  transition: all 0.3s var(--ease-bouncy);
  box-shadow: var(--shadow-card);
}
.perfil-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  border-color: var(--accent);
}
.perfil-card.seleccionado {
  border-color: var(--sun-d);
  background: oklch(95% 0.08 80);
  box-shadow: 0 0 0 4px var(--sun-d), var(--shadow-card);
  transform: scale(1.05);
}

.perfil-foto {
  width: 160px; height: 160px;
  border-radius: 50%;
  background-image: url('personajes/manga-cuerpo-entero.jpeg');
  background-size: 280% auto;
  background-position: 28% top;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  transition: transform 0.3s var(--ease-bouncy);
}
.perfil-foto-juana { background-position: 21% 15%; }
.perfil-foto-papa  { background-position: 78% 15%; }
.perfil-card:hover .perfil-foto { transform: scale(1.05) rotate(-2deg); }

.perfil-nombre {
  font-size: 1.5rem;
  margin: 0;
  color: var(--fg);
  letter-spacing: 2px;
}
.perfil-emoji {
  position: absolute;
  top: -8px; right: -8px;
  font-size: 1.8rem;
  background: var(--sun);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 var(--sun-d);
  animation: wiggle 2s ease-in-out infinite;
}

/* Zona de clave */
.zona-clave {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  animation: pop-in 0.4s var(--ease-bouncy);
}
.zona-clave.oculto { display: none; }
.clave-prompt {
  margin: 0 0 14px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.input-clave-cozy {
  display: block;
  margin: 0 auto 16px;
  padding: 14px 22px;
  width: 100%;
  max-width: 320px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 4px;
  color: var(--accent-d);
  background: var(--bg);
  border: 3px solid var(--accent);
  border-radius: var(--r-md);
  outline: none;
  box-shadow: var(--shadow-bubbly-accent);
}
.input-clave-cozy:focus {
  border-color: var(--sun-d);
  box-shadow: 0 4px 0 var(--sun-d), 0 0 20px rgba(255, 216, 102, 0.4);
}
.input-clave-cozy.incorrecta {
  animation: shake-login 0.4s ease;
  border-color: var(--accent-d);
  background: oklch(95% 0.08 20);
}
.input-clave-cozy.correcta {
  animation: pop-in 0.3s var(--ease-bouncy);
  border-color: var(--mint-d);
  background: oklch(95% 0.08 160);
  color: var(--mint-d);
}
@keyframes shake-login {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.clave-acciones {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.clave-error {
  margin-top: 14px;
  padding: 10px 16px;
  background: oklch(95% 0.08 20);
  border: 2px dashed var(--accent);
  border-radius: var(--r-md);
  color: var(--accent-d);
  font-size: 0.95rem;
}
.clave-error.oculto { display: none; }

/* Saludo + logout en el hub */
.hub-saludo {
  margin-top: 8px;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.1rem;
  font-style: italic;
}
.link-logout {
  background: none; border: none;
  color: var(--fg-soft);
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.link-logout:hover { color: var(--accent); }

.oculto { display: none !important; }
