/* Colores sacados del logo (medidos sobre el PNG, no a ojo):
   cian #00e1fb -> azul #2f86f6 -> indigo #4a6df7 -> violeta #8010f0 -> magenta #ce22fe,
   y el marino del contorno de las letras, #051947. El fondo es ese marino, mas oscuro. */
:root {
  --noche: #050a1f;
  --noche-2: #08102c;
  --panel: #0c1538;
  --borde: rgba(110, 150, 255, 0.16);
  --borde-fuerte: rgba(110, 150, 255, 0.34);
  --texto: #e9efff;
  --suave: #a3b2df;
  --tenue: #7383b3;

  --cian: #00e1fb;
  --azul: #2f86f6;
  --indigo: #4a6df7;
  --violeta: #8010f0;
  --magenta: #ce22fe;
  --marino: #051947;
  --grad: linear-gradient(90deg, #00e1fb 0%, #2f86f6 38%, #6a3cf5 70%, #ce22fe 100%);

  --titulo: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --cuerpo: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --radio: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--noche);
  color: var(--texto);
  font-family: var(--cuerpo);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fondo fijo: dos resplandores con los extremos del degradado del logo,
   y una grilla tenue que se desvanece hacia abajo. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(55vw 45vh at 8% -8%, rgba(0, 225, 251, 0.13), transparent 70%),
    radial-gradient(55vw 55vh at 96% 0%, rgba(128, 16, 240, 0.18), transparent 70%);
}
body::after {
  background:
    linear-gradient(rgba(110, 150, 255, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(110, 150, 255, 0.05) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: linear-gradient(#000, transparent 75%);
  mask-image: linear-gradient(#000, transparent 75%);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cian); outline-offset: 3px; border-radius: 4px; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- barra ---------- */
.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(5, 10, 31, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borde);
}
.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--titulo);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marca img { width: 40px; height: 40px; }
.marca em {
  font-style: normal;
  font-weight: 500;
  font-size: 0.7em;
  letter-spacing: 0.32em;
  color: var(--suave);
}
.barra nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.barra nav a {
  text-decoration: none;
  font-family: var(--titulo);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--suave);
  transition: color 0.2s;
}
.barra nav a:hover { color: var(--cian); }

/* ---------- portada ---------- */
.hero {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(36px, 7vh, 80px) 20px clamp(56px, 10vh, 110px);
  text-align: center;
}
.logo {
  width: clamp(210px, 28vw, 300px);
  height: auto;
  margin: 0 auto 8px;
  filter: drop-shadow(0 0 42px rgba(47, 134, 246, 0.35));
  animation: flotar 6s ease-in-out infinite;
}
h1 {
  margin: 0.2em 0 0.45em;
  font-family: var(--titulo);
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bajada {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--suave);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
}
.acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.pixeles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pixeles i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--c, var(--indigo));
  box-shadow: 0 0 18px var(--c, var(--indigo));
  opacity: 0.5;
  animation: titilar 5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* ---------- botones ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.5em;
  border: 0;
  border-radius: 10px;
  background: var(--grad);
  background-size: 160% 100%;
  background-position: 0 0;
  color: #fff;
  font-family: var(--titulo);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 10px 28px -10px rgba(128, 16, 240, 0.7);
  transition: background-position 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.boton:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(0, 225, 251, 0.55);
}
.boton.jugar::after { content: "→"; font-size: 1.1em; line-height: 1; }
.boton.apagado {
  background: transparent;
  border: 1px dashed var(--borde-fuerte);
  color: var(--tenue);
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* ---------- secciones ---------- */
.seccion {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 100px) clamp(16px, 4vw, 40px);
  text-align: center;
}
/* El rotulo copia el "GAMES" del logo: letras muy espaciadas entre dos barras de degradado */
.rotulo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  font-family: var(--titulo);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--texto);
}
.rotulo::before,
.rotulo::after {
  content: "";
  width: 52px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad);
}
.rotulo::before { transform: scaleX(-1); }
h2 {
  margin: 0.5em 0 1.3em;
  font-family: var(--titulo);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- catalogo ---------- */
.grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 28px;
  text-align: left;
}
.juego {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: linear-gradient(180deg, var(--panel), var(--noche-2));
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
/* La tarjeta NO se mueve con el hover. Subia 6 px y con el mouse cerca del borde de abajo
   quedaba afuera: perdia el hover, bajaba, lo recuperaba... y titilaba sin parar (medido:
   el borde pasaba de 764 a 758 y bajo el puntero, en 761, quedaba la grilla). */
.juego:hover {
  border-color: rgba(0, 225, 251, 0.45);
  box-shadow: 0 26px 60px -26px rgba(47, 134, 246, 0.6), 0 0 0 1px rgba(128, 16, 240, 0.25);
}
/* La imagen se agranda un 5 % y sobresale 5 px del marco. overflow: hidden la recorta
   quieta, pero mientras anima Chrome a veces la dibuja sin recortar y asoma por abajo y
   por las esquinas redondeadas. clip-path recorta tambien durante la animacion. */
.portada {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radio) - 1px) calc(var(--radio) - 1px) 0 0;
  clip-path: inset(0 round calc(var(--radio) - 1px) calc(var(--radio) - 1px) 0 0);
  background: #000;
}
.portada img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  /* capa propia desde el principio: si no, se crea y se destruye al empezar y terminar
     la animacion, y ese cambio tambien se ve como un parpadeo */
  will-change: transform;
}
.juego:hover .portada img { transform: scale(1.05); }
.portada::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(12, 21, 56, 0.95));
  pointer-events: none;
}
.insignia {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 6px 11px;
  border: 1px solid var(--borde-fuerte);
  border-radius: 999px;
  /* sin backdrop-filter: encima de la imagen que anima, el desenfoque se recalculaba en
     cada cuadro y sumaba al parpadeo. Un fondo casi opaco se lee igual. */
  background: rgba(5, 10, 31, 0.85);
  font-family: var(--titulo);
  font-weight: 700;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cuerpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 24px;
}
.juego h3 {
  margin: 0;
  font-family: var(--titulo);
  font-weight: 900;
  font-size: 1.32rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.genero {
  margin: -6px 0 0;
  color: var(--cian);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.descripcion { margin: 0; color: var(--suave); font-size: 0.98rem; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.etiquetas li {
  padding: 3px 10px;
  border: 1px solid rgba(74, 109, 247, 0.32);
  border-radius: 6px;
  background: rgba(74, 109, 247, 0.14);
  color: #cfd9ff;
  font-weight: 600;
  font-size: 0.78rem;
}
.cuerpo .boton { margin-top: auto; }
.juego.en-camino .portada img { filter: grayscale(0.7) brightness(0.7); }

/* La tarjeta de "se vienen mas" */
.juego.mas {
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 320px;
  padding: 32px;
  border-style: dashed;
  border-color: var(--borde-fuerte);
  background: rgba(12, 21, 56, 0.35);
  text-align: center;
}
.juego.mas:hover { transform: none; box-shadow: none; }
.juego.mas .descripcion { max-width: 260px; }
.icono-pixeles { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; }
.icono-pixeles i {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  animation: titilar 4s ease-in-out infinite;
}
.icono-pixeles i:nth-child(1) { background: var(--cian); }
.icono-pixeles i:nth-child(2) { background: var(--indigo); animation-delay: 0.5s; }
.icono-pixeles i:nth-child(3) { background: var(--violeta); animation-delay: 1s; }
.icono-pixeles i:nth-child(4) { background: var(--magenta); animation-delay: 1.5s; }

/* Solo en las tarjetas de los juegos que corren en Render, que se duermen sin trafico */
.nota-servidor { margin: 0; color: var(--tenue); font-size: 0.82rem; line-height: 1.4; }
.sin-js { list-style: none; padding: 0; font-size: 1.1rem; }

/* ---------- como se juega ---------- */
.pasos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.pasos li {
  padding: 28px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: rgba(12, 21, 56, 0.55);
}
.num {
  display: inline-block;
  font-family: var(--titulo);
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pasos h3 {
  margin: 14px 0 8px;
  font-family: var(--titulo);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pasos p { margin: 0; color: var(--suave); }

/* ---------- pie ---------- */
.pie {
  padding: 44px 20px 48px;
  border-top: 1px solid var(--borde);
  color: var(--tenue);
  font-size: 0.88rem;
  text-align: center;
}
.pie img { width: 110px; height: auto; margin: 0 auto 10px; }
.pie p { margin: 0; }

/* ---------- movimiento ---------- */
@keyframes flotar { 50% { transform: translateY(-8px); } }
@keyframes titilar { 50% { opacity: 0.15; transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* En el celular la barra queda solo con la marca: los links se pegaban al logo y repiten lo
   que ya hace el boton del hero ("Ver los juegos"). */
@media (max-width: 600px) {
  .barra nav { display: none; }
}

@media (max-width: 480px) {
  .rotulo { letter-spacing: 0.36em; }
  .rotulo::before, .rotulo::after { width: 32px; }
}
