/* =========================================================================
   Rakion · Chaos Force
   Mismo sistema visual que el launcher WPF: superficies casi negras con viés
   azul frio, acento ciano tomado de la energia de la key art, y dorado solo
   para la marca. La jerarquia la carga la tipografia, no el color.
   ========================================================================= */

:root {
  /* Superficies en capas */
  --s0: #07090d;
  --s1: #0d1017;
  --s2: #141822;
  --s3: #1e232f;
  --line: #28303e;

  --accent: #35c8e0;
  --accent-hi: #55dcf2;
  --on-accent: #04161c;
  --gold: #f0a93c;

  --ok: #49e08a;
  --bad: #ff5c6c;

  --text: #f2f5f8;
  --dim: #9aa6b6;
  --mute: #636e7e;

  --wrap: 1120px;
  --r: 6px;

  /* Colores de clase: cada una con su tono, usados en etiquetas y filtros */
  --c0: #ff8a5c;  /* Swordman */
  --c1: #6fdc7f;  /* Archer   */
  --c2: #d8b25a;  /* Blacksmith */
  --c3: #b98cff;  /* Mage     */
  --c4: #7cc4ff;  /* Ninja    */

  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* NOTA: aqui iba un bloque @media (prefers-reduced-motion: reduce) que anulaba todas las
   animaciones. Se quito a peticion expresa: Windows tiene "Mostrar animaciones" desactivado
   en esta maquina, asi que ese bloque dejaba el sitio completamente estatico para el dueno.
   Contrapartida honesta: los visitantes que activen esa opcion del sistema (por mareo o
   sensibilidad vestibular) ahora veran el movimiento igual. */

body {
  margin: 0;
  background: var(--s0);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* height:auto neutraliza el atributo height="" del HTML. Sin esto el navegador conserva la
   altura declarada mientras el ancho se encoge, y las imagenes salen estiradas. */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

/* Accesibilidad: el salto de contenido solo aparece al tabular */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; font-weight: 700; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ============================== Barra superior ============================== */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--s0) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 3px; height: 26px; border-radius: 2px; background: var(--gold); flex: none; }
.brand-text { font-weight: 800; font-size: 17px; letter-spacing: .02em; line-height: 1.1; }
.brand-text em {
  display: block; font-style: normal; font-size: 10px; font-weight: 600;
  color: var(--mute); letter-spacing: .18em; text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  padding: 9px 14px; border-radius: var(--r); color: var(--dim);
  font-size: 14px; font-weight: 600; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--s2); }
.nav a.on { color: var(--text); }
/* Subrayado del activo: marca la pagina sin gritar */
.nav a.on { position: relative; }
.nav a.on::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav .ghost { border: 1px solid var(--line); margin-left: 6px; }
.nav .ghost:hover { border-color: var(--accent); }
.nav .cta {
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.nav .cta:hover { background: var(--accent-hi); color: var(--on-accent); }

/* ---- Pastilla de cuenta + salir ---- */
.account-chip {
  display: flex; align-items: stretch; margin-left: 8px;
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: var(--s2);
  transition: border-color .18s ease;
}
.account-chip:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.ac-name {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; color: var(--text); font-size: 13.5px; font-weight: 700;
  transition: background .18s ease;
}
.ac-name:hover { background: var(--s3); color: var(--text); }
.ac-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none;
  animation: ping 2.4s ease-out infinite;
}
.ac-cash {
  font-size: 11.5px; font-weight: 700; color: var(--gold);
  padding-left: 9px; border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.ac-out { display: flex; }
.ac-out button {
  display: flex; align-items: center; justify-content: center;
  width: 38px; border: 0; border-left: 1px solid var(--line);
  background: transparent; color: var(--dim); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.ac-out button:hover { background: color-mix(in srgb, var(--bad) 16%, var(--s3)); color: var(--bad); }
.ac-out button:active svg { transform: translateX(2px); }
.ac-out svg { transition: transform .18s cubic-bezier(.16,1,.3,1); }

/* ---- Barra de progreso de lectura ---- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40;
  pointer-events: none; background: transparent;
}
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0); transform-origin: left;
  will-change: transform;
}

/* ---- Volver arriba ---- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 30;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--s2); color: var(--text);
  border: 1px solid var(--line); cursor: pointer;
  opacity: 0; transform: translateY(12px) scale(.9);
  transition: opacity .25s ease, transform .25s cubic-bezier(.16,1,.3,1),
              background .18s ease, border-color .18s ease;
}
.to-top.on { opacity: 1; transform: none; }
.to-top:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.to-top:hover svg { animation: nudge .6s ease; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-3px); }
}

.nav-toggle { display: none; }

/* ============================== Botones ============================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--r); border: 1px solid transparent;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  cursor: pointer; transition: background .16s, border-color .16s, transform .12s, color .16s;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hi); color: var(--on-accent); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: var(--s2); border-color: var(--line); color: var(--dim); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }
.btn.small { padding: 9px 16px; font-size: 13px; }
.btn.wide { width: 100%; }

/* ============================== Pildora de estado ============================== */

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 15px; border-radius: 999px;
  background: color-mix(in srgb, var(--s0) 72%, transparent);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); flex: none; }
.pill.on i { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: ping 2s ease-out infinite; }
.pill.off i { background: var(--bad); }

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================== Portada ============================== */

