/* =========================================================================
   PALAG · juegos.css
   -------------------------------------------------------------------------
   Sección "Juegos" (#/juegos): dos portadas tipo afiche / cartucho retro.
   ========================================================================= */

.jg { padding-top: 30px; padding-bottom: 50px; }
.jg-cab h1 {
  margin: 0 0 10px;
  font-family: var(--f-pixel);
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--neon-lima);
  text-shadow: 4px 4px 0 var(--neon-brasa), 8px 8px 0 rgba(255, 79, 43, .35);
}
[data-theme="claro"] .jg-cab h1 { color: var(--acento); text-shadow: 4px 4px 0 var(--acento-2); }
.jg-cab p { margin: 0 0 26px; color: var(--tinta-2); max-width: 56ch; }

.jg-grilla { display: grid; gap: 28px; }
@media (min-width: 900px) { .jg-grilla { grid-template-columns: 1fr 1fr; gap: 34px; } }

/* La portada */
.jg-portada {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 540px;
  overflow: hidden;
  color: #f3ece1;
  text-decoration: none;
  isolation: isolate;
  background: #000;
  border: 4px solid #000;
  border-radius: 16px;
  box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), 8px 8px 0 var(--acento-2);
  transition: transform .25s, box-shadow .25s;
}
.jg-portada:hover, .jg-portada:focus-visible { transform: translate(-3px, -3px); box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), 12px 12px 0 var(--acento-2); }
.jg-portada:focus-visible { outline: 3px dashed var(--neon-lima); outline-offset: 6px; }
.jg-paraiso { box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), 8px 8px 0 #5f8f3a; }
.jg-paraiso:hover, .jg-paraiso:focus-visible { box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), 12px 12px 0 #5f8f3a; }

.jg-fondo {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.jg-bici .jg-fondo { background-position: center bottom; filter: saturate(1.15); }
.jg-portada:hover .jg-fondo, .jg-portada:focus-visible .jg-fondo { transform: scale(1.08); }

/* Sombra para que el texto se lea */
.jg-velo {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05) 0%, rgba(0, 0, 0, .1) 30%, rgba(8, 6, 5, .86) 66%, rgba(8, 6, 5, .95) 100%);
}
.jg-portada::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 3px);
}

/* Escena (dibujos arriba) */
.jg-escena { position: relative; flex: 1 1 auto; min-height: 250px; display: flex; align-items: flex-end; justify-content: center; }
.jg-escena img { image-rendering: pixelated; display: block; }

/* --- Hoy bici? --- */
.jg-bicicleta { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); color: var(--neon-lima); filter: drop-shadow(5px 5px 0 #000); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.jg-bici-ico { width: clamp(110px, 24vw, 150px); height: auto; aspect-ratio: 1; }
.jg-bici:hover .jg-bicicleta { transform: translateX(-50%) translateX(14px) rotate(-5deg); }
.jg-caras { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; }
.jg-caras img { width: 46px; height: 46px; margin: 0 -3px; object-fit: cover; object-position: top; border: 3px solid #000; background: #2a2018; }
.jg-obs { position: absolute; font-size: 38px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .6)); transition: transform .6s; }
.jg-obs-1 { left: 7%; bottom: 62px; }
.jg-obs-2 { right: 8%; bottom: 100px; font-size: 34px; }
.jg-obs-3 { right: 24%; top: 22px; font-size: 30px; opacity: .85; }
.jg-bici:hover .jg-obs-1 { transform: translateX(26px); }
.jg-bici:hover .jg-obs-2 { transform: translateX(-24px); }
.jg-bici:hover .jg-obs-3 { transform: translateX(-30px); }

/* --- El Paraíso Resiste --- */
.jg-defensa { display: flex; align-items: flex-end; justify-content: center; gap: 0; padding-bottom: 14px; position: relative; z-index: 2; }
.jg-defensa img { height: clamp(66px, 11vw, 92px); width: auto; margin: 0 -6px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .45)); }
.jg-defensa img:nth-child(odd) { transform: translateY(6px); }
.jg-lado { position: absolute; bottom: 14px; display: flex; align-items: flex-end; transition: transform .7s cubic-bezier(.3, .8, .3, 1); }
.jg-lado img { height: clamp(46px, 8vw, 64px); width: auto; margin: 0 -8px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .45)); }
.jg-lado img:nth-child(2) { transform: translateY(-14px); height: clamp(40px, 7vw, 54px); }
.jg-lado img:nth-child(3) { transform: translateY(8px); }
.jg-izq { left: 1%; }
.jg-der { right: 1%; }
.jg-der img { transform: scaleX(-1); }
.jg-der img:nth-child(2) { transform: scaleX(-1) translateY(-14px); }
.jg-der img:nth-child(3) { transform: scaleX(-1) translateY(8px); }
.jg-paraiso:hover .jg-izq { transform: translateX(26px); }
.jg-paraiso:hover .jg-der { transform: translateX(-26px); }
.jg-moneda {
  position: absolute;
  width: 14px; height: 14px;
  background: #f5c400;
  border: 3px solid #7a5a00;
  border-radius: 50%;
  box-shadow: inset 2px 2px 0 #fff3a0;
}
.jg-m1 { left: 28%; top: 30%; }
.jg-m2 { right: 27%; top: 22%; }
.jg-m3 { left: 40%; top: 56%; }
.jg-m4 { right: 36%; top: 48%; }

