/* ==========================================================================
   Lubalink Studios — capa compartida
   Servida en /shared/ por lubalink.com y por cada subdominio de juego.
   Contiene: tokens de marca, reset, tipografía, botones, logotipo,
   barra de navegación global y pie de página global.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Paleta de marca */
  --lb-midnight: #0D1220;
  --lb-violet: #7C6BFF;
  --lb-stone: #E8E9EE;
  --lb-slate: #6B7280;

  /* Derivados */
  --lb-midnight-2: #121829;
  --lb-midnight-3: #1A2236;
  --lb-violet-hi: #A398FF;
  --lb-violet-lo: rgba(124, 107, 255, .16);
  --lb-text: #E8E9EE;
  --lb-text-muted: #A2A8B6;
  --lb-line: rgba(232, 233, 238, .10);
  --lb-line-strong: rgba(232, 233, 238, .2);

  --lb-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lb-font-logo: "Fredoka", "Inter", system-ui, sans-serif;

  --lb-radius: 14px;
  --lb-radius-sm: 8px;
  --lb-container: 1280px;
  --lb-gutter: clamp(16px, 4vw, 40px);
  --lb-gnav-h: 64px;
  --lb-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--lb-midnight);
  color: var(--lb-text);
  font-family: var(--lb-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lb-violet-hi); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Utilidades ---------- */
.lb-container { width: 100%; max-width: var(--lb-container); margin: 0 auto; padding: 0 var(--lb-gutter); }
.lb-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lb-skip { position: absolute; left: 16px; top: -100px; z-index: 200; background: var(--lb-violet); color: #fff; padding: 10px 16px; border-radius: var(--lb-radius-sm); }
.lb-skip:focus { top: 12px; }

.lb-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase;
  color: var(--lb-text-muted);
}
.lb-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }

.lb-section { padding: clamp(64px, 9vw, 120px) 0; }
.lb-section__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.lb-section__title { font-size: clamp(30px, 4vw, 48px); margin-top: 14px; }
.lb-section__lead { color: var(--lb-text-muted); max-width: 56ch; margin-top: 14px; font-size: 18px; }

/* ---------- Botones ---------- */
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; white-space: nowrap;
  background: var(--lb-violet); color: #fff;
  transition: background .2s, transform .2s var(--lb-ease), box-shadow .2s;
  box-shadow: 0 8px 28px -10px rgba(124, 107, 255, .8);
}
.lb-btn:hover { background: #8D7EFF; transform: translateY(-1px); }
.lb-btn--ghost { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--lb-line-strong); backdrop-filter: blur(8px); }
.lb-btn--ghost:hover { background: rgba(255, 255, 255, .12); }
.lb-btn--light { background: var(--lb-stone); color: var(--lb-midnight); box-shadow: none; }
.lb-btn--light:hover { background: #fff; }
.lb-btn--sm { height: 38px; padding: 0 18px; font-size: 14px; }
.lb-btn svg { width: 18px; height: 18px; }

.lb-link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--lb-violet-hi); }
.lb-link-arrow::after { content: "→"; transition: transform .2s var(--lb-ease); }
.lb-link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Logotipo ---------- */
.lb-wordmark {
  position: relative; display: inline-block;
  font-family: var(--lb-font-logo); font-weight: 700; line-height: 1;
  letter-spacing: -.015em; text-transform: uppercase;
}
.lb-wordmark .lb-star {
  position: absolute; right: -.42em; top: -.38em; width: .5em; height: .5em;
}
.lb-lockup { display: inline-flex; flex-direction: column; align-items: center; }
.lb-lockup .lb-wordmark { font-size: var(--lb-lockup-size, 64px); }
.lb-lockup__sub {
  margin-top: .5em; font-size: calc(var(--lb-lockup-size, 64px) * .26);
  font-weight: 500; letter-spacing: 1.1em; margin-right: -1.1em; text-transform: uppercase;
}
.lb-star { color: var(--lb-violet); fill: currentColor; }

/* ==========================================================================
   Barra de navegación global (inyectada por /shared/js/lubalink.js)
   ========================================================================== */
