/* ================================================
   APOJEMA — STREAMER CARD
   css/style.css
================================================ */

/* ── Variables globales ── */
:root {
  --red:         #C0182A;
  --red-dark:    #8B0000;
  --red-glow:    rgba(192, 24, 42, 0.6);
  --red-glow-sm: rgba(192, 24, 42, 0.3);
  --gold:        #FFD700;
  --gold-glow:   rgba(255, 215, 0, 0.4);
  --card-bg:     rgba(10, 10, 10, 0.82);
  --white:       #FFFFFF;
  --gray-light:  #A0A0A0;
  --card-width:  480px;
  --radius:      16px;
}

/* ── Reset y base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: #000;
}

/* ================================================
   CAPA 1 — FONDO MOSAICO
================================================ */
#bg-mosaic {
  position: fixed;
  inset: 0;
  display: grid;
  /* Columnas automáticas según el ancho de pantalla */
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  /* Animación de scroll vertical infinito */
  animation: bgScroll 40s linear infinite;
  /* El doble de alto para que el loop sea suave */
  height: 200vh;
  top: -50vh;
  z-index: 0;
}

@keyframes bgScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(25vh); }
}

/* Cada imagen del mosaico */
#bg-mosaic img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  filter: saturate(0.7) brightness(0.6);
  transition: filter 0.4s;
}

/* ================================================
   CAPA 2 — OVERLAY OSCURO
================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0,0,0,0.70) 0%,
    rgba(80,0,10,0.45) 50%,
    rgba(0,0,0,0.80) 100%
  );
  z-index: 1;
}

/* ================================================
   CAPA 3 — SCANLINES
================================================ */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* ================================================
   CAPA 4 — WRAPPER Y CARD
================================================ */
.wrapper {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.card {
  width: 100%;
  max-width: var(--card-width);
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(192, 24, 42, 0.4);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(192, 24, 42, 0.15),
    0 0 40px rgba(192, 24, 42, 0.2),
    0 0 80px rgba(0, 0, 0, 0.6);
  padding: 40px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;

  /* Animación de entrada */
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================================================
   CAPA 5 — AVATAR
================================================ */
.avatar-ring {
  position: relative;
  width: 116px;
  height: 116px;
  margin-bottom: 20px;
  animation: ringPulse 2.4s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { filter: drop-shadow(0 0 6px var(--red-glow)); }
  50%       { filter: drop-shadow(0 0 16px var(--red-glow)); }
}

/* Anillo exterior decorativo */
.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--red);
  animation: ringRotate 8s linear infinite;
  /* Corte del anillo para el efecto estilo gaming */
  clip-path: polygon(0 0, 100% 0, 100% 72%, 60% 100%, 0 100%);
}

/* Segundo anillo, girando al revés */
.avatar-ring::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(192, 24, 42, 0.35);
  animation: ringRotate 12s linear infinite reverse;
}

@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--red-dark);
  display: block;
}

/* ================================================
   CAPA 6 — NOMBRE Y TAGLINE
================================================ */
.name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-align: center;
  text-shadow:
    0 0 12px var(--gold-glow),
    0 0 30px rgba(255, 215, 0, 0.2);
  margin-bottom: 8px;
  /* Animación de glow del nombre */
  animation: nameGlow 3s ease-in-out infinite alternate;
}

@keyframes nameGlow {
  from { text-shadow: 0 0 8px var(--gold-glow), 0 0 20px rgba(255,215,0,0.15); }
  to   { text-shadow: 0 0 18px var(--gold-glow), 0 0 40px rgba(255,215,0,0.35); }
}

.tagline {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 300;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: var(--gray-light);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* ================================================
   SEPARADOR
================================================ */
.divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--red);
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--red-glow);
}

/* ================================================
   CAPA 7 — BOTONES DE REDES SOCIALES
================================================ */
.social-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Botón base */
.social-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform       0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color    0.22s ease,
    background      0.22s ease,
    box-shadow      0.22s ease;

  /* Entrada escalonada — la asigna JS con style.animationDelay */
  animation: btnIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes btnIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Efecto de brillo que pasa al hacer hover */
.social-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  transition: left 0.4s ease;
}

.social-btn:hover::before {
  left: 150%;
}

/* Hover: usa el color CSS var de cada plataforma */
.social-btn:hover {
  transform: translateX(5px) scale(1.01);
  border-color: var(--btn-color);
  background: rgba(var(--btn-rgb), 0.12);
  box-shadow: 0 0 18px rgba(var(--btn-rgb), 0.25),
              inset 0 0 12px rgba(var(--btn-rgb), 0.06);
}

/* Icono del botón */
.social-btn .btn-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  color: var(--btn-color);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.social-btn:hover .btn-icon {
  transform: scale(1.15) rotate(-4deg);
}

/* Nombre de la red */
.social-btn .btn-label {
  flex: 1;
  text-transform: uppercase;
}

/* Flecha derecha */
.social-btn .btn-arrow {
  font-size: 0.8rem;
  color: var(--gray-light);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.22s, transform 0.22s;
}

.social-btn:hover .btn-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ================================================
   PIE DE CARD
================================================ */
.card-footer {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.7rem;
  color: rgba(160, 160, 160, 0.45);
  text-align: center;
  margin-top: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ================================================
   RESPONSIVE
================================================ */

/* Tablet */
@media (max-width: 540px) {
  #bg-mosaic {
    grid-template-columns: repeat(3, 1fr);
  }
  .card {
    padding: 32px 20px 20px;
  }
  .name {
    font-size: 1.65rem;
  }
}

/* Móvil pequeño */
@media (max-width: 380px) {
  #bg-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }
  .avatar-ring {
    width: 90px;
    height: 90px;
  }
  .name {
    font-size: 1.4rem;
  }
  .social-btn {
    padding: 11px 14px;
    font-size: 0.88rem;
  }
}

/* Desktop grande */
@media (min-width: 1200px) {
  #bg-mosaic {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Accesibilidad: desactiva animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  #bg-mosaic,
  .avatar-ring,
  .name,
  .card {
    animation: none;
  }
  .social-btn {
    animation: none;
  }
}
