/* Portada "sala de arcade" de Games by Gnzalez.
   Archivo propio de la portada: css/style.css lo siguen usando las páginas de los juegos. */

:root {
  --night: #1B1433;
  --plum: #2B1F4E;
  --plum-edge: #3D2D6B;
  --shadow: #120B26;
  --gold: #FFD23F;
  --gold-deep: #B7791F;
  --bulb: #FFF1A8;
  --ink: #F4EEFF;
  --muted: #B9AEDB;
  --pink: #FF5FA2;
  --cyan: #3EE0D0;

  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --text: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  background-color: var(--night);
  /* Alfombra de arcade: confeti tenue que se repite */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke-width='3' stroke-linecap='round' opacity='.22'%3E%3Cpath d='M10 20l8-8 8 8 8-8' stroke='%23FF5FA2'/%3E%3Ccircle cx='86' cy='30' r='7' stroke='%233EE0D0'/%3E%3Cpath d='M66 92q10-14 20 0t20 0' stroke='%23FFD23F'/%3E%3Cpath d='M22 76l10 10M32 76l-10 10' stroke='%233EE0D0'/%3E%3C/g%3E%3Cg opacity='.22'%3E%3Crect x='52' y='50' width='6' height='6' fill='%23FF5FA2'/%3E%3Crect x='104' y='104' width='5' height='5' fill='%23FFD23F'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

img {
  max-width: 100%;
}

kbd {
  font-family: var(--text);
  font-weight: 700;
  font-size: 0.85em;
  color: var(--night);
  background: var(--muted);
  border-radius: 4px;
  padding: 0.05em 0.45em;
  box-shadow: 0 2px 0 var(--plum-edge);
}

/* ---------- Letrero ---------- */

.site-header {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem 0;
  text-align: center;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: clamp(0.75rem, 3vw, 1.5rem);
}

.sound-toggle {
  font-family: var(--text);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--plum);
  border: 2px solid var(--plum-edge);
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
  border-color: var(--gold);
}

.sound-toggle:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.marquee {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: clamp(1.4rem, 3.5vw, 2.4rem) clamp(1.3rem, 5vw, 3.75rem);
  background: linear-gradient(#3A1D5C, #24133F);
  border: 6px solid var(--shadow);
  border-radius: 14px;
  box-shadow: 0 0 0 4px var(--plum-edge), 0 18px 48px rgba(255, 210, 63, 0.16);
}

/* Dos capas de ampolletas desfasadas que se alternan: efecto de luces que corren */
.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 8px;
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--bulb) 0 3px, transparent 4px),
    radial-gradient(circle, var(--bulb) 0 3px, transparent 4px),
    radial-gradient(circle, var(--bulb) 0 3px, transparent 4px),
    radial-gradient(circle, var(--bulb) 0 3px, transparent 4px);
  background-size: 22px 14px, 22px 14px, 14px 22px, 14px 22px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

.marquee::before {
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  filter: drop-shadow(0 0 3px var(--gold));
  animation: bulbs-a 0.9s linear infinite;
}

.marquee::after {
  background-position: 11px 0, 11px 100%, 0 11px, 100% 11px;
  animation: bulbs-b 0.9s linear infinite;
}

@keyframes bulbs-a {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

@keyframes bulbs-b {
  0%, 49.9% { opacity: 0.25; }
  50%, 100% { opacity: 1; }
}

.marquee h1 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(1rem, 4.6vw, 3rem);
  line-height: 1.4;
  color: var(--gold);
  text-shadow: 3px 3px 0 #C2410C, 6px 6px 0 var(--shadow);
}

.tagline {
  max-width: 36rem;
  margin: 1.4rem auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  text-wrap: balance;
}

.crew {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.25rem, 2vw, 1.25rem);
  margin-top: 1.5rem;
  /* Piso bajo los personajes */
  background: linear-gradient(to bottom, transparent calc(100% - 8px), var(--plum-edge) 0);
}

