/*
 * GamePass.es — GameTracker Experience
 * Progressive layer for /juegos only. Existing server-rendered catalog remains
 * the SEO/fallback experience; these styles make the interactive layer feel
 * like a premium videogame product rather than an admin dashboard.
 */

:root {
  --gtx-bg: #080b10;
  --gtx-surface: #0f141b;
  --gtx-surface-2: #151b24;
  --gtx-surface-3: #1a222d;
  --gtx-line: rgba(255,255,255,.09);
  --gtx-line-strong: rgba(255,255,255,.16);
  --gtx-text: #f5f7fa;
  --gtx-muted: #9aa7b5;
  --gtx-faint: #6f7b88;
  --gtx-cyan: #00d7ff;
  --gtx-green: #5ee0a0;
  --gtx-violet: #c89bff;
  --gtx-amber: #ffbd66;
  --gtx-danger: #ff6b72;
  --gtx-radius: 16px;
  --gtx-shadow: 0 28px 90px rgba(0,0,0,.55);
}

/* Cards: quieter surface, stronger artwork, less dashboard chrome. */
.gtx-ready .juego-card:not(.juego-card--hero) {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(19,25,34,.98), rgba(11,15,21,.98));
  box-shadow: 0 9px 30px rgba(0,0,0,.20);
  transform: translateZ(0);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.gtx-ready .juego-card:not(.juego-card--hero):hover {
  transform: translateY(-4px);
  border-color: rgba(0,215,255,.28);
  box-shadow: 0 18px 46px rgba(0,0,0,.34), 0 0 0 1px rgba(0,215,255,.05);
}
.gtx-ready .juego-card-img {
  background: #0b0f15;
  overflow: hidden;
}
.gtx-ready .juego-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .35s cubic-bezier(.2,.75,.2,1), filter .25s ease;
}
.gtx-ready .juego-card:hover .juego-card-img img { transform: scale(1.035); }
.gtx-ready .juego-card-body { padding: 12px 12px 11px; }
.gtx-ready .juego-card-titulo {
  color: var(--gtx-text);
  font-weight: 750;
  letter-spacing: -.015em;
  line-height: 1.18;
}
.gtx-ready .juego-card-meta { gap: 5px 6px; }
.gtx-ready .juego-card-fecha { color: #a9b5c2; }
.gtx-ready .juego-card-genero { opacity: .78; }
.gtx-ready .juego-card-avail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.055);
}
.gtx-ready .jc-tier {
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--tc) 36%, transparent);
  background: color-mix(in srgb, var(--tc) 9%, #111720);
  color: color-mix(in srgb, var(--tc) 72%, white);
  font-weight: 700;
}
.gtx-ready .jc-plat {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.09);
  color: #a8b7c7;
}
.gtx-ready .juego-card-foot {
  border-top-color: rgba(255,255,255,.055);
  margin-top: 9px;
  padding-top: 9px;
}
.gtx-ready .juego-card-pendiente-btn {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.045);
}
.gtx-ready .juego-card-pendiente-btn.is-active {
  color: var(--gtx-green);
  border-color: rgba(94,224,160,.32);
  background: rgba(94,224,160,.10);
}

/* Quick View shell */
.gtx-qv[hidden] { display: none !important; }
.gtx-qv {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  justify-content: flex-end;
  color: var(--gtx-text);
  isolation: isolate;
}
.gtx-qv__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,5,9,.76);
  backdrop-filter: blur(12px) saturate(75%);
  -webkit-backdrop-filter: blur(12px) saturate(75%);
  opacity: 0;
  transition: opacity .22s ease;
}
.gtx-qv.is-open .gtx-qv__backdrop { opacity: 1; }
.gtx-qv__panel {
  position: relative;
  width: min(78vw, 1280px);
  min-width: 760px;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 74% 0%, rgba(0,215,255,.055), transparent 29rem),
    linear-gradient(180deg, #121722 0%, #0b0f15 100%);
  border-left: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--gtx-shadow);
  transform: translateX(4%);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2,.75,.2,1), opacity .22s ease;
}
.gtx-qv.is-open .gtx-qv__panel { transform: translateX(0); opacity: 1; }
.gtx-qv__topbar {
  min-height: 58px;
  padding: 9px 13px 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(8,11,16,.82);
  border-bottom: 1px solid var(--gtx-line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.gtx-qv__context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gtx-muted);
  font: 650 12px/1.2 Inter, system-ui, sans-serif;
}
.gtx-qv__context-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gtx-cyan); box-shadow: 0 0 10px rgba(0,215,255,.65); }
.gtx-qv__tools { display: flex; align-items: center; gap: 7px; }
.gtx-qv__iconbtn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--gtx-line);
  background: rgba(255,255,255,.04);
  color: #dbe4ec;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.gtx-qv__iconbtn:hover { background: rgba(255,255,255,.085); border-color: var(--gtx-line-strong); }