.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-art {
  position: absolute; inset: 0; z-index: -2;
  background: url("../img/hero.jpg") center 22% / cover no-repeat;
}
/* Scrim funcional: sin el, el texto compite con la ilustracion.
   El degradado horizontal se mantiene fuerte hasta pasado el ancho de la columna de texto
   (~660px de 1120): a 1280px de viewport la imagen entra completa y el personaje queda justo
   detras del titulo, asi que la legibilidad depende de este apagado y no del encuadre. */
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,9,13,.70) 0%, rgba(7,9,13,.26) 32%, rgba(7,9,13,.88) 80%, var(--s0) 100%),
    linear-gradient(90deg, rgba(7,9,13,.92) 0%, rgba(7,9,13,.78) 34%, rgba(7,9,13,.34) 62%, rgba(7,9,13,.62) 100%);
}
.hero-in { padding: clamp(72px, 13vw, 148px) 0 clamp(56px, 8vw, 96px); max-width: 660px; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(52px, 10vw, 104px); font-weight: 800; letter-spacing: -0.035em;
  line-height: .92; margin-bottom: 20px;
}
.hero-title span {
  display: block; font-size: clamp(15px, 2.4vw, 22px); font-weight: 600;
  letter-spacing: .32em; text-transform: uppercase; color: var(--dim);
  margin-top: 12px;
}
.hero-lead { font-size: clamp(15px, 1.7vw, 18px); color: var(--dim); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 22px; }

/* ============================== Cifras ============================== */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r);
  margin-top: -34px; position: relative; z-index: 2; overflow: hidden;
}
.stat { background: var(--s1); padding: 22px 20px; text-align: center; }
.stat-n {
  display: block; font-size: clamp(24px, 3.4vw, 32px); font-weight: 800;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.stat-l {
  display: block; margin-top: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--mute);
}

/* ============================== Bloques ============================== */

.block { padding: clamp(56px, 8vw, 88px) 0 0; }
.block-head { margin-bottom: 30px; }
.block-head h2 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.02em; }
.block-head p { color: var(--dim); margin-top: 7px; }
.block-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; padding: clamp(36px, 6vw, 60px) 0 28px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -0.025em; }
.page-head p { color: var(--dim); margin-top: 6px; }

/* ============================== Clases ============================== */

.classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.class-card {
  position: relative; isolation: isolate;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
  transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
/* Filo superior con el color de la clase: aparece al pasar por encima */
.class-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px; z-index: 2;
  background: var(--cc, var(--accent));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.class-card:nth-child(1) { --cc: var(--c0); }
.class-card:nth-child(2) { --cc: var(--c1); }
.class-card:nth-child(3) { --cc: var(--c2); }
.class-card:nth-child(4) { --cc: var(--c3); }
.class-card:nth-child(5) { --cc: var(--c4); }

.class-card:hover {
  border-color: color-mix(in srgb, var(--cc) 55%, var(--line));
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.class-card:hover::before { transform: scaleX(1); }

/* Relacion 3/4 en vez del recorte original (0.78): las tarjetas median medio metro de alto.
   object-position sube el encuadre para no cortar la cabeza al recortar. */
.class-card img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 22%;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.class-card:hover img { transform: scale(1.06); }

.class-body { padding: 16px 17px 18px; }
.class-body h3 { font-size: 17px; }
.class-body p { color: var(--dim); font-size: 13px; margin-top: 6px; }

.class-top {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px;
}
.class-top span { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.class-top strong { color: var(--text); }
.class-top em { font-style: normal; color: var(--mute); font-size: 12px; }
.class-top.empty { color: var(--mute); font-size: 12px; }

/* ============================== Tablas de ranking ============================== */

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); }

.rank { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.rank thead th {
  position: sticky; top: 0; background: var(--s2);
  padding: 13px 14px; text-align: left; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--mute); border-bottom: 1px solid var(--line);
}
.rank tbody td { padding: 12px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.rank tbody tr:last-child td { border-bottom: 0; }
.rank tbody tr:hover td { background: color-mix(in srgb, var(--s3) 45%, transparent); }

.rank .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank .name { font-weight: 700; }
.rank .dim { color: var(--mute); }

.pos { font-weight: 800; font-variant-numeric: tabular-nums; width: 54px; color: var(--dim); }
/* Podio: oro, plata, bronce. Unico sitio del sitio donde el color decora */
.pos-1 { color: #f0c040; }
.pos-2 { color: #c9d2dc; }
.pos-3 { color: #d08a4e; }

.move { width: 52px; }
.mv { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mv.up { color: var(--ok); }
.mv.down { color: var(--bad); }
.mv.same, .mv.new { color: var(--mute); }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  border: 1px solid currentColor;
}
.tag.c0 { color: var(--c0); } .tag.c1 { color: var(--c1); } .tag.c2 { color: var(--c2); }
.tag.c3 { color: var(--c3); } .tag.c4 { color: var(--c4); }

/* ============================== Pestanas y filtros ============================== */

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin: 26px 0 18px; }
.tabs a {
  padding: 11px 18px; color: var(--dim); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips a {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--s1); color: var(--dim); font-size: 13px; font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
}
.chips a:hover { color: var(--text); border-color: var(--mute); }
.chips a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips a.c0.on { background: var(--c0); border-color: var(--c0); }
.chips a.c1.on { background: var(--c1); border-color: var(--c1); }
.chips a.c2.on { background: var(--c2); border-color: var(--c2); }
.chips a.c3.on { background: var(--c3); border-color: var(--c3); }
.chips a.c4.on { background: var(--c4); border-color: var(--c4); }

.pager { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px 0; color: var(--dim); font-size: 14px; }
.pager a { font-weight: 600; }

.empty-state {
  padding: 48px 24px; text-align: center; color: var(--mute);
  border: 1px dashed var(--line); border-radius: var(--r); background: var(--s1);
}

/* ============================== Formularios ============================== */

.form-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; padding: clamp(40px, 6vw, 68px) 0; align-items: start; }
.form-page.narrow { grid-template-columns: minmax(0, 460px); justify-content: center; }
.form-col h1 { font-size: clamp(28px, 4.4vw, 38px); letter-spacing: -0.025em; }
.lead { color: var(--dim); margin: 9px 0 28px; }

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 7px; }
.field label .opt { color: var(--mute); font-weight: 400; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: var(--r);
  background: var(--s0); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 15px;
  transition: border-color .15s;
}
.field input:hover { border-color: var(--s3); }
.field input:focus { outline: none; border-color: var(--accent); }
.field.bad input { border-color: var(--bad); }
.hint { font-size: 12px; color: var(--mute); margin-top: 6px; }
.err { font-size: 12.5px; color: var(--bad); margin-top: 6px; font-weight: 600; }

.form-alt { text-align: center; color: var(--dim); font-size: 14px; margin-top: 18px; }

.notice {
  padding: 14px 17px; border-radius: var(--r); margin-bottom: 22px;
  background: var(--s2); border: 1px solid var(--line); font-size: 14px; color: var(--dim);
}
.notice strong { color: var(--text); }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }

.form-aside { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.form-aside h2 { font-size: 16px; margin-bottom: 14px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; }
.checks li { position: relative; padding-left: 22px; margin-bottom: 12px; font-size: 13.5px; color: var(--dim); }
.checks li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.checks strong { color: var(--text); }

.warn-box {
  padding: 14px 16px; border-radius: var(--r); font-size: 13px; color: var(--dim);
  background: color-mix(in srgb, var(--gold) 8%, var(--s2));
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
}
.warn-box strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ============================== En linea ahora ============================== */

.live { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.live-list {
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; min-height: 128px;
}
.who {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--s2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
  animation: rise .4s cubic-bezier(.16,1,.3,1) backwards;
  transition: border-color .16s ease, transform .16s ease;
}
.who:hover { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); transform: translateY(-2px); }
.who i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.who em { font-style: normal; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.live-none { color: var(--mute); font-size: 13.5px; }

.live-chart {
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; min-height: 128px;
}
.live-chart h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 14px;
}
.spark svg { width: 100%; height: 90px; display: block; overflow: visible; }
/* La linea se dibuja sola al aparecer */
.spark-line {
  stroke-dasharray: 2000; stroke-dashoffset: 2000;
  animation: draw 1.6s cubic-bezier(.16,1,.3,1) .2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.spark figcaption {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums;
}
.spark-empty { color: var(--mute); font-size: 13px; }

@media (max-width: 760px) {
  .live { grid-template-columns: minmax(0, 1fr); }
}

/* ============================== Panel de cuenta ============================== */

.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; align-items: start; }

.panel-card {
  position: relative; isolation: isolate;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 22px 24px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.panel-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.panel-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0,0,0,.4);
}
.panel-card:hover::before { transform: scaleX(1); }
/* focus-within: la tarjeta tambien se marca al llegar por teclado, no solo con el raton */
.panel-card:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.panel-card:focus-within::before { transform: scaleX(1); }

.panel-card h3 { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.pc-ico { color: var(--accent); font-size: 11px; }
.pc-lead { color: var(--dim); font-size: 13.5px; margin: 8px 0 20px; }
.pc-lead .cost { color: var(--gold); }
.pc-foot { color: var(--mute); font-size: 12px; margin-top: 14px; }
.pc-empty { color: var(--mute); font-size: 13px; }

/* El <select> nativo trae el estilo del sistema (blanco); se rehace entero */
.field select {
  width: 100%; padding: 12px 14px; border-radius: var(--r);
  background: var(--s0); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 14px; cursor: pointer;
  appearance: none;
  /* Flecha dibujada en el fondo: un <svg> aparte seria un archivo mas por un triangulo */
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
                    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: right 18px center, right 13px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .15s;
}
.field select:hover { border-color: var(--s3); }
.field select:focus { outline: none; border-color: var(--accent); }
.field select option { background: var(--s2); color: var(--text); }

.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ============================== Pasos, descargas y FAQ ============================== */

.steps { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(26px, 4vw, 38px); }
.steps h2 { font-size: clamp(20px, 3vw, 26px); margin-bottom: 20px; }
.steps ol { margin: 0 0 24px; padding-left: 22px; color: var(--dim); }
.steps li { margin-bottom: 11px; }
.steps strong { color: var(--text); }

.dl-list { display: grid; gap: 10px; }
.dl {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--text); transition: border-color .16s, transform .16s;
}
.dl:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.dl-name { font-weight: 700; }
.dl-size { color: var(--mute); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.dl-go { color: var(--accent); font-size: 18px; font-weight: 700; }

.faq { margin-top: 40px; }
.faq h2 { font-size: clamp(20px, 3vw, 26px); margin-bottom: 18px; }
.faq details {
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 18px; margin-bottom: 9px;
}
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--accent); font-weight: 800; }
.faq details[open] summary::before { content: "− "; }
.faq details p { color: var(--dim); font-size: 14px; margin-top: 11px; }
.faq code, .steps code, .notice code {
  background: var(--s0); border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 6px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace;
}

/* ============================== Pie ============================== */

.foot { margin-top: clamp(64px, 9vw, 104px); border-top: 1px solid var(--line); background: var(--s1); }
.foot-in { padding: 34px 0; display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.foot-brand { font-weight: 800; letter-spacing: .02em; }
.foot-brand span { color: var(--mute); font-weight: 600; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; margin-left: 8px; }
.foot-note { color: var(--mute); font-size: 12.5px; max-width: 54ch; }

/* =========================================================================
   MOVIMIENTO
   Regla unica: solo se animan opacity y transform. Cualquier otra propiedad
   (height, margin, top) dispara layout en cada cuadro y se nota en scroll.
   Todo esto queda anulado por el bloque prefers-reduced-motion de arriba.
   ========================================================================= */

/* ---- Entrada del heroe: escalonada, de arriba hacia abajo ---- */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: none; }
}

