/* ==========================================================================
   XPlay Nin Store — Videojuegos en "modo consola" (js/consola.js)
   Como el inicio de una consola: arte del juego a pantalla completa, logo, precio y
   botones en grande, pestañas por consola arriba y una fila de portadas grandes abajo.
   Se usa en el inicio (#videojuegos) y en catalogo.html?c=juegos.
   ========================================================================== */
.dash {
  /* ancho de cada portada de la fila: crece con la pantalla (ancho y alto) */
  --tw: clamp(100px, min(10.4vw, 15.5svh), 186px);
  --dash-top: var(--top, 112px);            /* alto del encabezado de la página */
  --gc: #9be22f; --gc2: #03ace8;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: clamp(560px, calc(100svh - var(--dash-top)), 980px);
  color: #fff; background: #04060a;
  scroll-margin-top: var(--dash-top);
}
/* En el catálogo el encabezado es más alto (barra de categorías): portadas un poco menores en pantallas bajas */
.page-catalog .dash { --dash-top: var(--head-h); --tw: clamp(92px, min(10.2vw, 13.6svh), 184px); }
.page-catalog .dash__top { padding-top: 14px; }
.page-catalog .dash__tab { height: 42px; }

/* ---------- Fondo: arte del juego ---------- */
.dash__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.dash__art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06); transition: opacity .8s ease, transform 9s cubic-bezier(.2, .7, .2, 1);
}
.dash__art.is-on { opacity: var(--dim, .85); transform: scale(1); }
.dash__tint {
  position: absolute; inset: 0; mix-blend-mode: soft-light;
  background: radial-gradient(70% 80% at 78% 30%, color-mix(in srgb, var(--gc) 55%, transparent), transparent 70%);
  transition: background .8s;
}
.dash__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 6, 10, .9) 0%, rgba(4, 6, 10, .6) 30%, rgba(4, 6, 10, .08) 58%, rgba(4, 6, 10, .2) 100%),
    linear-gradient(0deg, rgba(4, 6, 10, .97) 0%, rgba(4, 6, 10, .72) 22%, rgba(4, 6, 10, 0) 48%),
    linear-gradient(180deg, rgba(4, 6, 10, .82) 0%, rgba(4, 6, 10, .35) 26%, rgba(4, 6, 10, 0) 44%);
}
.dash__scan {
  position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
}