.gtx-qv__iconbtn:active { transform: scale(.96); }
.gtx-qv__iconbtn svg { width: 18px; height: 18px; }
.gtx-qv__scroll { overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.gtx-qv__content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 28px 30px 46px;
}
.gtx-qv__loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--gtx-muted);
}
.gtx-qv__spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.10);
  border-top-color: var(--gtx-cyan);
  animation: gtx-spin .7s linear infinite;
}
@keyframes gtx-spin { to { transform: rotate(360deg); } }

/* Header area */
.gtx-qv__header {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 290px;
  gap: 22px;
  align-items: start;
  margin-bottom: 24px;
}
.gtx-qv__cover {
  aspect-ratio: 3 / 4;
  width: 132px;
  border-radius: 13px;
  object-fit: cover;
  background: #080b10;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 30px rgba(0,0,0,.34);
}
.gtx-qv__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 2px 0 9px;
}
.gtx-qv__title {
  margin: 0;
  max-width: 760px;
  font: 750 clamp(27px, 3vw, 43px)/1.04 Inter, system-ui, sans-serif;
  letter-spacing: -.035em;
  color: #fff;
}
.gtx-qv__synopsis {
  margin: 13px 0 0;
  max-width: 720px;
  color: #bac5d1;
  font: 470 14px/1.65 Inter, system-ui, sans-serif;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.gtx-qv__social {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  color: var(--gtx-muted);
  font: 620 12px/1.3 Inter, system-ui, sans-serif;
}
.gtx-qv__social span { display: inline-flex; align-items: center; gap: 6px; }
.gtx-qv__social svg { width: 15px; height: 15px; }

/* Signals: distinct visual families. */
.gtx-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--gtx-line);
  font: 760 10.5px/1 Inter, system-ui, sans-serif;
  letter-spacing: .02em;
  white-space: nowrap;
}
.gtx-chip--status { color: #b9fbd8; background: rgba(94,224,160,.09); border-color: rgba(94,224,160,.28); }
.gtx-chip--dayone { color: #fff2b4; background: rgba(255,201,91,.11); border-color: rgba(255,201,91,.31); }
.gtx-chip--personal { color: #aeeaff; background: rgba(0,215,255,.09); border-color: rgba(0,215,255,.28); }
.gtx-chip--plan { border-radius: 7px; background: #161d27; }
.gtx-chip--ultimate { color: #82f2bd; border-color: rgba(94,224,160,.33); }
.gtx-chip--premium { color: #d9b9ff; border-color: rgba(200,155,255,.34); }
.gtx-chip--essential { color: #ffd096; border-color: rgba(255,180,84,.36); }
.gtx-chip--pc-game-pass { color: #8eeaff; border-color: rgba(0,215,255,.33); }
.gtx-platform {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.085);
  background: rgba(255,255,255,.035);
  color: #aebbc8;
  font: 650 10.5px/1 Inter, system-ui, sans-serif;
}

/* Decision rail */
.gtx-qv__rail {
  grid-column: 3;
  grid-row: 1 / span 2;
  border: 1px solid var(--gtx-line);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(255,255,255,.028);
}
.gtx-qv__rail-head {
  padding: 11px 14px;
  color: #f4f7fa;
  border-bottom: 1px solid var(--gtx-line);
  font: 780 12px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.gtx-qv__datebox { padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.065); }
.gtx-qv__date-label { color: var(--gtx-muted); font: 650 10px/1.2 Inter, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.gtx-qv__date-main { margin-top: 5px; color: #fff; font: 730 18px/1.2 Inter, system-ui, sans-serif; }
.gtx-qv__urgency { margin-top: 4px; color: var(--gtx-danger); font: 750 12px/1.25 Inter, system-ui, sans-serif; }
.gtx-qv__decision { padding: 14px; display: grid; gap: 13px; }
.gtx-qv__decision-row { display: grid; gap: 6px; }
.gtx-qv__decision-label { color: var(--gtx-faint); font: 650 9.5px/1.2 Inter, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.gtx-qv__decision-value { color: #e9eef3; font: 650 12.5px/1.4 Inter, system-ui, sans-serif; }
.gtx-qv__pace {
  padding: 12px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255,189,102,.12), rgba(255,189,102,.035));
  border: 1px solid rgba(255,189,102,.22);
}
.gtx-qv__pace strong { display: block; color: #ffd89b; font: 760 16px/1.1 Inter, system-ui, sans-serif; }
.gtx-qv__pace span { display: block; color: #bda881; font: 500 10.5px/1.4 Inter, system-ui, sans-serif; margin-top: 4px; }

/* Media is the premium visual anchor, not a giant blurry hero. */
.gtx-qv__media {
  position: relative;
  aspect-ratio: 16 / 8.7;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: #05070a;
  box-shadow: 0 18px 45px rgba(0,0,0,.25);
}
.gtx-qv__media img { width: 100%; height: 100%; object-fit: cover; }
.gtx-qv__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.35));
  pointer-events: none;
}
.gtx-qv__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%,-50%);
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(4,7,11,.76);
  color: #fff;
  backdrop-filter: blur(10px);
  cursor: pointer;
  box-shadow: 0 13px 40px rgba(0,0,0,.35);
  transition: transform .18s ease, background .18s ease;
}
.gtx-qv__play:hover { transform: translate(-50%,-50%) scale(1.06); background: rgba(0,154,194,.86); }
.gtx-qv__play svg { width: 27px; height: 27px; margin-left: 3px; }
.gtx-qv__media iframe { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; border: 0; }
.gtx-qv__thumbs { display: flex; gap: 7px; overflow-x: auto; padding: 8px 1px 2px; scrollbar-width: thin; }
.gtx-qv__thumb {
  flex: 0 0 88px;
  aspect-ratio: 16/9;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--gtx-line);
  background: #090d12;
  cursor: pointer;
}
.gtx-qv__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Facts and actions */
.gtx-qv__facts {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  border: 1px solid var(--gtx-line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.022);
}
.gtx-qv__fact { min-width: 0; padding: 12px 13px; border-right: 1px solid var(--gtx-line); }
.gtx-qv__fact:last-child { border-right: 0; }
.gtx-qv__fact-label { color: var(--gtx-faint); font: 650 9px/1.2 Inter, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.gtx-qv__fact-value { margin-top: 5px; color: #e5ebf0; font: 620 12px/1.4 Inter, system-ui, sans-serif; white-space: normal; }
.gtx-qv__actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.gtx-qv__state {
  appearance: none;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(0,215,255,.28);
  background: rgba(0,215,255,.08);
  color: #d8f8ff;
  padding: 0 36px 0 13px;
  font: 720 12px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.gtx-qv__primary,
.gtx-qv__secondary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 10px;
  text-decoration: none;
  font: 730 12px/1 Inter, system-ui, sans-serif;
}
.gtx-qv__primary { color: #041218; background: #62ddf7; border: 1px solid #74e5fb; }
.gtx-qv__primary:hover { filter: brightness(1.05); color: #041218; }
.gtx-qv__secondary { color: #dce5ed; background: rgba(255,255,255,.04); border: 1px solid var(--gtx-line); }
.gtx-qv__secondary:hover { background: rgba(255,255,255,.075); color: #fff; }
.gtx-qv__feedback { min-height: 18px; margin-top: 8px; color: var(--gtx-muted); font: 550 11px/1.4 Inter, system-ui, sans-serif; }
.gtx-qv__error {
  margin: 16vh auto 0;
  max-width: 500px;
  padding: 22px;
  border-radius: 14px;
  text-align: center;
  color: #e3eaf0;
  border: 1px solid rgba(255,107,114,.26);
  background: rgba(255,107,114,.06);
}

body.gtx-lock { overflow: hidden; }

@media (max-width: 980px) {
  .gtx-qv__panel { width: min(92vw, 900px); min-width: 0; }
  .gtx-qv__content { padding: 22px 20px 40px; }
  .gtx-qv__header { grid-template-columns: 108px minmax(0,1fr); }
  .gtx-qv__cover { width: 108px; }
  .gtx-qv__rail { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; }
  .gtx-qv__rail-head { grid-column: 1 / -1; }
  .gtx-qv__datebox { border-right: 1px solid var(--gtx-line); border-bottom: 0; }
  .gtx-qv__facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gtx-qv__fact:nth-child(2) { border-right: 0; }
  .gtx-qv__fact:nth-child(-n+2) { border-bottom: 1px solid var(--gtx-line); }
}

@media (max-width: 640px) {
  .gtx-qv { justify-content: stretch; }
  .gtx-qv__backdrop { backdrop-filter: none; }
  .gtx-qv__panel { width: 100%; height: 100%; border-left: 0; }
  .gtx-qv__topbar { min-height: 54px; padding: 8px 10px 8px 14px; }
  .gtx-qv__content { padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }
  .gtx-qv__header { grid-template-columns: 76px minmax(0,1fr); gap: 13px; margin-bottom: 16px; }
  .gtx-qv__cover { width: 76px; border-radius: 9px; }
  .gtx-qv__title { font-size: clamp(23px,7vw,31px); }
  .gtx-qv__synopsis { font-size: 12.5px; line-height: 1.55; -webkit-line-clamp: 3; }
  .gtx-qv__social { margin-top: 9px; }
  .gtx-qv__rail { grid-template-columns: 1fr; }
  .gtx-qv__datebox { border-right: 0; border-bottom: 1px solid var(--gtx-line); }
  .gtx-qv__media { aspect-ratio: 16/9; border-radius: 12px; }
  .gtx-qv__play { width: 56px; height: 56px; border-radius: 15px; }
  .gtx-qv__facts { grid-template-columns: 1fr 1fr; }
  .gtx-qv__actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    margin: 18px -14px -10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(8,11,16,.93);
    border-top: 1px solid var(--gtx-line);
    backdrop-filter: blur(18px);
  }
  .gtx-qv__state { flex: 1 1 46%; }
  .gtx-qv__primary { flex: 1 1 46%; }
  .gtx-qv__secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .gtx-qv__backdrop,
  .gtx-qv__panel,
  .gtx-ready .juego-card,
  .gtx-ready .juego-card-img img { transition: none !important; }
  .gtx-qv__spinner { animation-duration: 1.4s; }
}