.hero-in > * { animation: rise .7s cubic-bezier(.16,1,.3,1) backwards; }
.hero-in > .eyebrow      { animation-delay: .05s; }
.hero-in > .hero-title   { animation-delay: .13s; }
.hero-in > .hero-lead    { animation-delay: .23s; }
.hero-in > .hero-actions { animation-delay: .32s; }
.hero-in > .pill         { animation-delay: .42s; }

/* El arte entra con un acercamiento minimo, una sola vez. No es un bucle:
   un zoom permanente marea y no aporta. */
@keyframes hero-settle {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}
.hero-art { animation: hero-settle 1.6s cubic-bezier(.16,1,.3,1) both; }

/* ---- Cenizas de hielo: el mismo recurso que el launcher, en CSS puro ----
   Seis motas con recorridos y retardos distintos. Sin JS y sin imagenes. */
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(200,240,255,.85) 0%, rgba(140,216,255,0) 70%),
    radial-gradient(circle, rgba(200,240,255,.70) 0%, rgba(140,216,255,0) 70%),
    radial-gradient(circle, rgba(200,240,255,.90) 0%, rgba(140,216,255,0) 70%),
    radial-gradient(circle, rgba(200,240,255,.60) 0%, rgba(140,216,255,0) 70%),
    radial-gradient(circle, rgba(200,240,255,.80) 0%, rgba(140,216,255,0) 70%),
    radial-gradient(circle, rgba(200,240,255,.65) 0%, rgba(140,216,255,0) 70%);
  background-repeat: no-repeat;
  background-size: 4px 4px, 3px 3px, 5px 5px, 3px 3px, 4px 4px, 2px 2px;
  background-position: 12% 100%, 27% 100%, 44% 100%, 63% 100%, 78% 100%, 91% 100%;
  animation: motes 19s linear infinite;
  opacity: .55;
}
@keyframes motes {
  from { background-position: 12% 105%, 27% 105%, 44% 105%, 63% 105%, 78% 105%, 91% 105%; }
  to   { background-position: 16% -8%,  24% -8%,  48% -8%,  59% -8%,  82% -8%,  88% -8%; }
}

/* ---- Revelado al hacer scroll ----
   La clase la pone site.js sobre los bloques; sin JS todo queda visible. */
.reveal { opacity: 0; transform: translate3d(0, 22px, 0); }
.reveal.seen {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}
/* Escalonado dentro de una rejilla: las tarjetas no aparecen todas de golpe */
.reveal.seen .class-card,
.reveal.seen .stat { animation: rise .55s cubic-bezier(.16,1,.3,1) backwards; }
.reveal.seen :is(.class-card, .stat):nth-child(1) { animation-delay: .04s; }
.reveal.seen :is(.class-card, .stat):nth-child(2) { animation-delay: .10s; }
.reveal.seen :is(.class-card, .stat):nth-child(3) { animation-delay: .16s; }
.reveal.seen :is(.class-card, .stat):nth-child(4) { animation-delay: .22s; }
.reveal.seen :is(.class-card, .stat):nth-child(5) { animation-delay: .28s; }

/* ---- Aurora: dos manchas de luz que respiran detras del heroe ----
   Va bajo el scrim, asi que nunca compite con el texto. Solo transform+opacity. */
.hero-scrim::after {
  content: "";
  position: absolute; inset: -20%;
  background:
    radial-gradient(ellipse 42% 34% at 22% 28%, rgba(53,200,224,.20), transparent 62%),
    radial-gradient(ellipse 38% 30% at 78% 62%, rgba(240,169,60,.14), transparent 62%);
  animation: aurora 22s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) scale(1);    opacity: .85; }
  to   { transform: translate3d(4%, 3%, 0)   scale(1.12); opacity: 1; }
}

/* ---- Destello que recorre el titulo cada tanto ---- */
.hero-title {
  background: linear-gradient(100deg,
      var(--text) 0%, var(--text) 38%,
      #bfefff 47%, var(--text) 56%, var(--text) 100%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: rise .7s cubic-bezier(.16,1,.3,1) backwards, sheen 7s ease-in-out 1.2s infinite;
}
@keyframes sheen {
  0%, 62% { background-position: 100% 0; }
  86%,100% { background-position: 0 0; }
}

/* ---- La pildora de estado flota ---- */
.pill { animation: rise .7s cubic-bezier(.16,1,.3,1) backwards, bob 4.5s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ---- Subrayado que crece en los enlaces del menu ---- */
.nav a:not(.cta):not(.ghost) { position: relative; }
.nav a:not(.cta):not(.ghost)::before {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s cubic-bezier(.16,1,.3,1);
}
.nav a:not(.cta):not(.ghost):hover::before { transform: scaleX(1); }

/* ---- Regla animada bajo los titulos de seccion ---- */
.block-head h2, .page-head h1 { position: relative; display: inline-block; padding-bottom: 10px; }
.block-head h2::after, .page-head h1::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 56px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.16,1,.3,1) .1s;
}
.reveal.seen .block-head h2::after,
.page-head h1::after { transform: scaleX(1); }

/* ---- Las cifras se levantan al pasar por encima ---- */
.stat { transition: background .2s ease, transform .2s ease; }
.stat:hover { background: var(--s2); transform: translateY(-3px); }

/* ---- Botones secundarios tambien responden ---- */
.btn.ghost:hover { transform: translateY(-1px); }

/* ---- Ondas al pulsar cualquier boton ----
   El elemento .ripple lo inserta site.js en el punto del clic. */
/* OJO: .to-top NO entra en el `position: relative`. Ya es `fixed` (que tambien sirve de
   contexto de posicionamiento) y esta regla, al ir despues en la hoja y tener la misma
   especificidad, lo devolvia al flujo normal y lo dejaba pegado a un lado. */
