/* ============ Colores: blanco y granate, como liquidacionescomplementarias.es ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f5f5;
  --surface: #ffffff;
  --text: #222222;
  --muted: #666666;
  --grey: #7a7a7a;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #9e0001;          /* granate */
  --accent-dark: #7a0001;
  --accent-ink: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.18);
  --radius: 20px;
  --tint: 7%;
  color-scheme: light;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand-name, .footer-name { font-family: "Ubuntu", system-ui, sans-serif; line-height: 1.15; }
h1, h2 { color: var(--accent); }
a { color: inherit; }
img { max-width: 100%; display: block; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Barra superior ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; transition: transform 0.3s; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name {
  font-weight: 500;
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name small { font-size: inherit; color: var(--grey); font-weight: 400; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-link { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.nav-link:hover { color: var(--text); }
.langs {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236e6680'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 999px;
  font: 600 0.88rem system-ui, sans-serif;
  padding: 7px 30px 7px 14px;
  cursor: pointer;
  max-width: 44vw;
}
.langs[hidden] { display: none; }
[dir="rtl"] .langs { background-position: left 12px center; padding: 7px 14px 7px 30px; }

/* ============ Portada ============ */
.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) 20px clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 40px;
}
.hero::before {
  /* manchas de color suaves detrás */
  content: "";
  position: absolute;
  inset: -10% -20% 0;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 80% 40%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    radial-gradient(35% 45% at 10% 20%, rgba(0, 0, 0, 0.025), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.6rem);
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero p { font-size: clamp(1.08rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 34em; margin: 0 0 32px; text-wrap: pretty; }
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 800;
  padding: 15px 30px;
  border-radius: 999px;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent); }

/* Iconos flotando en la portada */
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: center; container-type: inline-size; }
.float-icon {
  position: absolute;
  width: calc(var(--s) * 1%);
  aspect-ratio: 1;
  left: var(--x);
  top: var(--y);
  border-radius: 23%;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(var(--r));
  animation: bob 6s ease-in-out infinite;
  animation-delay: var(--d);
  background: var(--c);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font: 700 calc(var(--s) * 0.42cqw) / 1 "Ubuntu", sans-serif;
  text-decoration: none;
}
.float-icon img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.45s ease; }
.float-icon.cambiando img { opacity: 0; }
.float-icon.empty {
  background: linear-gradient(145deg, #ffffff, var(--bg-soft));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.float-icon.empty img { width: 46%; height: 46%; opacity: 0.35; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r)); }
  50% { transform: translateY(-14px) rotate(calc(var(--r) * -0.5)); }
}

/* ============ Rejilla de la colección ============ */
.collection { max-width: 1200px; margin: 0 auto; padding: 8px 20px 24px; }
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.tile {
  --game-color: var(--accent);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--game-color) 45%, transparent); }
.tile .game-icon { width: 60px; height: 60px; border-radius: 15px; font-size: 1.6rem; box-shadow: none; }
.tile strong { display: block; font-family: "Ubuntu", sans-serif; font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.tile span { font-size: 0.85rem; color: var(--muted); font-weight: 700; }

/* ============ Fichas de cada juego / app ============ */
.games {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 96px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.game {
  --game-color: var(--accent);
  position: relative;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--game-color) calc(var(--tint) * 1.6), transparent), transparent 60%),
    color-mix(in srgb, var(--game-color) var(--tint), var(--surface));
  border: 1px solid color-mix(in srgb, var(--game-color) 22%, var(--border));
  border-radius: 32px;
  padding: clamp(20px, 4vw, 48px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.game-head { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; }
.game-icon {
  width: 96px; height: 96px;
  flex-shrink: 0;
  border-radius: 24px;
  object-fit: cover;
  background: var(--game-color);
  display: grid;
  place-items: center;
  font-family: "Ubuntu", sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--game-color) 80%, #000);
}
.game-head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 700; margin: 0 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--game-color) 18%, var(--surface));
  color: color-mix(in srgb, var(--game-color) 55%, var(--text));
}

.game-body {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
}
.game-desc { color: var(--text); opacity: 0.86; margin: 0 0 26px; font-size: 1.1rem; text-wrap: pretty; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 2px dashed color-mix(in srgb, var(--game-color) 35%, var(--border));
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 16px;
}

/* Botones de tienda */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 14px;
  border-radius: 14px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}
.store:hover { transform: translateY(-3px); box-shadow: 0 12px 22px -10px rgba(0, 0, 0, 0.7); }
.store svg { width: 26px; height: 26px; flex-shrink: 0; }
.store small { display: block; font-size: 0.68rem; color: #ccc; line-height: 1.1; font-weight: 600; }
.store strong { display: block; font-size: 1.08rem; line-height: 1.2; font-weight: 800; }
.store.disabled { opacity: 0.38; pointer-events: none; }

/* Capturas */
.shots-title {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 40px 0 14px;
}
.shots {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 18px;
  margin: 0 -4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--game-color) 40%, transparent) transparent;
}
.shot {
  flex: 0 0 auto;
  height: 380px;
  aspect-ratio: 9 / 19.5;
  border-radius: 20px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  background: var(--bg-soft);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s;
}
button.shot:hover { transform: translateY(-4px) scale(1.01); }
.shot.landscape { aspect-ratio: 19.5 / 9; height: 230px; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-placeholder {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
  background: linear-gradient(160deg, var(--game-color), color-mix(in srgb, var(--game-color) 40%, var(--bg-soft)));
  cursor: default;
}

/* Aparecer al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============ Visor ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 9, 20, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; max-width: 90vw; border-radius: 20px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 2rem;
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-close { top: 20px; right: 20px; font-size: 1.3rem; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* ============ Pie ============ */
.footer {
  text-align: center;
  color: var(--muted);
  padding: 56px 20px 48px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}
.footer img { margin: 0 auto 10px; }
.footer-name { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.footer p { margin: 0; }

/* ============ Móvil y tableta ============ */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 8px; padding-top: 24px; }
  .hero-art { order: -1; max-width: 300px; }
  .hero p { margin-left: auto; margin-right: auto; }
  .game-body { grid-template-columns: 1fr; }
  .game-icon { width: 72px; height: 72px; border-radius: 18px; font-size: 2rem; }
  .game { border-radius: 26px; }
  .shot { height: 320px; }
  .shot.landscape { height: 170px; }
  .lb-prev, .lb-next { bottom: 24px; top: auto; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}
@media (max-width: 520px) {
  .nav { padding: 10px 16px; }
  .nav-link { display: none; }
  .brand { gap: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: min(4vw, 1.1rem); overflow: visible; }
  .langs { max-width: 27vw; padding: 6px 22px 6px 9px; font-size: 0.75rem; background-position: right 7px center; }
  .collection, .games { padding-left: 16px; padding-right: 16px; }
  .collection-grid { grid-template-columns: 1fr; }
}