.lb-gnav {
  position: sticky; top: 0; z-index: 100; height: var(--lb-gnav-h);
  background: rgba(13, 18, 32, .86); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--lb-line);
  transition: background .3s, border-color .3s;
}
.lb-gnav--overlay { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(13,18,32,.7), rgba(13,18,32,0)); border-color: transparent; backdrop-filter: none; }
.lb-gnav--overlay.is-solid, .lb-gnav--overlay.is-open { background: rgba(13, 18, 32, .92); backdrop-filter: saturate(140%) blur(14px); border-color: var(--lb-line); }
.lb-gnav--compact { --lb-gnav-h: 48px; position: relative; background: #080B15; font-size: 13px; }
.lb-gnav--compact .lb-gnav__brand-icon { width: 24px; height: 24px; }
.lb-gnav--compact .lb-gnav__brand .lb-wordmark { font-size: 17px; }

.lb-gnav__inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.lb-gnav__brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.lb-gnav__brand-icon { width: 32px; height: 32px; }
.lb-gnav__brand .lb-wordmark { font-size: 22px; }
.lb-gnav__logo { height: 22px; width: auto; }
.lb-gnav--compact .lb-gnav__logo { height: 17px; }

.lb-gnav__menu { display: flex; align-items: center; gap: 4px; height: 100%; }
.lb-gnav__link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 100%;
  padding: 0 14px; font-weight: 500; color: var(--lb-text-muted); transition: color .2s;
}
.lb-gnav__link:hover, .lb-gnav__link[aria-expanded="true"], .lb-gnav__link.is-active { color: #fff; }
.lb-gnav__link.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--lb-violet); border-radius: 2px;
}
.lb-gnav__chev { width: 10px; height: 10px; transition: transform .2s; }
.lb-gnav__link[aria-expanded="true"] .lb-gnav__chev { transform: rotate(180deg); }

.lb-gnav__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lb-gnav__burger { display: none; width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center; }
.lb-gnav__burger span, .lb-gnav__burger span::before, .lb-gnav__burger span::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .25s, background .2s;
}
.lb-gnav__burger span::before, .lb-gnav__burger span::after { content: ""; position: absolute; left: 0; }
.lb-gnav__burger span::before { top: -6px; }
.lb-gnav__burger span::after { top: 6px; }
.lb-gnav.is-open .lb-gnav__burger span { background: transparent; }
.lb-gnav.is-open .lb-gnav__burger span::before { transform: translateY(6px) rotate(45deg); }
.lb-gnav.is-open .lb-gnav__burger span::after { transform: translateY(-6px) rotate(-45deg); }

/* Cuenta de Lubalink en la barra global */
.lb-gnav__launcher svg { width: 16px; height: 16px; }
.lb-gnav__link--mobile { display: none; }
.lb-acct { position: relative; display: flex; align-items: center; }
.lb-acct__login { height: auto; padding: 8px 12px; color: var(--lb-text); font-weight: 600; }
.lb-acct__btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--lb-text); box-shadow: inset 0 0 0 1px var(--lb-line-strong); transition: background .2s; }
.lb-acct__btn:hover, .lb-acct__btn[aria-expanded="true"] { background: rgba(255, 255, 255, .07); }
.lb-acct__btn .lb-gnav__chev { margin-right: 2px; }
.lb-acct__avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--lb-violet); color: #fff; font-size: 13px; font-weight: 700; }
.lb-gnav--compact .lb-acct__avatar { width: 24px; height: 24px; font-size: 12px; }
.lb-acct__name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-acct__menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 120; min-width: 230px; padding: 8px; border-radius: 14px; background: #0A0E1A; box-shadow: inset 0 0 0 1px var(--lb-line-strong), 0 24px 48px -16px rgba(0, 0, 0, .8); display: grid; animation: lb-drop .2s var(--lb-ease); }
.lb-acct__menu[hidden] { display: none; }
.lb-acct__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--lb-line); margin-bottom: 6px; display: grid; }
.lb-acct__head small { color: var(--lb-text-muted); font-size: 12px; overflow-wrap: anywhere; }
.lb-acct__menu a, .lb-acct__menu button { display: block; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--lb-text); }
.lb-acct__menu a:hover, .lb-acct__menu button:hover { background: rgba(255, 255, 255, .06); }

