/* =========================================================
   ANDSIGIL GAMING
   Estilos exclusivos del catálogo de juegos
   ========================================================= */

.games {
  background-image: url("/assets/images/backgrounds/pages/knowledgeCono/fondoCuanticoGames.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* =========================================================
   CATÁLOGO DE JUEGOS
   ========================================================= */

.games__catalog {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 5vw, 90px);
  position: relative;
}

/* Joysticks de selección de curso */

.games__course {
  width: clamp(180px, 20vw, 300px);

  padding: 0;
  border: none;
  background: transparent;

  cursor: pointer;
}

.games__course img {
  display: block;
  width: 100%;
  height: auto;
}

/* =========================================================
   SELECCIÓN DE TRIMESTRES
   ========================================================= */

.games__term {
  width: clamp(180px, 20vw, 300px);

  padding: 0;
  border: none;
  background: transparent;

  cursor: pointer;
}

.games__term img {
  display: block;
  width: 100%;
  height: auto;
}

.games__term--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* =========================================================
   NAVEGACIÓN DEL CATÁLOGO
   ========================================================= */

.games__back {
  position: absolute;
  top: 20px;
  left: 20px;

  width: 55px;
  height: 55px;

  border: 2px solid #55dfff;
  border-radius: 50%;

  background: rgba(10, 20, 50, 0.85);
  color: #55dfff;

  font-size: 32px;
  cursor: pointer;

  box-shadow: 0 0 15px rgba(85, 223, 255, 0.6);
}

.games__back:hover {
  background: rgba(85, 223, 255, 0.2);
  box-shadow: 0 0 25px rgba(85, 223, 255, 0.9);
}

/* Contenedor dinámico de la cabecera */

.games__header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* =========================================================
   TARJETA INTEGRADA DE CATEGORÍAS
   ========================================================= */

.games__category-card {
  display: grid;
  grid-template-columns: 100px repeat(
      var(--category-columns, 1),
      minmax(0, 200px)
    );
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;

  width: fit-content;
  box-sizing: border-box;
  overflow: hidden;

  background: rgba(10, 20, 50, 0.88);
  border: 2px solid #55dfff;
  border-radius: 20px;

  box-shadow: 0 0 25px rgba(85, 223, 255, 0.35);
  transform: translateY(-12px);
}

/* Columna izquierda: sello del trimestre */

.games__category-header {
  grid-column: 1;
  grid-row: 1 / span 3;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;

  padding: 4px;
  border-right: 1px solid rgba(85, 223, 255, 0.35);
}

.games__category-header img {
  display: block;
  width: auto;
  max-width: 65px;
  height: auto;
}

/* Columna derecha: opciones */

.games__category-option {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 2px 8px;

  background: transparent;
  color: #ffffff;

  border: none;
  border-bottom: 1px solid rgba(85, 223, 255, 0.25);

  font-family: inherit;
  font-size: 10px;
  text-align: left;

  cursor: pointer;
}

.games__category-option:nth-child(3n + 1) {
  border-bottom: none;
}

.games__category-option img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.games__category-option:hover {
  background: rgba(85, 223, 255, 0.15);
}

.games__category-option:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -4px;
}

.games__category-option:nth-child(2),
.games__category-option:nth-child(3),
.games__category-option:nth-child(4) {
  border-right: 1px solid rgba(85, 223, 255, 0.35);
}

/* Imagen del curso dentro de la tarjeta */

.games__category-course {
  max-width: 42px;
}

/* =========================================================
   ANDSIGIL QUANTUM GALLERY
   Consola holográfica: marco, proyectores y base energética
   ========================================================= */

