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

/* ===============================
   BODY + FONDO
================================ */
body {
  height: 100vh;
  background: url("images/gifroku.gif") center / cover no-repeat;
  font-family: 'Press Start 2P', monospace;
  color: white;
  overflow: hidden;
}

/* ===============================
   PANTALLA PRINCIPAL
================================ */
.screen {
  position: relative;
  height: 100vh;
  width: 100vw;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 24px 16px 90px;
}

/* ===============================
   LOGO GRANDE + INTERACCIÓN
================================ */
.logo {
  width: min(1100px, 96vw);
  height: auto;

  pointer-events: auto;
  user-select: none;
  cursor: pointer;

  transition: transform 180ms ease, filter 180ms ease;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 0 rgba(0,0,0,0.35));
}

.logo:hover {
  transform: translateY(-4px) scale(1.01);
  filter: drop-shadow(0 14px 0 rgba(0,0,0,0.35)) brightness(1.06);
}

.logo:active {
  transform: translateY(-1px) scale(0.99);
}

.logo.is-hovering {
  animation: logo-wiggle 0.9s steps(2, end) infinite;
}

@keyframes logo-wiggle {
  0%, 100% { transform: translateY(-4px) scale(1.01); }
  50% { transform: translateY(-6px) scale(1.01); }
}

/* ===============================
   FOOTER
================================ */
.footer {
  position: fixed;
  bottom: 12px;
  left: 0;
  width: 100%;

  text-align: center;
  font-size: 10px;
  opacity: 1;

  color: white;

  text-shadow:
    0 1px 0 rgba(0,0,0,0.7),
    0 0 4px rgba(179, 0, 0, 0.9),
    0 0 10px rgba(179, 0, 0, 0.75);

  z-index: 5;
}

/* ===============================
   MODAL OVERLAY
================================ */
.menu-overlay {
  position: fixed;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.58);
  z-index: 9999;
}

.menu-overlay.open { display: flex; }

/* scanlines suaves para vibra CRT (opcional pero queda lindo) */
.menu-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.06) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 6px
  );
}

/* ===============================
   VENTANA MENÚ (BLANCA/ROJA + PIXEL BORDER + GLOW)
================================ */
.menu-window {
  width: min(560px, 92vw);
  background: #fffdfb;
  color: #b30000;

  /* borde “pixel” */
  border: 3px solid #b30000;

  /* esquinas pixeladas (8px step) */
  --px: 10px;
  clip-path: polygon(
    var(--px) 0%,
    calc(100% - var(--px)) 0%,
    100% var(--px),
    100% calc(100% - var(--px)),
    calc(100% - var(--px)) 100%,
    var(--px) 100%,
    0% calc(100% - var(--px)),
    0% var(--px)
  );

  overflow: hidden;

  /* sombra base + glow rojo pulsante */
  box-shadow:
    0 12px 0 rgba(0,0,0,0.45),
    0 0 0 6px rgba(179,0,0,0.20),
    0 0 22px rgba(179,0,0,0.20);

  animation: menu-pop 170ms ease-out, red-glow 1.9s ease-in-out infinite;
  position: relative;
}

/* entrada */
@keyframes menu-pop {
  from { transform: translateY(10px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* glow pulsante sutil */
@keyframes red-glow {
  0%, 100% {
    box-shadow:
      0 12px 0 rgba(0,0,0,0.45),
      0 0 0 6px rgba(179,0,0,0.18),
      0 0 22px rgba(179,0,0,0.18);
  }
  50% {
    box-shadow:
      0 12px 0 rgba(0,0,0,0.45),
      0 0 0 6px rgba(179,0,0,0.28),
      0 0 30px rgba(179,0,0,0.28);
  }
}

/* “bisel” interno para más onda */
.menu-window::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 2px solid rgba(179,0,0,0.35);
  clip-path: inherit; /* hereda la forma pixelada */
  opacity: 0.9;
}

/* ===============================
   BARRA SUPERIOR
================================ */
.menu-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;
  background: #ffffff;

  border-bottom: 3px solid #b30000;
}

/* Título con “lucecitas” */
.menu-title {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b30000;

  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-title::before {
  content: "● ● ●";
  font-size: 10px;
  letter-spacing: 0.2em;
  opacity: 0.85;
}

/* Botón cerrar */
.menu-close {
  background: transparent;
  color: #b30000;

  border: 3px solid #b30000;

  padding: 4px 8px;
  cursor: pointer;

  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  line-height: 1;

  /* pixel corners también */
  clip-path: polygon(
    8px 0%,
    calc(100% - 8px) 0%,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0% calc(100% - 8px),
    0% 8px
  );

  box-shadow: 0 3px 0 rgba(0,0,0,0.25);
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.menu-close:hover {
  background: #b30000;
  color: white;
}

.menu-close:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

/* ===============================
   CUERPO DEL MENÚ
================================ */
.menu-body {
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fffdfb;
  position: relative;
}

/* textura leve */
.menu-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background: repeating-linear-gradient(
    135deg,
    rgba(179,0,0,0.35),
    rgba(179,0,0,0.35) 1px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0) 7px
  );
}

/* ===============================
   ITEMS DEL MENÚ (GAME FEEL)
================================ */
.menu-item {
  position: relative;
  display: block;
  text-decoration: none;
  text-align: left;

  background: transparent;
  color: #b30000;

  border: 3px solid #b30000;

  padding: 14px 14px 14px 44px;
  font-size: 11px;

  text-transform: uppercase;
  letter-spacing: 0.14em;

  /* pixel corners */
  clip-path: polygon(
    10px 0%,
    calc(100% - 10px) 0%,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    10px 100%,
    0% calc(100% - 10px),
    0% 10px
  );

  box-shadow: 0 4px 0 rgba(0,0,0,0.20);
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

/* flecha selector */
.menu-item::before {
  content: ">";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.0;
}

/* hover seleccionado */
.menu-item:hover {
  background: #b30000;
  color: white;
  transform: translateY(-1px);
}

.menu-item:hover::before {
  opacity: 1;
}

/* active click */
.menu-item:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.20);
}

/* focus teclado */
.menu-item:focus {
  outline: 2px dashed #b30000;
  outline-offset: 6px;
}

/* Accesibilidad: menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .menu-window { animation: menu-pop 170ms ease-out; }
}