/* ---------- Barra superior: marca, pestañas y reloj ---------- */
.dash__top {
  display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap;
  width: 100%; max-width: 1760px; margin-inline: auto; padding: 22px var(--gutter) 0;
}
.dash__brand { display: inline-flex; align-items: center; gap: 12px; }
.dash__dot { width: 10px; height: 10px; border-radius: 50%; background: #9be22f; box-shadow: 0 0 0 0 rgba(155, 226, 47, .6); animation: dash-ping 1.8s ease-out infinite; }
@keyframes dash-ping { to { box-shadow: 0 0 0 12px rgba(155, 226, 47, 0); } }
.dash__brand b { font: 900 22px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.dash__brand small { font: 600 13px/1 var(--font); color: #a6b1c0; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .2); }
.dash__tabs { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.dash__tabs::-webkit-scrollbar { display: none; }
.dash__tab {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  font: 800 18px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .58);
  transition: color .2s;
}
.dash__tab .ico, .dash__tab .ico-b { width: 18px; height: 18px; }
.dash__tab::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px;
  background: var(--gc); box-shadow: 0 0 12px var(--gc); transform: scaleX(0); transition: transform .35s var(--ease-expo, ease), background-color .6s;
}
.dash__tab:hover { color: #fff; }
.dash__tab[aria-selected="true"] { color: #fff; }
.dash__tab[aria-selected="true"]::after { transform: scaleX(1); }
.dash__key {
  flex: none; display: grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px;
  font: 700 12.5px/1 var(--font); color: #cfd6e0; border: 1px solid rgba(255, 255, 255, .28); border-radius: 5px;
}
.dash__sys { display: inline-flex; align-items: center; gap: 16px; }
.dash__pad {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  font: 700 12px/1 var(--hud, var(--display)); letter-spacing: .1em; text-transform: uppercase; color: #0b1300; background: #9be22f;
}
.dash__pad[hidden] { display: none; }
.dash__pad .ico { width: 18px; height: 18px; }
.dash__clock { font: 600 20px/1 var(--hud, var(--display)); letter-spacing: .04em; color: #e9eef5; font-variant-numeric: tabular-nums; }

/* ---------- Información del juego elegido (letras grandes) ---------- */
/* a la derecha deja libre el botón flotante de WhatsApp */
.dash__main { display: flex; align-items: flex-end; width: 100%; max-width: 1760px; margin-inline: auto; padding: 8px max(var(--gutter), 96px) 18px var(--gutter); }
.dash__info { width: 100%; }
.dash__card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px 48px; }
.dash__about { display: grid; gap: 14px; max-width: 680px; }
.dash__buybox { display: grid; justify-items: end; gap: 14px; text-align: right; }
.dash__card.is-in .dash__about > *, .dash__card.is-in .dash__buybox > * { animation: dash-in .6s var(--ease-expo, ease) both; }
.dash__card.is-in .dash__about > :nth-child(2) { animation-delay: .04s; }
.dash__card.is-in .dash__about > :nth-child(3), .dash__card.is-in .dash__buybox > :nth-child(1) { animation-delay: .08s; }
.dash__card.is-in .dash__buybox > :nth-child(2) { animation-delay: .12s; }
.dash__card.is-in .dash__buybox > :nth-child(3) { animation-delay: .16s; }
@keyframes dash-in { from { opacity: 0; translate: 0 14px; } }
.dash__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash__tag {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  font: 700 13px/1 var(--hud, var(--display)); letter-spacing: .14em; text-transform: uppercase; color: #fff; background: #33435c;
}
.dash__tag .ico { width: 15px; height: 15px; }
.dash__tag--pre { background: #d1146f; }
.dash__tag--new { background: #2f7d0b; }
.dash__tag--top { color: #1f1600; background: #fcce19; }
.dash__tag--sale { background: #d9202a; }
.dash__plat {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  font: 700 13px/1 var(--hud, var(--display)); letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.dash__plat .ico, .dash__plat .ico-b { width: 15px; height: 15px; color: color-mix(in srgb, var(--pc) 60%, #fff); }
.dash__genre { font: 600 14px/1 var(--font); color: #c7d0dc; padding-left: 6px; }
.dash__title { margin: 0; min-height: clamp(64px, 10svh, 170px); display: flex; align-items: flex-end; }
.dash__logo {
  max-width: min(560px, 92%); max-height: clamp(76px, 15svh, 190px); width: auto; height: auto; object-fit: contain; object-position: left bottom;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .65));
}
.dash__title > span {
  font: 900 clamp(52px, min(6.6vw, 11svh), 118px)/.86 var(--display); text-transform: uppercase; letter-spacing: -.005em;
  text-shadow: 0 0 50px color-mix(in srgb, var(--gc) 45%, transparent), 0 12px 34px rgba(0, 0, 0, .6);
}
.dash__blurb {
  max-width: 620px; font-size: clamp(16.5px, 1.3vw, 20px); line-height: 1.5; color: #e1e7ef; text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dash__deal { display: grid; justify-items: end; gap: 8px; }
.dash__price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 14px; }
.dash__price small { width: 100%; font: 700 12px/1 var(--hud, var(--display)); letter-spacing: .22em; text-transform: uppercase; color: #a9b4c3; }
.dash__price b { order: 3; font: 700 clamp(40px, min(3.8vw, 7.5svh), 60px)/1 var(--hud, var(--display)); font-variant-numeric: tabular-nums; text-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.dash__price s { order: 1; font-size: 18px; color: #8f9bab; }
.dash__price em { order: 2; font: 700 15px/1 var(--hud, var(--display)); font-style: normal; padding: 6px 8px; color: #fff; background: #d9202a; }
.dash__cd { display: inline-flex; align-items: baseline; gap: 6px; font: 600 15px/1 var(--hud, var(--display)); color: #dfe6ee; }
.dash__cd .ico { width: 17px; height: 17px; align-self: center; color: var(--gc); }
.dash__cd b { font-size: 22px; color: #fff; font-variant-numeric: tabular-nums; }
.dash__ctas { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.dash .dash__buy, .dash .dash__add { min-height: 58px; padding: 0 28px; font-size: 17px; gap: 10px; }
.dash .dash__buy .ico, .dash .dash__add .ico { width: 20px; height: 20px; }
.dash__link { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 2px; font: 700 15.5px/1 var(--font); color: #e8edf4; }
.dash__link .ico { width: 18px; height: 18px; transition: transform .3s; }
.dash__link:hover { color: #fff; }
.dash__link:hover .ico { transform: translateX(4px); }

/* ---------- Fila de portadas grandes ---------- */
.dash__shelf { position: relative; min-width: 0; }
.dash__tiles {
  display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  padding: 18px var(--gutter) 8px; outline: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 86%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 0%, #000 86%, transparent 100%);
}
.dash__tiles::-webkit-scrollbar { display: none; }
.dash__tiles > li { flex: none; }
.dash__tile {
  display: grid; gap: 10px; width: var(--tw); text-align: left; color: #fff;
  transition: width .38s var(--ease-expo, ease);
}
.dash__tile.is-focus { width: calc(var(--tw) * 1.36); }
.dash__cover {
  position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 14px; background: #0c0f15;
  box-shadow: 0 18px 34px -18px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .1);
  filter: brightness(.66) saturate(.85);
  transition: filter .3s, box-shadow .35s, transform .35s var(--ease-expo, ease);
}
.dash__cover img { width: 100%; height: 100%; object-fit: cover; }
.dash__tile:hover .dash__cover { filter: brightness(.9) saturate(1); }
.dash__tile.is-focus .dash__cover {
  filter: none; transform: translateY(-4px);
  box-shadow: 0 0 0 3px #fff, 0 0 0 7px color-mix(in srgb, var(--gc) 60%, transparent), 0 28px 50px -16px var(--gc);
}
.dash__badge {
  position: absolute; left: 8px; top: 8px; padding: 5px 7px; font: 700 10.5px/1 var(--hud, var(--display)); font-style: normal;
  letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(5, 7, 10, .8);
}
.dash__badge--pre { background: #d1146f; }
.dash__badge--top { color: #1f1600; background: #fcce19; }
.dash__badge--new { background: #2f7d0b; }
.dash__badge--sale { background: #d9202a; }
.dash__tname {
  font: 800 17px/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; translate: 0 -6px; transition: opacity .25s, translate .35s var(--ease-expo, ease);
}
.dash__tile.is-focus .dash__tname { opacity: 1; translate: 0 0; }
.dash__tiles:focus-visible .dash__tile.is-focus .dash__cover { box-shadow: 0 0 0 3px #9be22f, 0 0 0 7px rgba(155, 226, 47, .45), 0 28px 50px -16px var(--gc); }

/* ---------- Pie: teclas y botones del control (solo en pantallas altas) ---------- */
.dash__foot {
  display: flex; align-items: center; justify-content: flex-end;
  width: 100%; max-width: 1760px; margin-inline: auto; padding: 0 var(--gutter) 18px;
}
@media (max-height: 820px) { .dash__foot { display: none; } }
.dash__more {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  font: 700 14px/1 var(--font); color: #fff; border: 1px solid rgba(255, 255, 255, .24); background: rgba(5, 7, 10, .45);
  transition: background-color .2s, border-color .2s, color .2s;
}
.dash__more:hover { color: #0b1300; background: #9be22f; border-color: #9be22f; }
.dash__more .ico { width: 18px; height: 18px; }
.dash__hints { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 18px; font-size: 13.5px; color: #aeb8c6; }
.dash__hints span { display: inline-flex; align-items: center; gap: 6px; }
.dash__hints .ico { width: 17px; height: 17px; color: #9be22f; }
.dash__hints kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  font: 700 12.5px/1 var(--font); color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); border-radius: 5px;
}
.dash.has-pad .dash__hints kbd { border-radius: 50%; min-width: 26px; height: 26px; }

/* ---------- Sección del inicio ---------- */
.dash-sec { position: relative; padding: 0; }

/* ---------- Pantallas medianas y celular ---------- */
@media (max-width: 1100px) {
  .dash__brand small { display: none; }
  .dash__tab { font-size: 16px; padding: 0 10px; }
}
@media (max-width: 760px) {
  .dash { --tw: 31vw; min-height: 0; grid-template-rows: auto auto auto auto; }
  .dash__top { padding-top: 16px; }
  .dash__brand { display: none; }
  .dash__key, .dash__clock, .dash__pad { display: none !important; }
  .dash__sys { order: 3; }
  .dash__tabs { width: 100%; }
  .dash__tab { height: 42px; font-size: 15px; }
  .dash__shade {
    background:
      linear-gradient(0deg, rgba(4, 6, 10, .98) 0%, rgba(4, 6, 10, .82) 48%, rgba(4, 6, 10, .3) 78%, rgba(4, 6, 10, .55) 100%);
  }
  .dash__main { padding-top: 6px; }
  .dash__card { grid-template-columns: minmax(0, 1fr); }
  .dash__buybox { justify-items: start; text-align: left; }
  .dash__deal { justify-items: start; }
  .dash__price, .dash__ctas { justify-content: flex-start; }
  .dash__title { min-height: 0; }
  .dash__logo { max-height: 96px; }
  .dash__title > span { font-size: clamp(42px, 12vw, 64px); }
  .dash__blurb { -webkit-line-clamp: 2; font-size: 16px; }
  .dash__price b { font-size: 36px; }
  .dash .dash__buy { flex: 1 1 100%; }
  .dash .dash__add { flex: 1 1 auto; }
  .dash__tiles { gap: 12px; padding-top: 22px; }
  .dash__tile.is-focus { width: calc(var(--tw) * 1.22); }
  .dash__hints { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dash__art, .dash__tile, .dash__cover, .dash__tname { transition: none; }
  .dash__art.is-on { transform: none; }
  .dash__card.is-in > * { animation: none; }
  .dash__dot { animation: none; }
}
