:root {
  --bg: #0a0e14;
  --bg-panel: #10151f;
  --bg-panel-2: #131a26;
  --border: #1e2735;
  --cyan: #22d3ee;
  --cyan-dark: #0891b2;
  --blue: #2563eb;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --text: #e5edf5;
  --text-muted: #8a97a8;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--cyan-dark);
  position: sticky;
  top: 0;
  z-index: 50;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; }
.logo .accent { color: var(--cyan); }
.nav { display: flex; gap: 8px; }
.nav a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a.active, .nav a:hover { background: rgba(34,211,238,.12); color: var(--cyan); }
.header-icons { display: flex; align-items: center; gap: 18px; }
.header-icons a { color: var(--text); font-size: 1.1rem; }
.btn-premium {
  background: linear-gradient(135deg, #eab308, #f59e0b);
  color: #1a1200 !important;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .85rem;
}

/* ---------- Hero / Carrusel (versión tarjeta, usada en otras páginas) ---------- */
.hero {
  position: relative;
  min-height: 420px;
  border-radius: var(--radius);
  margin: 24px 32px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,14,20,.95) 10%, rgba(10,14,20,.35) 55%, rgba(10,14,20,.1) 100%);
}
.hero-content { position: relative; padding: 40px; max-width: 560px; }
.hero-tag { font-size: 2.4rem; font-weight: 900; letter-spacing: 1px; margin-bottom: 12px; text-transform: uppercase; }
.hero-badges { display: flex; gap: 8px; margin-bottom: 14px; }
.badge { padding: 4px 10px; border-radius: 6px; font-size: .75rem; font-weight: 700; }
.badge.green { background: var(--green); color: #06210f; }
.badge.gray { background: #2b3547; color: var(--text); }
.hero-desc { color: var(--text-muted); font-size: .95rem; line-height: 1.5; margin-bottom: 18px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff; font-weight: 700;
  padding: 12px 22px; border-radius: 8px; border: none; cursor: pointer;
}
.btn-primary:hover { background: #1d4fd8; }

/* ---------- Sección de juegos ---------- */
.section-header {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 0 32px; margin: 30px 0 18px;
}
.section-title { color: var(--cyan); font-size: 1.4rem; font-weight: 800; margin-right: 6px; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px; font-weight: 700; font-size: .85rem;
  border: 1px solid var(--border);
}
.filter-pill.low { background: rgba(34,197,94,.15); color: var(--green); }
.filter-pill.mid { background: rgba(234,179,8,.15); color: var(--yellow); }
.filter-pill.high { background: rgba(239,68,68,.15); color: var(--red); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 0 32px 40px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-4px); border-color: var(--cyan-dark); }
.card-cover { position: relative; aspect-ratio: 3/4; background: #1a2130; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-tag {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 5px; font-size: .7rem; font-weight: 800;
}
.card-tag.nuevo { background: var(--green); color: #06210f; }
.card-tag.actualizado { background: var(--yellow); color: #241900; }
.card-platform {
  position: absolute; top: 8px; right: 8px;
  background: #0d131e; color: var(--cyan);
  font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 5px;
}
.card-body { padding: 10px 12px 14px; }
.card-title { font-size: .9rem; font-weight: 700; line-height: 1.3; }
.card-price { margin-top: 6px; font-size: .95rem; font-weight: 800; color: var(--cyan); }

/* ---------- Página de detalle ---------- */
.detail-wrap { padding: 24px 32px 50px; display: grid; grid-template-columns: 260px 1fr 320px; gap: 28px; }
.detail-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.detail-title { font-size: 1.8rem; font-weight: 800; margin: 0 0 8px; }
.detail-sub { color: var(--text-muted); margin-bottom: 16px; }
.detail-desc { line-height: 1.6; color: #c7d1dd; margin-bottom: 18px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--bg-panel-2); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 16px; font-size: .8rem; color: var(--text-muted);
}
.info-panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.info-row span:first-child { color: var(--text-muted); }
.stock-ok { color: var(--green); font-weight: 700; }
.stock-out { color: var(--red); font-weight: 700; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-buy { flex: 1; background: var(--blue); color: #fff; padding: 12px; border-radius: 8px; text-align: center; font-weight: 700; border: none; cursor: pointer; }
.btn-buy:disabled { background: #33415a; cursor: not-allowed; }
.btn-download { flex: 1; background: var(--cyan-dark); color: #fff; padding: 12px; border-radius: 8px; text-align: center; font-weight: 700; border: none; cursor: pointer; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 460px; padding: 22px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }
.key-box {
  background: #0d131e; border: 1px dashed var(--cyan);
  border-radius: 8px; padding: 14px; font-family: monospace;
  font-size: 1.1rem; letter-spacing: 2px; text-align: center; color: var(--cyan);
  margin: 12px 0;
}

/* ---------- Lista de links de descarga (modal de juego.php) ---------- */
.download-links { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 340px; overflow-y: auto; }
.download-link-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font-weight: 700; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s, color .15s;
}
.download-link-item:hover { border-color: var(--cyan-dark); color: var(--cyan); transform: translateX(2px); }

/* ---------- Trailer del juego ---------- */
.detail-trailer {
  width: 100%; max-height: 420px; border-radius: var(--radius);
  background: #000; margin-top: 4px; display: block;
}
.trailer-embed {
  position: relative; width: 100%; padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius); overflow: hidden; background: #000; margin-top: 4px;
}
.trailer-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}

/* ---------- Lightbox de capturas ---------- */
.captura-thumb { transition: opacity .15s, transform .15s; }
.captura-thumb:hover { opacity: .85; transform: scale(1.02); }
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(5,7,11,.92);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 40px; cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 100%; max-height: 100%; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); cursor: default;
}
.lightbox-close {
  position: absolute; top: 20px; right: 28px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  color: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer;
}
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font-size: 1.6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-arrow:hover { background: var(--cyan-dark); border-color: var(--cyan-dark); }
.lightbox-arrow.lightbox-prev { left: 20px; }
.lightbox-arrow.lightbox-next { right: 20px; }
.lightbox-contador {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5); color: #fff; padding: 5px 14px; border-radius: 20px;
  font-size: .82rem; font-weight: 700;
}

/* ---------- Auth forms ---------- */
.auth-wrap { max-width: 400px; margin: 60px auto; padding: 30px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--text-muted); }
.field input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}