.games__gallery {
  --quantum-cyan: #55dfff;
  --quantum-violet: #9270ff;
  --quantum-orange: #ffb13e;

  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(975px, 82vw);
  min-width: 0;
  padding: 68px 55px 65px;
  overflow: hidden;
  transform: translateY(-10px);

  /* Marco octogonal: biseles en las cuatro esquinas */
  clip-path: polygon(
    4% 0,
    96% 0,
    100% 12%,
    100% 88%,
    96% 100%,
    4% 100%,
    0 88%,
    0 12%
  );
  border: 2px solid rgba(102, 225, 255, 0.85);
  border-radius: 35px;
  background:
    linear-gradient(
        90deg,
        rgba(36, 213, 255, 0.65),
        transparent 12%,
        transparent 88%,
        rgba(36, 213, 255, 0.65)
      )
      top / 100% 3px no-repeat,
    radial-gradient(
      ellipse at 50% 115%,
      rgba(13, 197, 255, 0.3),
      transparent 60%
    ),
    radial-gradient(
      ellipse at 50% 5%,
      rgba(30, 108, 255, 0.24),
      transparent 65%
    ),
    linear-gradient(
      155deg,
      rgba(5, 16, 54, 0.92),
      rgba(10, 21, 72, 0.78) 55%,
      rgba(23, 8, 63, 0.88)
    );
  box-shadow:
    inset 0 0 0 5px rgba(3, 20, 62, 0.8),
    inset 0 0 0 7px rgba(73, 205, 255, 0.45),
    inset 0 0 32px rgba(30, 174, 255, 0.3),
    0 0 28px rgba(42, 198, 255, 0.35),
    0 24px 60px rgba(0, 0, 25, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Barra superior, sin rótulos: grabados y segmentos de luz */
.games__gallery::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 12px;
  left: 7%;
  right: 7%;
  height: 34px;
  pointer-events: none;
  border-top: 2px solid rgba(74, 217, 255, 0.8);
  border-bottom: 1px solid rgba(49, 135, 229, 0.65);
  background:
    linear-gradient(
      125deg,
      transparent 0 12%,
      rgba(79, 225, 255, 0.85) 12% 12.5%,
      transparent 12.5% 81%,
      rgba(79, 225, 255, 0.85) 81% 81.5%,
      transparent 81.5%
    ),
    linear-gradient(
      90deg,
      transparent 4%,
      rgba(3, 16, 52, 0.75) 4% 62%,
      transparent 62% 70%,
      rgba(3, 16, 52, 0.7) 70% 94%,
      transparent 94%
    );
  box-shadow: 0 -5px 18px rgba(51, 209, 255, 0.35);
}

/* Halo inferior general, independiente de los cuatro proyectores */
.games__gallery::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 11%;
  right: 11%;
  bottom: 43px;
  height: 53px;
  border: 2px solid rgba(61, 232, 255, 0.88);
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(43, 201, 255, 0.27),
    rgba(139, 71, 255, 0.1) 55%,
    transparent 75%
  );
  box-shadow:
    0 0 18px rgba(63, 224, 255, 0.75),
    inset 0 0 22px rgba(73, 207, 255, 0.55),
    0 0 38px rgba(167, 74, 255, 0.35);
  transform: perspective(500px) rotateX(58deg);
  pointer-events: none;
}

/* =========================================================
   MARCO TECNOLÓGICO Y ACENTOS LATERALES
   ========================================================= */

.games__gallery-frame {
  position: absolute;
  z-index: 0;
  inset: 9px;
  pointer-events: none;
  border: 1px solid rgba(65, 221, 255, 0.55);
  border-radius: 26px;
  clip-path: polygon(
    4% 0,
    96% 0,
    100% 13%,
    100% 87%,
    96% 100%,
    4% 100%,
    0 87%,
    0 13%
  );
  box-shadow: inset 0 0 17px rgba(39, 185, 255, 0.28);
  background:
    /* cuatro segmentos anaranjados en las esquinas */
    linear-gradient(
        130deg,
        transparent 39%,
        #ffe27b 42%,
        #ff9b1e 58%,
        transparent 61%
      )
      left 10px top 15px / 42px 72px no-repeat,
    linear-gradient(
        50deg,
        transparent 39%,
        #ffe27b 42%,
        #ff9b1e 58%,
        transparent 61%
      )
      right 10px top 15px / 42px 72px no-repeat,
    linear-gradient(
        50deg,
        transparent 39%,
        #ffe27b 42%,
        #ff9b1e 58%,
        transparent 61%
      )
      left 10px bottom 15px / 42px 72px no-repeat,
    linear-gradient(
        130deg,
        transparent 39%,
        #ffe27b 42%,
        #ff9b1e 58%,
        transparent 61%
      )
      right 10px bottom 15px / 42px 72px no-repeat,
    /* franjas laterales tipo circuitería */
    repeating-linear-gradient(180deg, #36dfff 0 5px, transparent 5px 11px) left
      7px center / 9px 78px no-repeat,
    repeating-linear-gradient(180deg, #36dfff 0 5px, transparent 5px 11px) right
      7px center / 9px 78px no-repeat;
  filter: drop-shadow(0 0 9px rgba(255, 163, 39, 0.6));
}

/* Microindicadores en los laterales, sin contenido textual */
.games__gallery-frame::before,
.games__gallery-frame::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 105px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    to bottom,
    #5af0ff 0 7px,
    transparent 7px 15px
  );
  opacity: 0.8;
  filter: drop-shadow(0 0 6px #34caff);
}

.games__gallery-frame::before {
  left: 14px;
}
.games__gallery-frame::after {
  right: 14px;
}

/* =========================================================
   ESCENARIO DE CUATRO JUEGOS
   ========================================================= */

.games__gallery-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: clamp(10px, 2vw, 28px);
}

.games__game {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  min-width: 0;
  padding: 8px 2px 25px;
  border: 0;
  background: transparent;
  color: white;
  font-family: inherit;
  cursor: pointer;
  transition: transform 300ms ease;
}

/* Anillo de proyección bajo cada icono */
.games__game::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: 47px;
  height: 24px;
  border: 2px solid rgba(106, 230, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(25, 220, 255, 0.6),
    rgba(83, 73, 255, 0.25) 45%,
    transparent 72%
  );
  box-shadow:
    0 0 14px rgba(52, 215, 255, 0.85),
    0 0 22px rgba(219, 73, 255, 0.5);
  transform: perspective(300px) rotateX(48deg);
  pointer-events: none;
}