/* Texto */
.jg-texto { position: relative; padding: 18px 20px 22px; display: grid; gap: 8px; }
.jg-tag {
  justify-self: start;
  padding: 3px 8px;
  font-family: var(--f-pixel);
  font-size: 8px;
  text-transform: uppercase;
  color: var(--sobre-acento);
  background: var(--neon-ambar);
}
.jg-texto h2 {
  margin: 4px 0 0;
  font-family: var(--f-pixel);
  font-size: clamp(22px, 4.4vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--neon-lima);
  text-shadow: 3px 3px 0 #000, 6px 6px 0 var(--neon-brasa);
  transition: text-shadow .3s, filter .3s;
}
.jg-paraiso .jg-texto h2 { color: var(--neon-ambar); text-shadow: 3px 3px 0 #000, 6px 6px 0 #5f8f3a; }
.jg-portada:hover h2 { filter: brightness(1.25) drop-shadow(0 0 10px rgba(255, 220, 90, .55)); }
.jg-frase { margin: 0; font-family: var(--f-mano); font-size: 20px; color: var(--neon-ambar); }
.jg-texto p { margin: 0; font-size: 15px; line-height: 1.4; color: #d8d0c4; }
.jg-texto p.jg-frase { color: var(--neon-ambar); }
.jg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.jg-chips li { padding: 4px 9px; font-size: 12px; font-weight: 700; color: #f3ece1; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3); border-radius: 99px; }
.jg-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 8px; }
.jg-jugar { pointer-events: none; min-height: 46px; padding-inline: 26px; }
.jg-portada:hover .jg-jugar { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--tinta); }
.jg-record { font-size: 12px; color: #b8ab9a; }

@media (max-width: 560px) {
  .jg-portada { min-height: 0; }
  .jg-escena { min-height: 220px; }
  .jg-obs { font-size: 28px; }
  .jg-caras img { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .jg-portada, .jg-fondo, .jg-bicicleta, .jg-obs, .jg-lado, .jg-texto h2 { transition: none !important; }
  .jg-portada:hover, .jg-portada:hover .jg-fondo, .jg-portada:hover .jg-obs, .jg-portada:hover .jg-lado { transform: none !important; }
  .jg-bici:hover .jg-bicicleta { transform: translateX(-50%) !important; }
}

/* --- Leo Rompe, Hernán Arregla (edificio hecho con CSS) --- */
@media (min-width: 1280px) { .jg-grilla { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.jg-obra { box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), 8px 8px 0 #4aa3d8; }
.jg-obra:hover, .jg-obra:focus-visible { box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), 12px 12px 0 #4aa3d8; }
.jg-obra .jg-fondo { background: linear-gradient(180deg, #3d9fe0 0%, #9edcf7 55%, #e9f8ff 100%); }
.jg-obra .jg-texto h2 { color: #9edcf7; text-shadow: 3px 3px 0 #000, 6px 6px 0 #4aa3d8; }
.jg-edificio {
  position: absolute;
  left: 50%; bottom: 0;
  width: min(200px, 56%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px 8px;
  padding: 16px 12px 10px;
  background: #a65b45;
  border: 4px solid #000;
  border-bottom: 0;
  box-shadow: inset 0 6px 0 #d8c7a8;
}
.jg-edificio i { display: block; aspect-ratio: 24 / 28; background: #9fd8f0; border: 2px solid #3a2a22; box-shadow: inset 2px 2px 0 #e8f8ff; }
.jg-edificio i:nth-child(3n + 1) { background: #2a2430; box-shadow: none; }
.jg-edificio i:nth-child(7), .jg-edificio i:nth-child(11) { background: #6a8aa8; }
.jg-caida { position: absolute; top: -10px; font-size: 26px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .5)); animation: jg-caer 2.4s linear infinite; }
.jg-c1 { left: 40%; animation-delay: 0s; }
.jg-c2 { left: 52%; animation-delay: .8s; }
.jg-c3 { left: 60%; animation-delay: 1.6s; }
@keyframes jg-caer { from { transform: translateY(-20px) rotate(0); opacity: 1; } to { transform: translateY(240px) rotate(260deg); opacity: .9; } }
.jg-obreros { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; align-items: flex-end; gap: 4px; z-index: 2; }
.jg-obreros img { height: clamp(66px, 11vw, 88px); width: auto; image-rendering: pixelated; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .45)); }
.jg-obreros .jg-leo { height: clamp(86px, 14vw, 112px); }
.jg-martillo { font-size: 30px; align-self: center; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .5)); transform-origin: 20% 80%; transition: transform .3s; }
.jg-obra:hover .jg-martillo { transform: rotate(-35deg); }
@media (prefers-reduced-motion: reduce) { .jg-caida { animation: none; opacity: 0; } .jg-martillo { transition: none; } }