.crew img {
  display: block;
  width: 64px;
  height: 96px;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.crew .lead {
  width: 96px;
  height: 144px;
}

.crew .facing-left {
  transform: scaleX(-1);
}

/* ---------- Sala de máquinas ---------- */

.arcade {
  max-width: 72rem;
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  padding: 0 1rem;
}

.arcade-intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
}

.arcade-intro h2 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  line-height: 1.5;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (hover: none) {
  .hint {
    display: none;
  }
}

.cabinets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
}

.cabinet {
  position: relative;
  --cab: var(--gold);
}

.cabinet-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: var(--plum);
  border: 4px solid var(--shadow);
  border-radius: 18px 18px 6px 6px;
  /* Molduras laterales del gabinete en el color del juego */
  box-shadow: inset 6px 0 0 var(--cab), inset -6px 0 0 var(--cab);
  overflow: hidden;
}

.cabinet-link:focus {
  outline: none;
}

.cabinet-link:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 5px;
}

.cabinet-marquee {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--cab);
  color: var(--night);
  border-bottom: 4px solid var(--shadow);
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

.screen {
  margin: 1rem 1rem 0;
  padding: 0.55rem;
  background: #0D0820;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--plum-edge);
}

.screen-glass {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.screen-glass img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82);
  transition: filter 0.2s ease;
}

/* Líneas de tele antigua */
.screen-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.6);
}

.panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.25rem 1.3rem;
}

.genre {
  align-self: flex-start;
  margin: 0;
  padding: 0.05rem 0.65rem;
  color: var(--cab);
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.desc {
  margin: 0;
}

.record {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.record.has-record {
  color: var(--gold);
  font-weight: 700;
}

.start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-top: auto;
  padding: 0.95rem 1rem;
  color: var(--night);
  background: var(--gold);
  border-radius: 6px;
  box-shadow: 0 5px 0 var(--gold-deep);
  font-family: var(--pixel);
  font-size: 0.8rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

/* Ranura de moneda */
.start::before {
  content: '';
  width: 9px;
  height: 18px;
  border-radius: 3px;
  background: var(--night);
  box-shadow: inset 0 0 0 2px #7A5A12;
}

.cabinet-link:hover .screen-glass img,
.cabinet-link:focus-visible .screen-glass img {
  filter: none;
}

.cabinet-link:hover .start,
.cabinet-link:focus-visible .start {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--gold-deep);
}

.sticker {
  position: absolute;
  top: -1.5rem;
  right: -0.4rem;
  padding: 0.45rem 0.6rem;
  color: var(--night);
  background: var(--pink);
  border: 3px solid var(--shadow);
  border-radius: 4px;
  font-family: var(--pixel);
  font-size: 0.65rem;
  transform: rotate(7deg);
  pointer-events: none;
}

/* Máquina destacada (el juego más nuevo): doble ancho con pantalla y panel lado a lado */
@media (min-width: 42rem) {
  .cabinet.featured {
    grid-column: span 2;
  }

  .cabinet.featured .cabinet-link {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: auto 1fr;
  }

  .cabinet.featured .cabinet-marquee {
    grid-column: 1 / -1;
    font-size: 0.9rem;
  }

  /* La pantalla ocupa todo el alto de la fila para no dejar espacio vacío */
  .cabinet.featured .screen {
    display: flex;
    flex-direction: column;
    margin: 1rem 0 1.3rem 1.25rem;
  }

  .cabinet.featured .screen-glass {
    flex: 1;
    aspect-ratio: auto;
    min-height: 14rem;
  }

  .cabinet.featured .panel {
    padding-top: 1.1rem;
  }
}

/* ---------- Pie ---------- */

.site-footer {
  max-width: 72rem;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding: 1.5rem 1rem 2rem;
  border-top: 4px dashed var(--plum-edge);
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* ---------- Pantallas chicas y movimiento reducido ---------- */

@media (max-width: 420px) {
  .crew .extra {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee::before {
    animation: none;
  }

  .marquee::after {
    animation: none;
    opacity: 0.25;
  }

  .screen-glass img,
  .start {
    transition: none;
  }
}