/* Haz de luz que proyecta el icono */
.games__game::after {
  content: "";
  position: absolute;
  z-index: -2;
  left: 18%;
  right: 18%;
  top: 5%;
  bottom: 60px;
  clip-path: polygon(27% 0, 73% 0, 100% 100%, 0 100%);
  background: linear-gradient(
    180deg,
    rgba(72, 207, 255, 0.02),
    rgba(72, 207, 255, 0.16) 80%,
    rgba(168, 68, 255, 0.28)
  );
  pointer-events: none;
}

.games__game img {
  display: block;
  position: relative;
  z-index: 1;
  width: min(100%, 165px);
  height: auto;
  max-height: 125px;
  object-fit: contain;
  filter: drop-shadow(0 9px 11px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 13px rgba(85, 223, 255, 0.3));
  animation: quantumFloat 4s ease-in-out infinite;
  transition: filter 300ms ease;
}

.games__game:nth-child(2) img {
  animation-delay: -1s;
}
.games__game:nth-child(3) img {
  animation-delay: -2s;
}
.games__game:nth-child(4) img {
  animation-delay: -3s;
}

/* Placas de nombre biseladas, sin tarjetas alrededor del icono */
.games__game-title {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: min(100%, 190px);
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 5px 8px;
  clip-path: polygon(
    9px 0,
    calc(100% - 9px) 0,
    100% 50%,
    calc(100% - 9px) 100%,
    9px 100%,
    0 50%
  );
  border-top: 1px solid rgba(113, 238, 255, 0.9);
  border-bottom: 1px solid rgba(113, 238, 255, 0.9);
  background: linear-gradient(
    180deg,
    rgba(8, 56, 111, 0.95),
    rgba(4, 22, 69, 0.94)
  );
  color: #f0faff;
  font-size: clamp(11px, 1.12vw, 16px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.3px;
  text-align: center;
  text-shadow: 0 0 8px rgba(83, 211, 255, 0.75);
  box-shadow: inset 0 0 10px rgba(66, 209, 255, 0.22);
}

.games__game:hover {
  transform: translateY(-9px) scale(1.045);
}
.games__game:hover img {
  filter: drop-shadow(0 12px 13px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 23px rgba(85, 223, 255, 0.85))
    drop-shadow(0 0 30px rgba(146, 112, 255, 0.55));
}
.games__game:focus-visible {
  outline: 2px solid var(--quantum-cyan);
  outline-offset: 4px;
  border-radius: 12px;
}

/* =========================================================
   REACTOR INFERIOR Y ESPACIO DEL SLIDER
   ========================================================= */

.games__gallery-energy {
  position: absolute;
  z-index: 1;
  left: 17%;
  right: 17%;
  bottom: 54px;
  height: 42px;
  border: 2px solid rgba(75, 213, 255, 0.65);
  border-radius: 50%;
  box-shadow:
    0 0 15px rgba(68, 224, 255, 0.8),
    inset 0 0 15px rgba(153, 78, 255, 0.5);
  transform: perspective(500px) rotateX(62deg);
  pointer-events: none;
}

.games__gallery-navigation {
  position: absolute;
  z-index: 3;
  left: 36%;
  right: 36%;
  bottom: 9px;
  height: 31px;
  border-top: 1px solid rgba(79, 221, 255, 0.8);
  clip-path: polygon(
    12px 0,
    calc(100% - 12px) 0,
    100% 50%,
    calc(100% - 12px) 100%,
    12px 100%,
    0 50%
  );

  background: linear-gradient(
    90deg,
    rgba(7, 29, 87, 0.9),
    rgba(6, 68, 120, 0.95),
    rgba(7, 29, 87, 0.9)
  );

  box-shadow: inset 0 0 14px rgba(55, 194, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

/* La navegación permanece vacía hasta programar el slider. */

@keyframes quantumFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .games__game,
  .games__game img {
    animation: none;
    transition: none;
  }
}

/* =========================================================
   CONTROLES DEL SLIDER CUÁNTICO
   ========================================================= */

.games__gallery-navigation[hidden] {
  display: none;
}

.games__gallery-arrow {
  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;

  padding: 0;
  border: 1px solid rgba(85, 223, 255, 0.65);
  border-radius: 50%;

  background: rgba(8, 24, 58, 0.8);
  color: #8ceaff;

  font-size: 21px;
  cursor: pointer;

  box-shadow:
    inset 0 0 12px rgba(85, 223, 255, 0.12),
    0 0 14px rgba(85, 223, 255, 0.25);

  transition:
    background 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.games__gallery-arrow:hover:not(:disabled) {
  background: rgba(85, 223, 255, 0.2);
  box-shadow: 0 0 22px rgba(85, 223, 255, 0.6);
  transform: scale(1.08);
}

.games__gallery-arrow:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}

.games__gallery-arrow:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

.games__gallery-page {
  min-width: 65px;

  color: #b6f3ff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;

  text-shadow: 0 0 12px rgba(85, 223, 255, 0.65);
}