.btn, .ac-out button { position: relative; }
.btn, .to-top, .ac-out button { overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .28;
  transform: scale(0); animation: ripple .55s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes ripple {
  to { transform: scale(2.6); opacity: 0; }
}

/* ---- Las filas de la tabla entran escalonadas ---- */
.table-scroll.seen .rank tbody tr { animation: row-in .42s cubic-bezier(.16,1,.3,1) backwards; }
@keyframes row-in {
  from { opacity: 0; transform: translate3d(-10px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
.table-scroll.seen .rank tbody tr:nth-child(1)  { animation-delay: .02s; }
.table-scroll.seen .rank tbody tr:nth-child(2)  { animation-delay: .05s; }
.table-scroll.seen .rank tbody tr:nth-child(3)  { animation-delay: .08s; }
.table-scroll.seen .rank tbody tr:nth-child(4)  { animation-delay: .11s; }
.table-scroll.seen .rank tbody tr:nth-child(5)  { animation-delay: .14s; }
.table-scroll.seen .rank tbody tr:nth-child(6)  { animation-delay: .17s; }
.table-scroll.seen .rank tbody tr:nth-child(7)  { animation-delay: .20s; }
.table-scroll.seen .rank tbody tr:nth-child(8)  { animation-delay: .23s; }
.table-scroll.seen .rank tbody tr:nth-child(9)  { animation-delay: .26s; }
.table-scroll.seen .rank tbody tr:nth-child(10) { animation-delay: .29s; }

/* ---- Las tarjetas del panel tambien entran escalonadas ---- */
.reveal.seen .panel-card { animation: rise .5s cubic-bezier(.16,1,.3,1) backwards; }
.reveal.seen .panel-card:nth-child(1) { animation-delay: .05s; }
.reveal.seen .panel-card:nth-child(2) { animation-delay: .12s; }
.reveal.seen .panel-card:nth-child(3) { animation-delay: .19s; }

/* ---- El boton de crear cuenta llama la atencion cada tanto ---- */
.nav .cta { position: relative; overflow: hidden; }
.nav .cta::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  animation: cta-shine 5.5s ease-in-out infinite;
}
@keyframes cta-shine {
  0%, 72%  { left: -50%; }
  88%,100% { left: 130%; }
}

/* ---- Hamburguesa que se convierte en X ---- */
.nav-toggle span { transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- El menu movil se despliega en vez de aparecer de golpe ---- */
.nav.open { animation: drop .28s cubic-bezier(.16,1,.3,1); }
@keyframes drop {
  from { opacity: 0; transform: translate3d(0, -8px, 0); }
  to   { opacity: 1; transform: none; }
}

/* ---- Entrada de los formularios (login y registro) ----
   Escalonado campo a campo. Se aplica al cargar y no al hacer scroll: estas paginas
   arrancan con el formulario ya a la vista. */
.form-col > * { animation: rise .55s cubic-bezier(.16,1,.3,1) backwards; }
.form-col > h1   { animation-delay: .04s; }
.form-col > .lead { animation-delay: .10s; }
.form-col > .notice { animation-delay: .14s; }
.form-col > form { animation-delay: .16s; }
.form-aside { animation: rise .55s cubic-bezier(.16,1,.3,1) .22s backwards; }

.form-col form .field { animation: rise .5s cubic-bezier(.16,1,.3,1) backwards; }
.form-col form .field:nth-of-type(1) { animation-delay: .20s; }
.form-col form .field:nth-of-type(2) { animation-delay: .27s; }
.form-col form .field:nth-of-type(3) { animation-delay: .34s; }
.form-col form .field:nth-of-type(4) { animation-delay: .41s; }
.form-col form .btn { animation: rise .5s cubic-bezier(.16,1,.3,1) .48s backwards; }
.form-col .form-alt { animation: rise .5s cubic-bezier(.16,1,.3,1) .55s backwards; }

/* El campo enfocado se levanta un pelo: refuerza donde esta el cursor */
.field input, .field select { transition: border-color .15s ease, transform .18s ease, background .15s ease; }
.field input:focus, .field select:focus { transform: translateY(-1px); }

/* Un error no aparece de golpe: llama la atencion sin sobresaltar */
.err { animation: err-in .32s cubic-bezier(.16,1,.3,1); }
@keyframes err-in {
  from { opacity: 0; transform: translate3d(-6px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
.notice { animation: rise .45s cubic-bezier(.16,1,.3,1); }

/* ---- Barra superior: se densifica al bajar ---- */
.topbar { transition: background .25s ease, box-shadow .25s ease; }
.topbar.scrolled {
  background: color-mix(in srgb, var(--s0) 97%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* ---- Barrido de brillo en el boton principal ---- */
.btn.primary { position: relative; overflow: hidden; isolation: isolate; }
.btn.primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%; z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  transform: skewX(-18deg);
  transition: left .55s cubic-bezier(.16,1,.3,1);
}
.btn.primary:hover::after { left: 120%; }

/* ---- Filas del ranking: filo de acento al pasar ---- */
.rank tbody tr { transition: background .16s ease; }
.rank tbody td:first-child { position: relative; }
.rank tbody td:first-child::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  transform: scaleY(0); transform-origin: center;
  transition: transform .2s ease;
}
.rank tbody tr:hover td:first-child::before { transform: scaleY(1); }

/* ---- Contadores: el numero se asienta al terminar de contar ---- */
.stat-n { transition: color .3s ease; }
.stat-n.counting { color: var(--accent); }

/* ---- Enlaces de descarga: la flecha avanza ---- */
.dl-go { transition: transform .22s cubic-bezier(.16,1,.3,1); }
.dl:hover .dl-go { transform: translateY(3px); }

/* ---- Chips y pestanas ---- */
.chips a { transition: border-color .16s, color .16s, background .16s, transform .16s; }
.chips a:hover { transform: translateY(-1px); }
.tabs a { transition: color .16s, border-color .22s; }

/* ---- Detalles del FAQ ---- */
.faq details { transition: border-color .18s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* ============================== Responsive ============================== */

@media (max-width: 860px) {
  .form-page { grid-template-columns: minmax(0, 1fr); gap: 30px; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; width: 42px; height: 42px; padding: 0 10px;
    background: var(--s2); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 16px;
    background: var(--s1); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav a.on::after { display: none; }
  .nav .cta, .nav .ghost { margin: 6px 0 0; text-align: center; }
}

@media (max-width: 560px) {
  .stats { margin-top: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .hero-in { max-width: none; }
  .page-head, .block-head.row { align-items: flex-start; }
}

/* ============================== Refineria ============================== */


.odds { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.odds-main, .odds-list {
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 22px;
}
.odds-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em;
              text-transform: uppercase; color: var(--mute); }
.odds-big {
  display: block; margin: 8px 0 4px; font-size: clamp(38px, 6vw, 54px); font-weight: 800;
  letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.odds-sub { display: block; font-size: 13px; color: var(--dim); }
/* La barra crece al entrar: hace legible de un vistazo si la chance es alta o baja */
.odds-bar { margin-top: 16px; height: 8px; border-radius: 4px; background: var(--s0);
            border: 1px solid var(--line); overflow: hidden; }
.odds-bar span {
  display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold));
  transform-origin: left; animation: grow .7s cubic-bezier(.16,1,.3,1);
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.odds-list { list-style: none; margin: 0; padding: 22px; display: grid; gap: 12px; align-content: center; }
.odds-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--dim); }
.odds-list strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.odds-list .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.odds-list .dot.ok { background: var(--ok); }
.odds-list .dot.flat { background: var(--mute); }
.odds-list .dot.bad { background: var(--bad); }

.odds-table th { text-align: center; }
.odds-table td.odds-cell { text-align: center; font-weight: 700; }
/* Semaforo: el color dice de un vistazo donde empieza a doler */
.odds-cell.hi  { color: var(--ok); }
.odds-cell.mid { color: var(--gold); }
.odds-cell.lo  { color: var(--bad); }

.lvl {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--s2));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent); font-size: 12px; font-weight: 700;
}

@media (max-width: 760px) {
  .odds { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Panel de tirada ---- */
.roll { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.roll-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 14px; align-items: end; }
.roll-grid .field { margin-bottom: 0; }
.roll-btn { min-width: 130px; height: 46px; font-size: 15px; letter-spacing: .08em; }
.roll-warn { margin-top: 14px; font-size: 12.5px; color: var(--mute); }
.roll-warn strong { color: var(--gold); }
@media (max-width: 700px) { .roll-grid { grid-template-columns: minmax(0,1fr); } }

/* Solo se resalta la que realmente tenes: si todo brilla, nada destaca */

/* =============================== Refineria: el yunque ===============================
   Layout de dos columnas: yunque a la izquierda, tienda e historial a la derecha.
   Los iconos son un sprite <symbol> inyectado una vez por PHP (app/icons.php). */

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-lg { width: 46px; height: 46px; stroke-width: 1.3; }

.forge { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.anvil {
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; display: grid; gap: 18px;
}

/* ---------------------------------------------------------------- cabecera del yunque */

.anvil-top { display: flex; gap: 20px; align-items: flex-start; }

.slot { position: relative; flex: none; }
.slot-art {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 108px; height: 108px; border-radius: var(--r);
  background: radial-gradient(circle at 50% 38%, var(--s3), var(--s0) 72%);
  border: 1px solid var(--line); color: var(--accent);
  transition: border-color .3s ease, color .3s ease;
}
/* Halo detras del icono. Vive en su propia capa para poder pulsar sin repintar el resto. */
.slot-glow {
  position: absolute; inset: -1px; border-radius: var(--r); pointer-events: none;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 65%);
  opacity: .5;
}
.slot-ic { position: relative; display: flex; }
.slot-lv {
  position: absolute; right: 7px; bottom: 5px;
  font-size: 17px; font-weight: 800; color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9); font-variant-numeric: tabular-nums;
}

.anvil-read { display: grid; gap: 7px; min-width: 0; flex: 1; }
.slot-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.slot-sub { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .1em; }

/* ---------------------------------------------------------------- barra de probabilidad */

.gauge { display: flex; align-items: center; gap: 13px; margin-top: 6px; }
.gauge-bar {
  flex: 1; height: 20px; border-radius: 3px; overflow: hidden;
  background: var(--s0); border: 1px solid var(--line);
}
.gauge-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--bad), var(--gold));
  transition: width .45s cubic-bezier(.16, 1, .3, 1), background .3s ease;
}
/* El color de la barra cambia por tramo: se lee sin mirar el numero. */
.gauge-bar span.mid { background: linear-gradient(90deg, var(--gold), #d8e04a); }
.gauge-bar span.hi  { background: linear-gradient(90deg, #7ad86a, var(--ok)); }
.gauge-pct {
  min-width: 74px; text-align: right; font-size: 22px; font-weight: 800;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.gauge-msg { font-size: 12.5px; color: var(--mute); }
.gauge-msg.warn { color: var(--bad); }

.ba { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.ba-cell {
  padding: 5px 13px; border-radius: 3px; font-size: 14px; font-weight: 700;
  background: var(--s0); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.ba-cell.goal { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ba-arrow { color: var(--mute); font-size: 13px; }

/* ---------------------------------------------------------------- selectores */

.char-field { margin-bottom: 0; max-width: 280px; }

.picker { border: 0; padding: 0; margin: 0; min-width: 0; }
.picker legend {
  padding: 0; margin-bottom: 9px; font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
}
/* El radio real se mantiene en el DOM (accesible, y el form funciona sin JS) pero no se
   dibuja: el estado visible lo lleva la clase .on del <label>. */
.picker input[type="radio"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

/* ---- inventario ---- */

.rack {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 9px;
  max-height: 260px; overflow-y: auto; padding-right: 4px;
}
.tile {
  display: grid; justify-items: center; gap: 6px; padding: 10px 6px 9px; cursor: pointer;
  background: var(--s0); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s ease, background .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); }
.tile.on {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--s0));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.tile.off { display: none; }
.tile-art { position: relative; color: var(--dim); display: flex; }
.tile.on .tile-art { color: var(--accent); }
.tile-lv {
  position: absolute; right: -9px; bottom: -5px;
  font-size: 11px; font-weight: 800; color: var(--gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9); font-variant-numeric: tabular-nums;
}
.tile-name {
  font-size: 11px; color: var(--dim); text-align: center; line-height: 1.25;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile.on .tile-name { color: var(--text); }

/* ---- piedras ---- */

.stones { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; }
.stone {
  display: grid; justify-items: center; gap: 4px; padding: 12px 8px 10px; cursor: pointer;
  background: var(--s0); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s ease, background .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}
.stone:hover { transform: translateY(-2px); }
.stone-art { position: relative; display: flex; }
.stone .gem { width: 32px; height: 32px; stroke-width: 1.2; }
/* El tramo de la piedra manda el color: acero, violeta, oro. */
.stone.low  { --stone: #8fd4ff; }
.stone.mid  { --stone: #b98cff; }
.stone.high { --stone: var(--gold); }
.stone .gem { color: var(--stone); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--stone) 45%, transparent)); }
.stone:hover { border-color: color-mix(in srgb, var(--stone) 50%, var(--line)); }
.stone.on {
  border-color: var(--stone); background: color-mix(in srgb, var(--stone) 10%, var(--s0));
}
.stone.on .gem { animation: gemPulse 2.4s ease-in-out infinite; }
.stone-qty {
  position: absolute; right: -10px; bottom: -4px; min-width: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--s3); border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 800; text-align: center; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stone-name { font-size: 12.5px; font-weight: 700; }
.stone-cap { font-size: 10.5px; color: var(--mute); }
/* Sin existencias: se ve, pero apagada y no se puede elegir. */
.stone.empty { opacity: .38; cursor: not-allowed; }
.stone.empty:hover { transform: none; border-color: var(--line); }

/* ---------------------------------------------------------------- boton */

.roll-btn { position: relative; width: 100%; font-size: 15px; letter-spacing: .04em; }
.roll-spin {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
  border-top-color: var(--on-accent); border-radius: 50%; opacity: 0;
}
.roll-warn { font-size: 12px; color: var(--mute); line-height: 1.55; }
.roll-warn strong { color: var(--gold); }

/* ---------------------------------------------------------------- animacion de refino */

/* Mientras el servidor decide: el yunque tiembla, el halo late y el boton gira. */
.anvil.forging .slot-art { animation: hammer .28s ease-in-out infinite; border-color: var(--gold); color: var(--gold); }
.anvil.forging .slot-glow { animation: glowPulse .56s ease-in-out infinite; }
.anvil.forging .gauge-bar span { animation: gaugeBusy .8s ease-in-out infinite; }
.anvil.forging .roll-label { opacity: 0; }
.anvil.forging .roll-spin { opacity: 1; animation: spin .7s linear infinite; }
.anvil.forging .rack, .anvil.forging .stones, .anvil.forging .char-field { opacity: .45; pointer-events: none; }

/* Y el veredicto. */
.anvil.won  .slot-art { animation: winPop .7s cubic-bezier(.16, 1, .3, 1); border-color: var(--ok); color: var(--ok); }
.anvil.lost .slot-art { animation: failShake .6s ease-in-out; border-color: var(--bad); color: var(--bad); }
.anvil.flat .slot-art { animation: dud .5s ease-out; }
.anvil.won .slot-lv { color: var(--ok); }
.anvil.lost .slot-lv { color: var(--bad); }

/* Chispas: se lanzan desde el centro del item hacia --a, --d pixeles. */
.spark-field { position: absolute; inset: 0; pointer-events: none; }
.spark-field i {
  position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px;
  border-radius: 50%; background: var(--gold);
  animation: sparkOut .75s cubic-bezier(.16, 1, .3, 1) forwards;
}
.spark-field.win i  { background: var(--ok); }
.spark-field.fail i { background: var(--bad); }
.spark-field.none i { background: var(--mute); }

@keyframes hammer {
  0%, 100% { transform: translateY(0); }
  35%      { transform: translateY(-5px) rotate(-1.5deg); }
  70%      { transform: translateY(3px) rotate(1deg); }
}
@keyframes glowPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes gaugeBusy { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gemPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
@keyframes winPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}
@keyframes failShake {
  0%, 100% { transform: translateX(0); }
  15%      { transform: translateX(-8px); }
  30%      { transform: translateX(7px); }
  45%      { transform: translateX(-5px); }
  60%      { transform: translateX(4px); }
  80%      { transform: translateX(-2px); }
}
@keyframes dud {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(.95); opacity: .6; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes sparkOut {
  0%   { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.2); opacity: 0; }
}

/* ---------------------------------------------------------------- columna lateral */

.forge-side { display: grid; gap: 13px; align-content: start; }
.side-title {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mute);
}

.shop { display: grid; gap: 2px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.shop-row + .shop-row { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.shop-row.low  { --stone: #8fd4ff; }
.shop-row.mid  { --stone: #b98cff; }
.shop-row.high { --stone: var(--gold); }
.shop-gem { display: flex; color: var(--stone); }
.shop-gem .gem { width: 26px; height: 26px; stroke-width: 1.2; }
.shop-meta { flex: 1; display: grid; gap: 1px; min-width: 0; }
.shop-meta b { font-size: 13.5px; }
.shop-meta em { font-style: normal; font-size: 11.5px; color: var(--mute); }
.shop-meta i { font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; }
.shop-buy button {
  padding: 7px 12px; border-radius: 3px; cursor: pointer; white-space: nowrap;
  background: var(--s3); border: 1px solid var(--line); color: var(--text);
  font: 600 12px var(--font);
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.shop-buy button:hover {
  border-color: var(--stone); background: color-mix(in srgb, var(--stone) 14%, var(--s3));
  transform: translateY(-1px);
}
.shop-gm { font-size: 11px; color: var(--mute); white-space: nowrap; }

.last-roll {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: var(--r);
  background: var(--s1); border: 1px solid var(--line);
  animation: rise .5s cubic-bezier(.16, 1, .3, 1);
}
.last-roll span { font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--mute); }
.last-roll strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.last-roll.up { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.last-roll.up strong { color: var(--ok); }
.last-roll.down { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.last-roll.down strong { color: var(--bad); }
.last-roll.flat strong { color: var(--dim); }

.hist {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 2px;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r);
}
.hist li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; }
.hist li + li { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.hist li.fresh { animation: rise .45s cubic-bezier(.16, 1, .3, 1); }
.hist .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.hist .dot.ok { background: var(--ok); }
.hist .dot.bad { background: var(--bad); }
.hist .dot.flat { background: var(--mute); }
.hist-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-lv { color: var(--dim); font-variant-numeric: tabular-nums; }
.hist-pct { color: var(--mute); font-size: 11.5px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.hist-none { color: var(--mute); font-size: 12.5px; }

/* La tabla de probabilidades usa la misma piedra que los selectores. */
.gem-name { display: flex; align-items: center; gap: 8px; }
.gem-name.low  { --stone: #8fd4ff; }
.gem-name.mid  { --stone: #b98cff; }
.gem-name.high { --stone: var(--gold); }
.gem-name .gem { width: 17px; height: 17px; color: var(--stone); }

@media (max-width: 900px) {
  .forge { grid-template-columns: minmax(0, 1fr); }
  .anvil-top { flex-direction: column; align-items: stretch; }
  .slot-art { width: 88px; height: 88px; }
}

/* Utilidades de espaciado y texto. Existen porque la CSP es style-src 'self': un
   style="" en el HTML queda bloqueado por el navegador y ademas ensucia la consola. */
.pad-20 { padding-top: 20px; }
.pad-22 { padding-top: 22px; }
.pad-24 { padding-top: 24px; }
.stat-n.sm { font-size: 20px; }
.upper { text-transform: uppercase; }

/* ============================================================================
   Pagina de mantenimiento
   Pantalla completa propia, sin cabecera ni menu: el visitante no puede ir a
   ningun otro sitio, asi que la navegacion solo estorbaria. La key art cubre
   el fondo y un velo oscuro garantiza el contraste del texto encima.
   ========================================================================== */
.maint-page {
  min-height: 100vh; margin: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(7, 9, 13, .34) 0%, rgba(7, 9, 13, .66) 62%, rgba(7, 9, 13, .92) 100%),
    url("../img/hero.jpg") center / cover no-repeat fixed,
    var(--s0);
}
.maint-box { max-width: 880px; width: 100%; }
.maint-brand {
  margin: 0 0 26px; font-size: 14px; font-weight: 700;
  letter-spacing: .42em; text-transform: uppercase; color: var(--accent-hi);
  text-shadow: 0 0 18px rgba(53, 200, 224, .65);
}
.maint-title {
  margin: 0; line-height: .95;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Segoe UI Black", var(--font);
  font-size: clamp(46px, 11vw, 124px); font-weight: 900;
  letter-spacing: .03em; text-transform: uppercase;
  /* Degradado de fuego, el mismo del logotipo del juego. El color solido de abajo es el
     respaldo para navegadores sin background-clip sobre texto. */
  color: var(--gold);
  background: linear-gradient(180deg, #fff3c4 0%, #ffc24a 34%, #ff7a1a 68%, #d92b12 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 26px rgba(255, 122, 26, .55));
  animation: maint-glow 3.2s ease-in-out infinite;
}
.maint-rule {
  width: min(320px, 60%); height: 2px; margin: 28px auto; border: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px rgba(53, 200, 224, .8);
}
.maint-message {
  margin: 0 auto; max-width: 30em;
  font-size: clamp(18px, 2.6vw, 26px); font-weight: 600; line-height: 1.45;
  color: var(--text); text-shadow: 0 2px 14px rgba(0, 0, 0, .9);
}
.maint-note {
  margin: 22px auto 0; font-size: 15px; color: var(--dim);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9);
}
.maint-login {
  display: inline-block; margin-top: 40px; padding: 9px 20px;
  font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(7, 9, 13, .55);
}
.maint-login:hover, .maint-login:focus-visible { color: var(--accent-hi); border-color: var(--accent); }
@keyframes maint-glow {
  0%, 100% { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 22px rgba(255, 122, 26, .45)); }
  50%      { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 44px rgba(255, 160, 60, .85)); }
}
@media (prefers-reduced-motion: reduce) { .maint-title { animation: none; } }
/* En movil el fondo fijo se recalcula en cada scroll y tartamudea. */
@media (max-width: 700px) { .maint-page { background-attachment: scroll, scroll, scroll; } }
