/* ==========================================================
   LINEAGE 2 MULTISKILLS - Hoja de estilos principal
   Estilo inspirado en la web oficial de Lineage II
   ========================================================== */

:root {
  --bg: #0a0e26;
  --bg-band: #12302f;
  --panel: #0d1a2e;
  --gold: #c9a96a;
  --gold-light: #e8d3a0;
  --teal: #2fb5a8;
  --text: #d9dccf;
  --muted: #9ba5ab;
  --line: rgba(201, 169, 106, .3);
  --font-title: "Cinzel", Georgia, serif;
  --font-serif: "Cormorant Garamond", "Cinzel", Georgia, serif;
  --top-h: 45px;   /* alto minimo de la barra superior (se va con el scroll) */
  --nav-h: 48px;   /* alto minimo del menu (queda fijo arriba) */
  /* Velo oscuro sobre los fondos: cambialo para aclarar u oscurecer todas las imagenes */
  --overlay: linear-gradient(rgba(10, 14, 38, .5), rgba(10, 14, 38, .82));
}

html { scroll-padding-top: var(--nav-h); }

/* Snap suave (solo escritorio) y solo en secciones que entran en pantalla:
   js/main.js agrega .snap-ok a las que caben en la ventana. En celular no hay snap.
   Con mouse (escritorio) no hace falta: js/main.js mueve de seccion en seccion. */
.snap-ok { scroll-snap-align: start; }
@media (min-width: 992px) and (pointer: coarse) { html { scroll-snap-type: y proximity; } }
html.is-scrolling { scroll-snap-type: none !important; }   /* mientras anima el JS */

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- ACCESIBILIDAD: foco y "saltar al contenido" ---------- */
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.main-nav a:focus-visible, .nav-toggle:focus-visible { outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }   /* secciones y <main> reciben foco por JS, sin recuadro */

.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  padding: 10px 16px; color: var(--gold-light);
  background: var(--bg); border: 1px solid var(--gold);
}
.skip-link:focus { top: 8px; }

/* ---------- FONDOS DE SECCION (capas fijas con fundido) ----------
   Una capa por seccion, todas fijas detras de la pagina. js/main.js activa la capa
   de la seccion que esta en el centro de la pantalla y las demas se desvanecen.
   Imagenes en img/: bg-inicio, bg-noticias, bg-informacion, bg-descargas,
   bg-estadisticas, bg-comunidad (.webp). Si falta una se ve el degradado de respaldo.
   Parallax: al scrollear, el fondo se desplaza mas lento que el contenido (--py). */
.bg-stack {
  position: fixed; top: 0; left: 0; width: 100%;
  height: 100vh; height: 100lvh;
  z-index: -1; pointer-events: none; background: var(--bg);
}
.bg-layer {
  /* mas alta que la pantalla: el sobrante es el margen que usa el parallax */
  position: absolute; inset: -15vh 0; opacity: 0; scale: 1.1;
  translate: 0 var(--py, 0px);   /* parallax: js/main.js actualiza --py con el scroll */
  will-change: translate, opacity;
  /* sale con un pequeno retraso: asi se cruza con la que entra sin "hueco" oscuro */
  transition: opacity .9s ease .35s, scale 0s linear 1.3s;
}
.bg-layer.is-active {
  opacity: 1; scale: 1;
  transition: opacity .9s ease 0s, scale 2.4s cubic-bezier(.2, .7, .2, 1) 0s;
}
html:not(.js) .bg-layer:first-child { opacity: 1; scale: 1; }

