:root {
  --color-fondo-inicio: #141b33;
  --color-fondo-fin: #2a1f4d;
  --color-panel: #1e2547;
  --color-acento: #ffb347;
  --color-acento-secundario: #ff6f91;
  --color-texto: #f5f1ff;
  --color-texto-suave: #b9b2d6;
  --color-foco: #ffb347;
  
  --radio-borde: 24px;
  --radio-borde-grande: 36px;
  --sombra-suave: 0 12px 32px rgba(0, 0, 0, 0.25);
  --espaciado-lateral: 16px;
  --fuente-base: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-fondo-inicio: #faf7ff;
    --color-fondo-fin: #faf7ff;
    --color-panel: #ffffff;
    --color-texto: #1b1430;
    --color-texto-suave: #6e6587;
    --color-acento: #d9851a;
    --color-acento-secundario: #c23859;
    --color-foco: #d9851a;
    --sombra-suave: 0 12px 32px rgba(27, 20, 48, 0.08);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--color-fondo-inicio) 0%, var(--color-fondo-fin) 100%);
  background-attachment: fixed;
  color: var(--color-texto);
  font-family: var(--fuente-base);
  line-height: 1.6;
  min-height: 100vh;
}

body {
  padding: 0 var(--espaciado-lateral);
}

:focus-visible {
  outline: 3px solid var(--color-foco);
  outline-offset: 4px;
  border-radius: 8px;
}

a {
  color: var(--color-texto);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-acento);
}

.texto-suave {
  color: var(--color-texto-suave);
}

.contenedor {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.cabecera {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 0;
}

@media (min-width: 768px) {
  .cabecera {
    flex-direction: row;
    justify-content: space-between;
  }
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-texto);
  letter-spacing: -0.03em;
}

.logo:hover {
  color: var(--color-acento);
}

.cabecera nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.hero {
  padding: 5rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.hero p {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: var(--color-texto-suave);
  max-width: 680px;
}

.boton, .boton-secundario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: var(--radio-borde);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.boton {
  background-color: var(--color-acento);
  color: #141b33;
}

.boton:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 179, 71, 0.4);
  color: #141b33;
}

@media (prefers-color-scheme: light) {
  .boton {
    color: #ffffff;
  }
  .boton:hover {
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(217, 133, 26, 0.4);
  }
}

.boton-secundario {
  background-color: transparent;
  color: var(--color-texto);
  border: 2px solid var(--color-acento);
}

.boton-secundario:hover {
  background-color: var(--color-panel);
  transform: translateY(-4px);
  color: var(--color-texto);
}

.tarjetas {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .tarjetas {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3rem;
  }
}

.tarjeta {
  background-color: var(--color-panel);
  border-radius: var(--radio-borde-grande);
  padding: 3rem 2rem;
  box-shadow: var(--sombra-suave);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.tarjeta h2 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.etiqueta {
  display: inline-block;
  background-color: var(--color-acento-secundario);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

@media (min-width: 600px) {
  .galeria {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
  }
}

.galeria img, .galeria .img-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radio-borde);
  background-color: rgba(185, 178, 214, 0.1);
}

.pie {
  text-align: center;
  padding: 5rem 0 3rem;
  border-top: 2px solid rgba(185, 178, 214, 0.1);
  margin-top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Las imágenes nunca desbordan ni se deforman por sus atributos width/height. */
img {
  max-width: 100%;
  height: auto;
}

@keyframes fadeTranslateIn {
  from {
    transform: translateY(30px);
  }
  to {
    transform: translateY(0);
  }
}

.animar-entrada {
  /* Solo desplazamiento: el contenido nunca queda invisible si la animación no corre
     (capturas, lectores, buscadores). */
  animation: fadeTranslateIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .animar-entrada {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Imagen destacada de un juego: se ve entera (formato 1024×500 de Play). */
.imagen-destacada {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 500;
  object-fit: contain;
  border-radius: var(--radio-borde);
  margin-top: 1.5rem;
}