/* Panel desplegable de juegos */
.lb-gnav__panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #0A0E1A; border-bottom: 1px solid var(--lb-line);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
  padding: 28px 0 32px;
  animation: lb-drop .25s var(--lb-ease);
}
.lb-gnav__panel[hidden] { display: none; }
@keyframes lb-drop { from { opacity: 0; transform: translateY(-8px); } }
.lb-gnav__panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.lb-gnav__games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.lb-gamecard {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 16 / 10; padding: 16px; border-radius: var(--lb-radius); overflow: hidden;
  background: var(--lb-midnight-3); isolation: isolate;
  box-shadow: inset 0 0 0 1px var(--lb-line);
}
.lb-gamecard__art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--lb-ease); }
.lb-gamecard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(8, 11, 21, .92)); }
.lb-gamecard:hover .lb-gamecard__art { transform: scale(1.05); }
.lb-gamecard:hover { box-shadow: inset 0 0 0 1px rgba(124, 107, 255, .7); }
.lb-gamecard__logo { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: 46%; max-width: 150px; filter: drop-shadow(0 4px 18px rgba(0,0,0,.7)); transition: transform .4s var(--lb-ease); }
.lb-gamecard:hover .lb-gamecard__logo { transform: translate(-50%, -50%) scale(1.04); }
.lb-gamecard__name { font-family: var(--lb-font-logo); font-weight: 700; font-size: 24px; letter-spacing: .01em; }
.lb-gamecard__meta { font-size: 12px; color: var(--lb-text-muted); }
.lb-gamecard__badge {
  position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: rgba(13, 18, 32, .7); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px var(--lb-line-strong);
}
.lb-gamecard--secret {
  align-items: center; justify-content: center; text-align: center; gap: 6px;
  background: repeating-linear-gradient(135deg, var(--lb-midnight-2) 0 12px, var(--lb-midnight-3) 12px 24px);
}
.lb-gamecard--secret::before { display: none; }
.lb-gamecard--secret .lb-star { width: 28px; height: 28px; opacity: .8; }

/* Móvil */
@media (max-width: 960px) {
  .lb-gnav__burger { display: inline-flex; }
  .lb-gnav__menu {
    position: absolute; top: 100%; left: 0; right: 0; height: auto; max-height: calc(100vh - var(--lb-gnav-h)); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--lb-gutter) 24px;
    background: #0A0E1A; border-bottom: 1px solid var(--lb-line);
  }
  .lb-gnav:not(.is-open) .lb-gnav__menu { display: none; }
  .lb-gnav__link { height: 52px; padding: 0; border-bottom: 1px solid var(--lb-line); font-size: 16px; justify-content: space-between; }
  .lb-gnav__link.is-active::after { display: none; }
  .lb-gnav__panel { position: static; padding: 12px 0 16px; background: none; border: 0; box-shadow: none; animation: none; }
  .lb-gnav__panel .lb-container { padding: 0; }
  .lb-gnav__games { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lb-gnav__actions .lb-btn { display: none; }
  .lb-gnav__link--mobile { display: flex; }
  .lb-acct__name { display: none; }
}
@media (max-width: 520px) {
  .lb-gnav__games { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Pie de página global
   ========================================================================== */
.lb-footer { background: #080B15; border-top: 1px solid var(--lb-line); padding: 64px 0 32px; font-size: 14px; }
.lb-footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.lb-footer__logo img { width: 190px; height: auto; }
.lb-footer__brand p { color: var(--lb-text-muted); margin-top: 18px; max-width: 32ch; }
.lb-footer__brand .lb-lockup { --lb-lockup-size: 34px; align-items: flex-start; }
.lb-footer__brand .lb-lockup__sub { margin-right: 0; }
.lb-footer h4 { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--lb-text-muted); font-weight: 600; margin-bottom: 16px; }
.lb-footer li + li { margin-top: 10px; }
.lb-footer li a { color: var(--lb-text); opacity: .85; transition: color .2s, opacity .2s; }
.lb-footer li a:hover { color: var(--lb-violet-hi); opacity: 1; }
.lb-footer__social { display: flex; gap: 10px; margin-top: 24px; }
.lb-footer__social a {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--lb-line); transition: background .2s;
}
.lb-footer__social a:hover { background: var(--lb-violet-lo); }
.lb-footer__social svg { width: 18px; height: 18px; fill: currentColor; }
.lb-footer__bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--lb-line); color: var(--lb-text-muted); font-size: 13px;
}
.lb-footer__legal { display: flex; gap: 20px; flex-wrap: wrap; }
.lb-footer__legal a:hover { color: #fff; }
@media (max-width: 860px) {
  .lb-footer__top { grid-template-columns: 1fr 1fr; }
  .lb-footer__brand { grid-column: 1 / -1; }
}

/* Aparición al hacer scroll */
.lb-reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--lb-ease), transform .8s var(--lb-ease); }
.lb-reveal.is-visible { opacity: 1; transform: none; }