/* ---------- Hero a pantalla completa (home) con header flotante ---------- */
body.home-hero .header {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(to bottom, rgba(5,7,11,.9) 0%, rgba(5,7,11,.5) 55%, transparent 100%);
  border-bottom: none;
  z-index: 60;
}

.hero-slider.full-bleed {
  margin: 0;
  border-radius: 0;
  min-height: 74vh;
}
.hero-slider.full-bleed .hero-slide::before {
  background:
    linear-gradient(180deg, rgba(10,14,20,.05) 0%, rgba(10,14,20,.1) 55%, rgba(10,14,20,.6) 88%, var(--bg) 100%),
    linear-gradient(90deg, rgba(10,14,20,.95) 5%, rgba(10,14,20,.4) 55%, rgba(10,14,20,.05) 100%);
}
.hero-slider.full-bleed .hero-content { padding: 0 60px 70px; max-width: 640px; }
.hero-slider.full-bleed .hero-tag { font-size: 3rem; }

@media (max-width: 900px) {
  .detail-wrap { grid-template-columns: 1fr; }
  .nav { display: none; }
  .hero-slider.full-bleed { min-height: 62vh; }
  .hero-slider.full-bleed .hero-content { padding: 0 20px 50px; }
  .hero-slider.full-bleed .hero-tag { font-size: 2rem; }
}

/* ---------- Modal de descargas: instrucciones + pestañas por plataforma ---------- */
.descarga-info-box {
  background: rgba(234,179,8,.1); border: 1px solid var(--yellow); color: #f3d47a;
  padding: 10px 14px; border-radius: 8px; font-size: .8rem; line-height: 1.5; margin-bottom: 10px;
}
.descarga-gif { width: 100%; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--border); }
.descarga-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 14px; padding-bottom: 2px; }
.tab-btn {
  background: none; border: none; color: var(--text-muted); font-weight: 700; font-size: .82rem;
  padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-btn.tab-premium.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.parte-unica-label { font-size: .78rem; color: var(--text-muted); margin: 0 0 6px; }
.parte-unica-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-panel-2); border: 1px solid var(--cyan-dark); border-radius: 8px;
  padding: 12px 14px; font-weight: 700; text-decoration: none; color: var(--cyan);
}
.parte-unica-box:hover { background: rgba(34,211,238,.08); }
.contrasena-chip {
  margin-top: 10px; background: rgba(234,179,8,.1); border: 1px dashed var(--yellow);
  color: #f3d47a; border-radius: 8px; padding: 8px 12px; font-size: .85rem;
}
.descarga-nota { font-size: .75rem; color: var(--text-muted); margin-top: 10px; }
.premium-locked {
  text-align: center; padding: 20px 10px; background: rgba(234,179,8,.06);
  border: 1px solid var(--yellow); border-radius: 10px; color: #f3d47a;
}
.premium-locked p { color: var(--text-muted); font-size: .85rem; margin: 8px 0 14px; }

/* ---------- Requisitos del sistema (mínimos/recomendados) ---------- */
.requisitos-sistema { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.requisitos-col { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.requisitos-col h4 { color: var(--cyan); margin: 0 0 10px; font-size: .9rem; }
.requisitos-html { font-size: .82rem; color: #c7d1dd; line-height: 1.6; }
.requisitos-html ul { margin: 0; padding-left: 18px; }
.requisitos-html li { margin-bottom: 4px; list-style: none; }
.requisitos-html strong, .requisitos-html b { color: var(--text); }
@media (max-width: 700px) {
  .requisitos-sistema { grid-template-columns: 1fr; }
}

/* ---------- Badge "Gratis" junto al precio, cuando el juego es venta + regalo ---------- */
.tag-gratis-mini {
  display: inline-block; background: rgba(34,197,94,.15); color: var(--green);
  font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 10px;
  vertical-align: middle; margin-left: 4px;
}

/* ---------- Badge de plataforma de la key (Steam, GOG, Epic, etc.) ---------- */
.card-platform.plat-steam, .cc-platform.plat-steam, .badge.plat-steam { background: #1b2838; color: #66c0f4; }
.card-platform.plat-gog, .cc-platform.plat-gog, .badge.plat-gog { background: #5c2d91; color: #fff; }
.card-platform.plat-epic, .cc-platform.plat-epic, .badge.plat-epic { background: #111; color: #fff; }
.card-platform.plat-origin, .cc-platform.plat-origin, .badge.plat-origin { background: #f56c2d; color: #1a0800; }
.card-platform.plat-ubisoft, .cc-platform.plat-ubisoft, .badge.plat-ubisoft { background: #0d1e46; color: #7ea6ff; }
.card-platform.plat-battlenet, .cc-platform.plat-battlenet, .badge.plat-battlenet { background: #00a1e0; color: #001b26; }
.card-platform.plat-rockstar, .cc-platform.plat-rockstar, .badge.plat-rockstar { background: #f9a900; color: #241900; }
.card-platform.plat-otro, .cc-platform.plat-otro, .badge.plat-otro { background: #0d131e; color: var(--cyan); }