/* ========================================
   VIDEOJUEGOS · ESCENARIO GENERAL
======================================== */

html.juegos-activo {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

html.juegos-activo::-webkit-scrollbar {
    display: none;
}

body[data-tema="videojuegos"] {
    --fondo: #090c12;
    --acento: #d5dbe5;

    height: auto;
    overflow: visible;
}

body[data-tema="videojuegos"] .experiencia {
    display: block;

    height: auto;
    min-height: 100svh;

    padding: 0;
    overflow: visible;
}

body[data-tema="videojuegos"] .escena {
    display: block;

    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;

    margin: 0;
    padding: 0;
}

.vg {
    position: relative;

    height: 220vh;
    height: 220svh;

    color: #eef0f5;
    text-align: left;

    --vg-intro: 1;
    --vg-menu: 0;
    --vg-blur-intro: 0px;
    --vg-blur-menu: 8px;
}

.vg-escenario {
    position: sticky;
    top: 0;

    height: 100vh;
    height: 100dvh;

    overflow: hidden;
}

.vg-escenario>[aria-hidden="true"] {
    pointer-events: none;
}

.vg [hidden] {
    display: none !important;
}

.vg button {
    font: inherit;
}

/* ========================================
   PRESENTACIÓN INICIAL
======================================== */

.vg-intro {
    position: absolute;
    inset: 0;

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

    padding: 45px clamp(24px, 7vw, 120px);

    background: #11141b;

    text-align: center;
    overflow-y: auto;

    opacity: var(--vg-intro);
    filter: blur(var(--vg-blur-intro));
}

.vg-etiqueta {
    margin: 0 0 28px;

    color: #aebacd;

    font: 10px/1.6 monospace;
    letter-spacing: 3px;
}

.vg-titulo {
    max-width: 1100px;
    margin: 0;

    font-size: clamp(40px, 6.3vw, 86px);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -3px;

    text-wrap: balance;
}

.vg-titulo span {
    display: block;
    color: #aebdd7;
}

.vg-descripcion {
    max-width: 740px;
    margin-top: 30px;

    color: #a7afbd;

    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.85;
}

.vg-descripcion p {
    margin: 0;
}

.vg-descripcion p+p {
    margin-top: 16px;
}

.vg-acciones {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px 28px;

    margin-top: 30px;
}

.vg-boton,
.vg-volver {
    min-height: 44px;
    padding: 12px 18px;

    background: transparent;
    color: #c4cede;

    border: 1px solid #414b5b;
    border-radius: 3px;

    font: 11px monospace !important;
    cursor: pointer;
}

.vg-boton:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vg-volver {
    padding-inline: 0;
    border: 0;
}

/* ========================================
   MENÚ CINEMATOGRÁFICO
======================================== */

.vg-menu {
    position: absolute;
    inset: 0;

    overflow: hidden;
    isolation: isolate;

    background: #090c12;

    opacity: var(--vg-menu);
    filter: blur(var(--vg-blur-menu));
}

/* Escenario de fondo */

.vg-fondo {
    position: absolute;
    z-index: -3;
    inset: -2%;

    background-color: #111824;

    background-image:
        url("img/fondo.png"),
        radial-gradient(ellipse at 50% 45%,
            #283445,
            #080b11 75%);

    background-size: cover;
    background-position: center;

    transform: scale(1.02);

    animation: vg-ambiente 28s ease-in-out infinite alternate;
}

/* Oscurecimiento para conservar legibilidad */

.vg-menu::before {
    content: "";

    position: absolute;
    z-index: -2;
    inset: 0;

    background:
        linear-gradient(to bottom,
            rgba(5, 8, 14, 0.45),
            rgba(5, 8, 14, 0.15) 45%,
            rgba(5, 8, 14, 0.8)),
        radial-gradient(ellipse at center,
            rgba(5, 8, 14, 0.12),
            rgba(5, 8, 14, 0.75));

    pointer-events: none;
}

@keyframes vg-ambiente {
    from {
        transform: scale(1.02);
    }

    to {
        transform: scale(1.055);
    }
}

/* ========================================
   TÍTULO Y OPCIONES CENTRALES
======================================== */

.vg-menu-centro {
    position: absolute;
    inset: 0;

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

    padding: 35px 24px 120px;
    overflow-y: auto;

    text-align: center;
}

.vg-menu-titulo {
    margin: 0;

    color: #f1f2f4;

    font-family:
        Impact,
        "Arial Narrow",
        sans-serif;

    font-size: clamp(38px, 5vw, 68px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 1px;

    text-transform: uppercase;
}

.vg-menu-autor {
    margin: 14px 0 38px;

    color: #b5bdca;

    font: 9px monospace;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.vg-opciones {
    width: min(100%, 290px);

    display: grid;
    gap: 8px;
}

.vg-opcion {
    position: relative;

    width: 100%;
    min-height: 47px;
    padding: 13px 24px;

    background: transparent;
    color: #aeb5c0;

    border: 1px solid transparent;
    border-radius: 0;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 10px !important;
    line-height: 1.5;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;

    cursor: pointer;

    transition:
        color 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease;
}

.vg-opcion:hover,
.vg-opcion[aria-pressed="true"] {
    color: #ffffff;

    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(230, 237, 248, 0.65);
}

.vg-opcion[aria-pressed="true"]::before,
.vg-opcion[aria-pressed="true"]::after {
    content: "";

    position: absolute;
    top: 50%;

    width: 3px;
    height: 3px;

    background: #d5dbe5;

    transform: translateY(-50%);
}

.vg-opcion[aria-pressed="true"]::before {
    left: 12px;
}

.vg-opcion[aria-pressed="true"]::after {
    right: 12px;
}

/* ========================================
   DESCRIPCIÓN Y CONTROLES INFERIORES
======================================== */

.vg-pie {
    position: absolute;
    right: 24px;
    bottom: 24px;
    left: 24px;

    text-align: center;
}

.vg-ayuda {
    max-width: 650px;
    margin: 0 auto 13px;

    color: #c0c6d0;

    font-size: 11px;
    line-height: 1.7;
}

.vg-controles {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;

    color: #929cac;

    font: 9px monospace;
}

.vg-controles kbd {
    padding: 2px 5px;

    color: #c0c8d4;
    border: 1px solid #526073;
    border-radius: 2px;

    font: inherit;
}

.vg-presentacion {
    position: absolute;
    top: 22px;
    left: 26px;

    min-height: 40px;
    padding: 8px 0;

    background: transparent;
    color: #aeb8c9;
    border: 0;

    font: 10px monospace !important;
    cursor: pointer;
}

.vg-presentacion:hover {
    color: #ffffff;
}

/* ========================================
   CONTENIDO DE CADA OPCIÓN
======================================== */

.vg-detalle {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;

    padding:
        65px clamp(24px, 10vw, 170px) 40px;

    overflow-y: auto;

    background: rgba(8, 12, 19, 0.87);
}

.vg-detalle-etiqueta {
    margin: 0 0 22px;

    color: #aebdd7;

    font: 10px monospace;
    letter-spacing: 3px;
}

.vg-detalle-titulo {
    max-width: 850px;
    margin: 0;

    color: #f1f3f7;

    font-size: clamp(32px, 4.5vw, 62px);
    font-weight: 500;
    line-height: 1.13;
    letter-spacing: -2px;
}

.vg-detalle-texto {
    max-width: 740px;
    margin: 25px 0 0;

    color: #abb5c6;

    font-size: 14px;
    line-height: 1.9;
}

.vg-detalle-lista {
    max-width: 740px;
    margin: 24px 0 0;
    padding-left: 18px;

    color: #b9c4d5;

    font-size: 13px;
    line-height: 2;
}

.vg-detalle-volver {
    min-height: 44px;
    margin-top: 30px;
    padding: 10px 0;

    background: transparent;
    color: #c7d4ea;
    border: 0;

    font: 11px monospace !important;
    cursor: pointer;
}

.vg button:focus-visible {
    outline: 2px solid #c0cde3;
    outline-offset: 4px;
}

.vg-detalle-titulo:focus {
    outline: none;
}

/* ========================================
   CELULARES
======================================== */

@media (max-width: 600px) {
    .vg-intro {
        padding: 35px 24px;
    }

    .vg-titulo {
        font-size: clamp(35px, 8.5vw, 50px);
        letter-spacing: -1.5px;
    }

    .vg-descripcion {
        font-size: 13px;
    }

    .vg-menu-centro {
        padding-top: 70px;
        padding-bottom: 145px;
    }

    .vg-menu-autor {
        margin-bottom: 25px;
        letter-spacing: 3px;
    }

    .vg-opciones {
        width: min(100%, 250px);
    }

    .vg-pie {
        bottom: 18px;
    }

    .vg-ayuda {
        font-size: 10px;
    }

    .vg-presentacion {
        top: 12px;
        left: 24px;
    }

    .vg-detalle {
        justify-content: flex-start;
        padding: 65px 24px 35px;
    }

    .vg-detalle-texto {
        font-size: 13px;
    }
}

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

    .vg-intro,
    .vg-menu {
        filter: none;
    }

    .vg-opcion {
        transition: none;
    }
}

/* ========================================
   VIDEOJUEGOS · VISTA ÚNICA
======================================== */

html.juegos-activo,
body[data-tema="videojuegos"] {
  height: 100%;
  overflow: hidden;
}

body[data-tema="videojuegos"] .experiencia {
  display: block;

  height: 100vh;
  height: 100dvh;
  min-height: 0;

  padding: 0;
  overflow: hidden;
}

body[data-tema="videojuegos"] .escena {
  display: block;

  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;

  margin: 0;
  padding: 0;
}

body[data-tema="videojuegos"] .vg {
  height: 100%;
}

.vg-escenario {
  position: relative;

  width: 100%;
  height: 100%;
}

/* Ocultar la presentación anterior */

.vg-intro,
.vg-presentacion {
  display: none !important;
}

/* Mostrar directamente el menú */

.vg-menu {
  position: absolute;
  inset: 0;

  opacity: 1;
  filter: none;
}

/* ========================================
   IMAGEN DE FONDO
======================================== */

.vg-fondo {
  background-color: #101722;

  background-image:
    url("img/fondo.png"),
    radial-gradient(
      ellipse at center,
      #253144,
      #080b11 75%
    );

  background-position: center;
  background-size: cover;
}

/* Oscurecimiento moderado para leer el menú */

.vg-menu::before {
  background:
    linear-gradient(
      to bottom,
      rgba(5, 8, 14, 0.3),
      rgba(5, 8, 14, 0.15) 45%,
      rgba(5, 8, 14, 0.75)
    ),
    radial-gradient(
      ellipse at center,
      rgba(5, 8, 14, 0.1),
      rgba(5, 8, 14, 0.6)
    );
}

/* ========================================
   MENÚ E INTRODUCCIÓN
======================================== */

.vg-menu-centro {
  padding: 40px 24px 130px;
}

.vg-menu-autor {
  margin-bottom: 22px;
}

.vg-menu-introduccion {
  width: 100%;
  max-width: 540px;

  margin: 0 0 30px;

  color: #bcc5d2;

  font-size: 13px;
  line-height: 1.85;
  text-align: center;
  text-wrap: pretty;
}

/* ========================================
   CELULARES Y PANTALLAS BAJAS
======================================== */

@media (max-width: 600px) {
  .vg-menu-introduccion {
    max-width: 360px;

    font-size: 12px;
    line-height: 1.75;
  }
}

@media (max-height: 650px) {
  .vg-menu-centro {
    justify-content: flex-start;

    padding-top: 30px;
  }

  .vg-menu-titulo {
    font-size: 36px;
  }

  .vg-menu-autor {
    margin: 10px 0 16px;
  }

  .vg-menu-introduccion {
    margin-bottom: 18px;
  }

  .vg-opciones {
    gap: 4px;
  }

  .vg-opcion {
    min-height: 40px;
    padding-block: 10px;
  }
}