.bg-layer[data-for="inicio"] {
  background:
    var(--overlay),
    url("../img/bg-inicio.webp") center / cover no-repeat,
    radial-gradient(ellipse at 80% 30%, #5a6e88 0, transparent 45%),
    radial-gradient(ellipse at 15% 40%, #2a4a8a 0, transparent 50%),
    linear-gradient(#3a4a66, var(--bg));
}
.bg-layer[data-for="noticias"]     { background: var(--overlay), url("../img/bg-noticias.webp") center / cover no-repeat, var(--bg-band); }
.bg-layer[data-for="informacion"]  { background: var(--overlay), url("../img/bg-informacion.webp") center / cover no-repeat, var(--bg); }
.bg-layer[data-for="descargas"]    { background: var(--overlay), url("../img/bg-descargas.webp") center / cover no-repeat, linear-gradient(120deg, #2f5a8a, #7a3a2a 70%, #3a2a2a); }
.bg-layer[data-for="estadisticas"] { background: var(--overlay), url("../img/bg-estadisticas.webp") center / cover no-repeat, var(--bg-band); }
.bg-layer[data-for="comunidad"]    { background: var(--overlay), url("../img/bg-comunidad.webp") center / cover no-repeat, var(--bg); }

/* ---------- TOP ---------- */
.top {
  min-height: var(--top-h);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  padding: 0 24px;
  background: rgba(10, 14, 38, .72);
  border-bottom: 1px solid var(--line);
  font-size: .875rem; letter-spacing: .08em;
}
.top .logo { font-family: var(--font-title); font-size: 1.25rem; letter-spacing: .2em; color: var(--gold-light); text-transform: uppercase; white-space: nowrap; }
.top .links a { display: inline-block; margin-left: 18px; padding: 6px 0; color: var(--muted); text-transform: uppercase; }
.top .links a:hover { color: var(--gold-light); }

/* ---------- NAV ---------- */
.main-nav {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px; overflow-x: auto;
  background: rgba(10, 14, 38, .72);
  border-bottom: 1px solid var(--line);
  font-size: .9375rem;
}
.main-nav a { white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 36px; padding: 0; font-size: 1.375rem; line-height: 1;
  color: var(--gold-light); background: none; border: 1px solid var(--line);
}
.main-nav a:hover, .main-nav a.active { color: var(--gold-light); }
.main-nav .btn-play { margin-left: auto; }

/* ---------- BOTON JUGAR ---------- */
.btn-play {
  display: inline-block;
  font-family: var(--font-title); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-light) !important;
  border: 1px solid var(--gold);
  padding: 5px 26px;
  background: linear-gradient(#1c4b49, #0f2e33);
}
.btn-play:hover { filter: brightness(1.35); }
/* Descarga sin enlace todavia */
.btn-play.is-disabled { cursor: default; filter: none; color: var(--muted) !important; background: rgba(13, 26, 46, .7); border-color: rgba(201, 169, 106, .3); }
.btn-play.is-disabled small { text-transform: none; letter-spacing: 0; }
.btn-play.is-disabled:hover { transform: none; box-shadow: none; filter: none; }

/* ---------- HERO ---------- */
.hero {
  min-height: calc(100vh - var(--top-h) - var(--nav-h));
  min-height: calc(100dvh - var(--top-h) - var(--nav-h));
  scroll-margin-top: var(--top-h);   /* al volver arriba muestra tambien la barra superior */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 16px;
}
.hero h1 {
  font-family: var(--font-title); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.25rem, 8vw, 5rem); letter-spacing: .18em; line-height: 1.15;
  color: var(--gold-light); text-shadow: 0 4px 24px #000; margin: 0;
}
.hero h1 span { display: block; font-size: .55em; letter-spacing: .32em; margin-top: .15em; }
.hero .subtitle { font-family: var(--font-serif); font-size: 1.5rem; color: #fff; margin: 8px 0 14px; }
.hero-desc { max-width: 780px; margin: 0 auto 30px; font-size: 1rem; color: #e3e5dc; text-shadow: 0 2px 10px #000; }

/* Cada card: imagen de fondo + velo del color de la card (--tint) que se oscurece hacia abajo.
   Para mas/menos color cambia el ultimo numero (.6) de --tint; para mas/menos oscuridad el .8 del degradado. */
.hero-card {
  height: 100%; min-height: 250px; padding: 22px 18px;
  border: 1px solid var(--line); text-align: center;
  background:
    linear-gradient(to bottom, var(--tint) 0%, rgba(0, 0, 0, .8) 100%),
    var(--img) center / cover no-repeat,
    var(--tint-solid);
}
.hero-card .tag { display: block; text-align: left; font-size: .875rem; margin-bottom: 22px; }
.hero-card-title { font-family: var(--font-title); font-weight: 400; font-size: 1.5rem; text-transform: uppercase; color: #e6e6e6; margin-bottom: 12px; }
.hero-card p { font-size: .9375rem; color: #dfe2da; margin: 0; }
.hero-card.c1 { --tint: rgba(74, 31, 106, .6); --tint-solid: #4a1f6a; --img: url("../img/multiskills.jpg"); }
.hero-card.c2 { --tint: rgba(28, 42, 106, .6); --tint-solid: #1c2a6a; --img: url("../img/lowrates.jpg"); }
.hero-card.c3 { --tint: rgba(29, 90, 64, .6);  --tint-solid: #1d5a40; --img: url("../img/autohunt.jpg"); }

/* ---------- SECCIONES ---------- */
.section {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100dvh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 0;
}
.section > .container { width: 100%; margin-top: auto; margin-bottom: auto; }

.section-title {
  font-family: var(--font-title); font-weight: 400; text-align: center;
  color: var(--gold); font-size: 1.875rem; margin-bottom: 40px;
}
.section-title::before, .section-title::after { content: "❖"; font-size: 1rem; opacity: .7; margin: 0 16px; }

/* ---------- NOTICIAS ---------- */
.news-feat {
  min-height: 230px; padding: 22px; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  border: 1px solid var(--line);
  background: linear-gradient(#0008, #000d), linear-gradient(135deg, #2a3a55, #4a3a2a);
}
.news-feat em { color: var(--teal); font-style: normal; font-size: .875rem; }
.news-feat b { font-family: var(--font-title); font-weight: 400; font-size: 1.625rem; color: var(--gold-light); }

.news-list a {
  display: block; position: relative; padding: 14px 0 14px 46px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.news-list a::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 28px; height: 28px;
  border: 1px solid var(--gold); border-radius: 50%;
  background: radial-gradient(#c9a96a55, transparent);
}
.news-list a:hover { color: var(--gold-light); }
.news-list .news-cat { color: var(--gold); }
.news-list small { display: block; font-size: .8125rem; color: var(--muted); }
.news-feat { background-size: cover; background-position: center; }
.news-empty, .social-empty { text-align: center; font-family: var(--font-serif); font-size: 1.25rem; color: #e3e5dc; }
.footer-links { margin: 0 0 6px; }
.footer-legal { margin: 0; font-size: .8125rem; }

.channels-bar {
  margin-top: 36px; padding: 20px; text-align: center;
  border: 1px solid var(--gold);
  background: linear-gradient(#5a4a2a, #3a2e1a);
  font-family: var(--font-serif); font-size: 1.25rem;
}
.channels-bar a { display: inline-block; margin: 0 18px; padding: 4px 0; }
.channels-bar a:hover { color: #fff; }

/* ---------- CAJAS ---------- */
.box { height: 100%; padding: 24px; background: rgba(13, 26, 46, .78); border: 1px solid var(--line); }
.box h3 { font-family: var(--font-title); font-weight: 400; font-size: 1.25rem; color: var(--gold-light); margin-bottom: 14px; }
.box ul { padding-left: 18px; margin: 0; }
.box li { margin: 6px 0; }

.table-l2 { width: 100%; font-size: .9375rem; }
.table-l2 caption { caption-side: top; padding: 0 0 4px; font-size: .875rem; text-transform: uppercase; color: var(--muted); }
.table-l2 th, .table-l2 td { padding: 7px 4px; border-bottom: 1px solid rgba(255, 255, 255, .02); }
.table-l2 th { font-weight: 400; text-align: left; }
.table-l2 td:last-child { text-align: right; color: var(--gold-light); }

/* ---------- ESTADISTICAS ---------- */
/* Estado de los servidores (GameServer / LoginServer) */
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); flex: 0 0 auto; }
.status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.status-row b { margin-left: auto; font-family: var(--font-title); font-weight: 400; text-transform: uppercase; color: var(--teal); }
/* Apagado (rojo) o sin datos (gris): el texto lo dice, el color acompaña */
.status-row.is-off .dot { background: #e5675c; box-shadow: 0 0 10px #e5675c; animation: none; }
.status-row.is-off b { color: #f08a80; }
.status-row.is-na .dot { background: var(--muted); box-shadow: none; animation: none; }
.status-row.is-na b { color: var(--muted); }
.stats-updated { margin: 14px 0 0; text-align: right; font-size: .8125rem; color: var(--muted); }

/* Distribucion por raza: el ancho de .bar-fill es el % de la raza;
   dentro, .m (masculino, azul) y .f (femenino, rosa) reparten ese ancho.
   Los porcentajes tambien estan en texto (no solo por color). */
.bar-row { margin: 10px 0; font-size: .875rem; }
.bar-label { display: flex; justify-content: space-between; gap: 8px; }
.bar-label small { color: var(--muted); font-size: .875rem; }
.bar-track { height: 8px; background: rgba(255, 255, 255, .1); margin-top: 3px; }
.bar-fill { display: flex; height: 100%; }
.bar-fill .m, .bar-legend .m { background: linear-gradient(90deg, #1c3f73, #4aa0ee); }
.bar-fill .f, .bar-legend .f { background: linear-gradient(90deg, #6e1c4c, #e65c9c); }
.bar-legend { margin-top: 12px; font-size: .875rem; color: var(--muted); }
.bar-legend span { display: inline-block; width: 22px; height: 8px; margin: 0 6px 0 0; vertical-align: middle; }
.bar-legend span + span, .bar-legend .f { margin-left: 14px; }

/* Rankings: oro / plata / bronce en los 3 primeros (PvP, PK y Clanes) */
.rank .ico { display: inline-block; width: 24px; }
.rank.r1 th, .rank.r1 td, .rank.r1 td:last-child { color: #d4af37; }
.rank.r2 th, .rank.r2 td, .rank.r2 td:last-child { color: #c0c8d0; }
.rank.r3 th, .rank.r3 td, .rank.r3 td:last-child { color: #cd7f32; }

/* Modificaciones de skills (icono + nombre + descripcion) */
.skill-item { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.skill-icon {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); background: rgba(0, 0, 0, .35); color: var(--gold); font-size: 1.25rem;
}
.skill-name { font-family: var(--font-title); color: var(--gold-light); font-size: 1rem; }
.skill-desc { font-size: .9375rem; color: var(--muted); }

/* ---------- DESCARGAS ---------- */
.download-block {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100dvh - var(--nav-h));
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; padding: 40px 16px;
}
.download-block h2 { font-family: var(--font-title); font-weight: 400; font-size: 2.125rem; color: var(--gold); }
.download-block p { font-family: var(--font-serif); font-size: 1.3125rem; max-width: 640px; margin: 0 auto 26px; }
.download-block .btn-play { min-width: 260px; margin: 6px 0 0; padding: 8px 22px; font-size: .9375rem; text-align: center; }

/* ---------- COMUNIDAD ---------- */
.social { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.social a { width: 84px; text-align: center; font-size: .875rem; color: var(--text); text-shadow: 0 1px 6px #000; }
.social a i {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 6px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel); font-size: 1.5rem; color: var(--gold-light);
}
.social a:hover i { border-color: var(--gold); box-shadow: 0 0 14px rgba(201, 169, 106, .35); }
.social a:hover { color: var(--gold-light); }

/* ---------- FOOTER ---------- */
.footer { text-align: center; padding: 24px 16px 0; font-size: .875rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer a { display: inline-block; margin: 0 6px; padding: 6px 4px; }
.footer a:hover { color: var(--gold-light); }

/* ==================== TRANSICIONES Y ANIMACIONES ====================
   - Hover: transiciones suaves en enlaces, botones, cards y cajas.
   - Entrada: al llegar a una seccion, sus elementos aparecen de a uno (js/main.js
     les agrega .reveal y la clase .in-view a la seccion). Se repite al volver.
   - `translate`/`scale` para la entrada y `transform` para el hover: no se pisan.
   - Sin JS (clase .js ausente) todo se ve normal.
   - Las animaciones son iguales para todos: no dependen de la configuracion
     "reducir movimiento" del sistema o del navegador. */

a { transition: color .2s ease; }

.hero-card, .box, .news-feat, .btn-play, .news-list a, .skill-item, .social a i, .table-l2 tr {
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease,
              background-color .25s ease, color .2s ease, filter .2s ease;
}
.news-list a::before { transition: box-shadow .25s ease; }

/* Subrayado animado en el menu (escritorio) */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px;
  background: var(--gold); transform: scaleX(0); transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.table-l2 tr:hover { background: rgba(255, 255, 255, .05); }
.skill-item:hover { background: rgba(201, 169, 106, .07); }

@media (hover: hover) {
  .hero-card:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 12px 28px rgba(0, 0, 0, .5); }
  .box:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
  .news-feat:hover { border-color: var(--gold); box-shadow: 0 0 22px rgba(201, 169, 106, .25); }
  .news-list a:hover { transform: translateX(6px); }
  .news-list a:hover::before { box-shadow: 0 0 12px rgba(201, 169, 106, .6); }
  .btn-play:hover { transform: translateY(-2px); box-shadow: 0 0 16px rgba(47, 181, 168, .35); }
  .social a:hover i { transform: translateY(-3px); }
}

/* Punto de estado que "respira" */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 6px var(--teal); }
  50%      { box-shadow: 0 0 16px var(--teal), 0 0 4px var(--teal); }
}
.dot { animation: pulse 2s ease-in-out infinite; }

/* Entrada de elementos al llegar a la seccion */
.js .reveal {
  opacity: 0; translate: 0 28px;
  transition: opacity .8s ease var(--d, 0ms),
              translate .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms),
              scale .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms),
              transform .25s ease, border-color .25s ease, box-shadow .25s ease,
              background-color .25s ease, color .2s ease, filter .2s ease;
}
.js .reveal-down  { translate: 0 -30px; }
.js .reveal-left  { translate: -40px 0; }
.js .reveal-right { translate: 40px 0; }
.js .reveal-zoom  { translate: 0 12px; scale: .85; }
.js .in-view .reveal { opacity: 1; translate: 0 0; }
.js .in-view .reveal-zoom { scale: 1; }
/* Si algo dentro recibe foco (teclado) se muestra de inmediato */
.js .reveal:focus-within { opacity: 1; translate: 0 0; scale: 1; transition-delay: 0ms; }

/* Barras de distribucion: se "llenan" al entrar la seccion */
.js .bar-fill {
  transform: scaleX(0); transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1) .4s;
}
.js .in-view .bar-fill { transform: scaleX(1); }

/* ==================== RESPONSIVE (tablet y celular) ==================== */
@media (max-width: 991px) {
  /* Menu hamburguesa: los enlaces pasan a un panel desplegable */
  .main-nav { overflow: visible; padding: 0 14px; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    background: rgba(10, 14, 38, .97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .5);
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a::after { display: none; }
  .nav-links a { padding: 14px 24px; font-size: 1rem; border-top: 1px solid rgba(255, 255, 255, .06); }
  .main-nav .btn-play { padding: 4px 16px; font-size: .9375rem; }
}

@media (max-width: 767px) {
  :root { --top-h: 40px; }
  .top { padding: 0 14px; }
  .top .logo { font-size: .9375rem; letter-spacing: .12em; }
  .top .links a { margin-left: 12px; font-size: .8125rem; }

  .hero { padding: 24px 12px; }
  .hero .subtitle { font-size: 1.25rem; }
  .hero-desc { font-size: 1rem; margin-bottom: 20px; }
  .hero-card { min-height: 0; padding: 16px; }
  .hero-card .tag { margin-bottom: 8px; }
  .hero-card-title { font-size: 1.25rem; }

  .section { padding: 28px 0; }
  .section-title { font-size: 1.5rem; margin-bottom: 24px; }
  .section-title::before, .section-title::after { margin: 0 8px; }
  .news-feat { min-height: 180px; }
  .news-feat b { font-size: 1.375rem; }
  .channels-bar { margin-top: 24px; padding: 14px; font-size: 1.0625rem; }
  .channels-bar a { margin: 0 10px; }
  .box { padding: 16px; }

  .download-block h2 { font-size: 1.75rem; }
  .download-block p { font-size: 1.125rem; }
  .download-block .btn-play { width: 100%; max-width: 320px; }
  .social { gap: 10px; }
  .social a { width: 72px; }
  .social a i { width: 48px; height: 48px; font-size: 1.25rem; }
}

@media (max-width: 575px) {
  :root { --top-h: 38px; }
  .hide-xs { display: none !important; }   /* oculta "/ Registrarse" y "Soporte" en el top */
  .hero h1 { font-size: clamp(1.75rem, 9vw, 2.75rem); letter-spacing: .1em; }
  .hero h1 span { letter-spacing: .22em; }
  .bar-label { flex-wrap: wrap; }
  .bar-label small { display: block; width: 100%; order: 3; }
}

/* ==================== IMPRESION ==================== */
@media print {
  .bg-stack, .skip-link, .main-nav { display: none !important; }
  .js .reveal { opacity: 1 !important; translate: none !important; scale: none !important; }
  .hero, .section, .download-block { min-height: 0; }
}
