/* ==========================================================================
   MU LIBRE · Sistema visual «Crónica del Norte» · v3
   Noche abisal, hielo y reliquias de oro. El azul es el mundo; el oro, la
   acción y el valor. Títulos tallados (Cinzel), acentos caligráficos
   (Cormorant), interfaz clara (Bricolage) y datos en mono (JetBrains).

   Capas de cascada (de menor a mayor prioridad):
     tokens      → color, tipografía, medidas, sombras
     base        → reset y elementos HTML
     controls    → botones (placas talladas)
     layout      → cabecera, menús, contenedor, estandarte de página, pie
     components  → superficies, tablas, formularios, pestañas, avisos...
     pages       → dirección de arte propia de cada vista
     utilities   → ayudas puntuales, movimiento reducido, impresión
   ========================================================================== */
@layer tokens, base, controls, layout, components, pages, utilities;

/* ---------- Fuentes autoalojadas (OFL, ver static/fonts/LICENCIAS.txt) --- */
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-latin.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-latin.woff2") format("woff2");
  font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
  font-weight: 500 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 300 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 700; font-display: swap; }

/* ========================================================================== */
@layer tokens {
  :root {
    color-scheme: dark;
    /* Noche */
    --abyss: #03060d;
    --night: #070b18;
    --deep: #0a1022;
    --plate: #0e1630;
    --plate-2: #131d3d;
    --plate-3: #1b2850;
    /* Hielo (texto) */
    --ice: #f1f5ff;
    --text: #c8d3ec;
    --muted: #8d9cc0;
    --line: rgba(150, 180, 255, .14);
    --line-strong: rgba(150, 180, 255, .3);
    /* Azur (mundo, enlaces, foco) */
    --azure: #5b87ff;
    --azure-bright: #94b4ff;
    --azure-deep: #2a52e0;
    --frost: #c4d7ff;
    /* Oro (acción, valor, puesto #1) */
    --gold: #e4b962;
    --gold-bright: #f8e2a6;
    --gold-deep: #a5752a;
    --gold-ink: #1d1404;
    --gold-line: rgba(228, 185, 98, .45);
    /* Estados */
    --ok: #4fdc9f;   --ok-soft: rgba(79, 220, 159, .12);
    --bad: #ff7b90;  --bad-soft: rgba(255, 123, 144, .12);
    --warn: #f3c552; --warn-soft: rgba(243, 197, 82, .1);
    /* Tipografía */
    --f-title: "Cinzel", "Cormorant Garamond", Georgia, serif;
    --f-display: "Cormorant Garamond", Garamond, Georgia, serif;
    --f-ui: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    --t-xs: .75rem; --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.125rem;
    --t-h3: 1.2rem;
    --t-h2: clamp(1.7rem, 1.2rem + 1.9vw, 2.9rem);
    --t-h1: clamp(2.1rem, 1.3rem + 3.2vw, 4rem);
    /* Espacio y forma */
    --gutter: clamp(16px, 4vw, 44px);
    --wrap: 1280px;
    --header-h: 72px;
    --tabbar-h: 64px;
    --cut: 10px;
    --tick: 12px;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -24px rgba(0, 0, 0, .8);
    --shadow-2: 0 30px 70px -28px rgba(0, 0, 0, .9), 0 0 0 1px rgba(150, 180, 255, .08);
    --glow-gold: 0 0 34px -6px rgba(228, 185, 98, .55);
    --ease: cubic-bezier(.2, .7, .1, 1);
    --gold-grad: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 46%, var(--gold-deep) 100%);
    --gold-text: linear-gradient(180deg, #fff6d8 10%, #f0cd80 62%, #d9a851 100%);
    --plate-grad: linear-gradient(180deg, var(--plate-2), var(--plate) 60%);
  }
  @media (min-width: 1900px) { :root { --wrap: 1480px; } }
}

/* ========================================================================== */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; background: var(--night);
    scroll-padding-top: calc(var(--header-h) + 16px); scrollbar-color: var(--plate-3) var(--abyss); }
  body { margin: 0; min-height: 100vh; background: var(--night); color: var(--text);
    font: 400 var(--t-md)/1.6 var(--f-ui); font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, svg { max-width: 100%; }
  img { height: auto; }
  a { color: var(--azure-bright); text-decoration: none; text-underline-offset: .22em; }
  a:hover { color: var(--frost); text-decoration: underline; text-decoration-thickness: 1px; }
  h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--ice); text-wrap: balance; }
  h1, h2 { font-family: var(--f-title); font-weight: 600; letter-spacing: .015em; line-height: 1.08; text-transform: uppercase; }
  h1 { font-size: var(--t-h1); }
  h2 { font-size: var(--t-h2); }
  h1 em, h2 em { font: italic 600 1.18em/1 var(--f-display); text-transform: none; letter-spacing: -.01em;
    background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .06em; }
  h3 { font: 650 var(--t-h3)/1.3 var(--f-ui); letter-spacing: -.005em; }
  h4 { font: 650 var(--t-md)/1.4 var(--f-ui); }
  p { margin: 0 0 1em; text-wrap: pretty; }
  small { font-size: var(--t-sm); }
  strong, b { font-weight: 650; color: var(--ice); }
  code { font: 500 .86em/1.4 var(--f-mono); background: rgba(91, 135, 255, .14); color: var(--frost);
    padding: .15em .45em; border: 1px solid var(--line); overflow-wrap: anywhere; }
  hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
  ul, ol { padding-left: 1.2em; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button, a, summary, select, label { -webkit-tap-highlight-color: transparent; }
  :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  ::selection { background: var(--gold); color: var(--gold-ink); }
  [hidden] { display: none !important; }
  table, output, .num { font-variant-numeric: tabular-nums lining-nums; }
}

/* ========================================================================== */
@layer controls {
  button, .btn, .button-link { --b-bg: linear-gradient(180deg, #4a76f5, var(--azure-deep)); --b-fg: #fff; --b-bg-h: linear-gradient(180deg, #6b90ff, #3561ee);
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
    min-height: 46px; padding: 0 22px; margin: 0; border: 0; background: var(--b-bg); color: var(--b-fg);
    font: 640 .95rem/1.2 var(--f-ui); letter-spacing: .01em; text-decoration: none; white-space: nowrap; cursor: pointer;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transition: filter .2s var(--ease), transform .2s var(--ease); }
  button::after, .btn::after, .button-link::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .38) 50%, transparent 65%);
    transform: translateX(-120%); transition: transform .6s var(--ease); }
  button:hover, .btn:hover, .button-link:hover { background: var(--b-bg-h); color: var(--b-fg); text-decoration: none; }
  button:hover::after, .btn:hover::after, .button-link:hover::after { transform: translateX(120%); }
  button:active, .btn:active, .button-link:active { transform: translateY(1px); }
  button:focus-visible, .btn:focus-visible, .button-link:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: -5px; }
  button:disabled, button[disabled] { --b-bg: #1a2340; --b-fg: #7f8db0; --b-bg-h: #1a2340; cursor: not-allowed; transform: none; }
  button:disabled::after { display: none; }
  .btn svg, .button-link svg, button svg { width: 18px; height: 18px; flex: none; transition: transform .2s var(--ease); }
  .btn:hover svg.arrow, .button-link:hover svg.arrow { transform: translateX(4px); }
  .btn-lg { min-height: 58px; padding: 0 30px; font-size: 1.04rem; --cut: 13px; }
  .btn-sm { min-height: 40px; padding: 0 16px; font-size: .88rem; --cut: 8px; }
  /* Oro: la acción principal de cada pantalla */
  .btn-gold, .download-button { --b-bg: var(--gold-grad); --b-fg: var(--gold-ink); --b-bg-h: linear-gradient(180deg, #fff0c4, #efca7a 46%, #b9872f);
    font-weight: 720; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); filter: drop-shadow(0 8px 18px rgba(228, 185, 98, .28)); }
  .btn-gold:hover, .download-button:hover { filter: drop-shadow(0 10px 26px rgba(228, 185, 98, .5)); }
  .btn-secondary, .button-link.secondary, button.btn-secondary, .btn-white, .btn-ghost-light {
    --b-bg: rgba(148, 180, 255, .1); --b-fg: var(--ice); --b-bg-h: rgba(148, 180, 255, .2);
    box-shadow: inset 0 0 0 1px var(--line-strong); }
  .btn-danger, button.btn-danger { --b-bg: linear-gradient(180deg, #e24a62, #b3263f); --b-bg-h: linear-gradient(180deg, #f0607a, #c22c47); }
  .btn-danger-outline, button.btn-danger-outline { --b-bg: var(--bad-soft); --b-fg: var(--bad); --b-bg-h: rgba(255, 123, 144, .22); }
  .btn-link, button.btn-link { --b-bg: transparent; --b-fg: var(--azure-bright); --b-bg-h: rgba(148, 180, 255, .1); clip-path: none; padding: 0 8px; }
}

/* ========================================================================== */
@layer layout {
  .wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
  .site-shell { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }

  /* ---- Cabecera -------------------------------------------------------- */
  .site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h);
    background: linear-gradient(180deg, rgba(3, 6, 13, .92), rgba(3, 6, 13, .7));
    backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid var(--line); }
  .site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-line) 30%, var(--gold-line) 70%, transparent); opacity: .7; }
  .site-header .wrap { height: 100%; display: flex; align-items: center; gap: 22px; }
  .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ice); flex: none; }
  .brand:hover { text-decoration: none; color: var(--ice); }
  .brand-emblem { height: 62px; margin: -6px 0 -6px -6px; width: auto; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .6)); transition: transform .3s var(--ease), filter .3s; }
  .brand:hover .brand-emblem { transform: scale(1.05); filter: drop-shadow(0 0 14px rgba(228, 185, 98, .55)); }
  .brand-word { font: 700 1.25rem/1 var(--f-title); letter-spacing: .16em; white-space: nowrap; }
  .brand-word b { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
  .primary-nav { display: flex; align-items: stretch; height: 100%; gap: 2px; margin-right: auto; }
  .primary-nav a { position: relative; display: flex; align-items: center; padding: 0 14px;
    color: var(--text); font: 600 .78rem/1 var(--f-title); letter-spacing: .14em; text-transform: uppercase; }
  .primary-nav a::after { content: ""; position: absolute; left: 50%; top: calc(50% + 13px); width: 6px; height: 6px; background: var(--gold);
    transform: translateX(-50%) rotate(45deg) scale(0); transition: transform .25s var(--ease); }
  .primary-nav a:hover { color: var(--ice); text-decoration: none; }
  .primary-nav a:hover::after { transform: translateX(-50%) rotate(45deg) scale(.7); }
  .primary-nav a[aria-current="page"] { color: var(--gold-bright); }
  .primary-nav a[aria-current="page"]::after { transform: translateX(-50%) rotate(45deg) scale(1); box-shadow: 0 0 10px var(--gold); }
  .header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
  .live-chip { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 36px;
    font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .04em; color: var(--text);
    border: 1px solid var(--line); background: rgba(14, 22, 48, .6); white-space: nowrap; }
  .live-chip:hover { text-decoration: none; border-color: var(--line-strong); color: var(--ice); }
  .pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
    box-shadow: 0 0 0 0 rgba(79, 220, 159, .6); animation: pulse 2.4s var(--ease) infinite; }
  @keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(79, 220, 159, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 220, 159, 0); } }
  .header-link { font-weight: 600; color: var(--ice); padding: 0 8px; }
  .menu-button { display: none; }

  /* ---- Menú de cuenta --------------------------------------------------- */
  .account-panel { position: relative; }
  .account-panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 12px 0 5px; border: 1px solid var(--line); background: rgba(14, 22, 48, .6); color: var(--ice); }
  .account-panel > summary::-webkit-details-marker { display: none; }
  .account-panel > summary:hover, .account-panel[open] > summary { border-color: var(--gold-line); }
  .account-avatar { display: grid; place-items: center; width: 32px; height: 32px;
    background: var(--gold-grad); color: var(--gold-ink); font: 700 1rem/1 var(--f-title);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
  .account-name { font-weight: 620; font-size: .92rem; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-panel > summary svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
  .account-panel[open] > summary svg { transform: rotate(180deg); }
  .account-pop { position: absolute; right: 0; top: calc(100% + 12px); width: 330px; z-index: 60;
    background: var(--plate-grad); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); padding: 18px;
    animation: pop-in .22s var(--ease); }
  @keyframes pop-in { from { opacity: 0; transform: translateY(-6px); } }
  .account-pop-head { display: grid; gap: 8px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .account-pop-head .eyebrow { margin: 0; }
  .account-pop-head strong { display: flex; align-items: center; gap: 10px; color: var(--ice); font: 650 1.05rem/1.2 var(--f-ui); }
  .account-pop-head strong svg { width: 20px; height: 20px; color: var(--gold); }
  /* Saldos: 2×2 con icono propio (components/icons.html). */
  .account-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
    border: 1px solid var(--line); margin-bottom: 14px; }
  .account-balances .balance { display: flex; align-items: center; gap: 10px; padding: 10px 11px; background: var(--deep); min-width: 0; }
  .account-balances .balance > svg { flex: none; width: 26px; height: 26px; color: var(--gold); }
  .account-balances .balance > span { display: grid; gap: 3px; min-width: 0; }
  .account-balances small { font: 500 .62rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .account-balances strong { font: 600 1.2rem/1.1 var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Actividad de personajes: lista corta, sin alertas; el tono indica el estado. */
  .account-activity { margin-bottom: 12px; }
  .account-activity-title { display: block; margin-bottom: 6px; font: 600 .66rem/1 var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
  .activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  .activity-list li { min-width: 0; }
  .activity-list a, .activity-empty { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px;
    border: 1px solid var(--line); background: rgba(10, 16, 34, .6); color: var(--ice); text-decoration: none; font-size: .88rem; }
  .activity-list a:hover { border-color: var(--gold-line); text-decoration: none; }
  .activity-list svg { flex: none; width: 18px; height: 18px; color: var(--tone-c, var(--muted)); }
  .activity-list .activity-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
  .activity-list .activity-state { flex: none; font: 500 .66rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--tone-c, var(--muted)); }
  .activity-list [data-tone="ok"] { --tone-c: var(--ok); }
  .activity-list [data-tone="info"] { --tone-c: var(--azure-bright); }
  .activity-list [data-tone="gold"] { --tone-c: var(--gold-bright); }
  .activity-empty { color: var(--muted); }
  /* Punto discreto en el avatar cuando hay un personaje activo. */
  .account-panel > summary { position: relative; }
  .activity-dot { position: absolute; left: 31px; top: 8px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--tone-c, var(--ok)); box-shadow: 0 0 0 2px var(--night), 0 0 10px var(--tone-c, var(--ok)); }
  .activity-dot[data-tone="gold"] { --tone-c: var(--gold-bright); }
  .activity-dot[data-tone="info"] { --tone-c: var(--azure-bright); }
  .account-links { display: grid; gap: 2px; margin-bottom: 12px; }
  .account-links a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px; color: var(--ice); font-weight: 560; }
  .account-links a svg { width: 18px; height: 18px; color: var(--gold); }
  .account-links a:hover { background: rgba(148, 180, 255, .1); color: var(--gold-bright); text-decoration: none; }
  .account-pop form button { width: 100%; }
  .account-logout { display: flex; align-items: center; justify-content: center; gap: 10px; --b-fg: var(--gold-bright); border-color: var(--gold-line); }
  .account-logout svg { width: 18px; height: 18px; }

  /* ---- Barra de cuenta -------------------------------------------------- */
  .account-dock { position: relative; z-index: 5; background: rgba(10, 16, 34, .86); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .account-dock .wrap { display: flex; align-items: center; gap: 20px; min-height: 50px; }
  .account-dock .dock-label { font: 600 .7rem/1 var(--f-title); letter-spacing: .2em; text-transform: uppercase;
    color: var(--gold); white-space: nowrap; }
  .account-dock .wrap { position: relative; }
  .account-dock nav { display: flex; align-items: stretch; gap: 2px; }
  .account-dock .dock-item { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 13px; white-space: nowrap;
    color: var(--text); font-size: .92rem; font-weight: 540; position: relative; }
  .account-dock .dock-item:hover, .account-dock [open] > .dock-item { color: var(--ice); text-decoration: none; background: rgba(148, 180, 255, .08); }
  .account-dock .dock-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
  .account-dock .dock-item[aria-current="page"], .account-dock .dock-item.is-current { color: var(--gold-bright); font-weight: 650; }
  .account-dock .dock-item[aria-current="page"]::after, .account-dock .dock-item.is-current::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 0;
    height: 2px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
  @media (max-width: 520px) {
    /* Cuatro entradas repartidas (el desplegable se ajusta junto al componente .dropdown). */
    .account-dock nav { flex: 1; justify-content: space-between; gap: 0; }
    .account-dock .dock-item { padding: 0 9px; font-size: .86rem; }
    .account-dock .dock-item--wide { display: none; }  /* Clanes y Contraseña siguen en el menú lateral */
  }
  @media (max-width: 379px) {
    .account-dock .dock-item { padding: 0 5px; gap: 4px; font-size: .8rem; }
    .account-dock .dock-item[aria-current="page"]::after, .account-dock .dock-item.is-current::after { left: 5px; right: 5px; }
  }

  /* ---- Contenido y estandarte de página --------------------------------- */
  .main-content { position: relative; flex: 1; width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto;
    padding: clamp(36px, 6vw, 76px) 0 clamp(64px, 8vw, 110px); min-width: 0; }
  .main-content > * { position: relative; }
  /* Arte de cabecera: cada vista define --banner (y --banner-pos) en la capa pages */
  .main-content::before { content: ""; position: absolute; z-index: 0; top: 0; left: 50%; width: 100vw; transform: translateX(-50%);
    height: clamp(300px, 36vw, 540px); pointer-events: none;
    background: linear-gradient(180deg, rgba(7, 11, 24, .35) 0%, rgba(7, 11, 24, .72) 55%, var(--night) 100%),
      linear-gradient(90deg, rgba(7, 11, 24, .88) 0%, rgba(7, 11, 24, .3) 60%, rgba(7, 11, 24, .55) 100%),
      var(--banner, none) var(--banner-pos, 50% 30%) / cover no-repeat, var(--deep); }
  /* Con el menú de cuenta debajo de la cabecera, el contenido arranca más cerca. */
  body:has(.account-dock) .main-content { padding-top: clamp(14px, 2vw, 26px); }
  body:has(.account-dock) .main-content > .page-heading:first-child { padding-top: clamp(6px, 1.4vw, 18px); }
  .page-index .main-content { width: 100%; padding: 0; }
  .page-index .main-content::before { display: none; }
  .page-index .main-content > .flash {
    position: absolute; z-index: 20; top: 16px; left: 50%; transform: translateX(-50%);
    width: min(100% - 2 * var(--gutter), 760px); margin: 0; }

  /* ---- Hoja de navegación móvil ----------------------------------------- */
  .nav-sheet { margin: 0; inset: 0 0 0 auto; width: min(420px, 100%); height: 100dvh; max-height: none;
    border: 0; border-left: 1px solid var(--gold-line); padding: 0; background: var(--deep); color: var(--text); overflow-y: auto;
    box-shadow: var(--shadow-2); }
  .nav-sheet::backdrop { background: rgba(3, 6, 13, .72); backdrop-filter: blur(3px); }
  .nav-sheet:popover-open { animation: sheet-in .3s var(--ease); }
  @keyframes sheet-in { from { transform: translateX(28px); opacity: 0; } }
  .sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h); padding: 0 20px; background: var(--deep); border-bottom: 1px solid var(--line); z-index: 1; }
  .sheet-body { padding: 8px 20px calc(32px + env(safe-area-inset-bottom)); }
  .panel-nav { display: flex; flex-direction: column; }
  .nav-category { margin: 24px 0 6px; font: 600 .68rem/1 var(--f-title); letter-spacing: .22em;
    text-transform: uppercase; color: var(--gold); }
  .nav-link { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 2px;
    border-bottom: 1px solid var(--line); color: var(--ice); font-weight: 560; font-size: 1.04rem; }
  .nav-link::after { content: "→"; color: var(--muted); transition: transform .2s var(--ease), color .2s; }
  .nav-link:hover { text-decoration: none; color: var(--gold-bright); }
  .nav-link:hover::after { transform: translateX(4px); color: var(--gold); }
  .nav-link.is-active { color: var(--gold-bright); font-weight: 680; }
  .nav-link.is-active::after { content: "◆"; font-size: .6rem; color: var(--gold); }
  .sheet-body form { margin-top: 22px; }
  .sheet-body form button { width: 100%; }
  .tabbar { display: none; }

  /* ---- Pie: Estado del reino -------------------------------------------- */
  .site-footer { position: relative; background: var(--abyss); color: var(--text); overflow: hidden; isolation: isolate;
    border-top: 1px solid var(--line); }
  .site-footer::before { content: ""; position: absolute; z-index: -1; right: -4%; bottom: -8%; width: min(620px, 80vw); aspect-ratio: 941 / 1672;
    background: url("art/boceto-941.webp") center / contain no-repeat; opacity: .13; mix-blend-mode: screen;
    mask-image: radial-gradient(closest-side, #000 40%, transparent); -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent); }
  .site-footer::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-line) 30%, var(--gold-line) 70%, transparent); }
  .site-footer a { color: var(--ice); }
  .realm { padding: clamp(44px, 6vw, 72px) 0 40px; }
  .realm-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
  .realm-head h2 { margin: 10px 0 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); }
  .realm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0;
    border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: rgba(10, 16, 34, .6); }
  .realm-grid > div { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
  .realm-grid dt { font: 500 .68rem/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .realm-grid dd { margin: 8px 0 0; color: var(--ice); font: 600 clamp(1.6rem, 1.3rem + 1vw, 2.2rem)/1 var(--f-display);
    font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
  .realm-grid dd small { font: 500 .8rem var(--f-mono); color: var(--muted); }
  .realm-grid dd a { color: var(--gold-bright); }
  .sync-indicator { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px;
    border: 1px solid var(--line); font: 500 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .04em; color: var(--text); }
  .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--azure-bright); flex: none; }
  .sync-indicator.is-live .sync-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
  .sync-indicator.is-error .sync-dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
  .footer-main { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 28px; padding: 34px 0 28px; border-top: 1px solid var(--line); }
  .footer-brand img { width: min(230px, 60vw); height: auto; margin: -14px 0 0 -14px; }
  .footer-brand p { margin: 4px 0 0; max-width: 34ch; color: var(--muted); }
  .footer-col h3 { font: 600 .7rem/1 var(--f-title); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 6px 0 14px; }
  .footer-col a { display: block; padding: 7px 0; color: var(--text); }
  .footer-col a:hover { color: var(--gold-bright); }
  .footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 18px 0 28px;
    border-top: 1px solid var(--line); font: 500 var(--t-xs)/1.4 var(--f-mono); letter-spacing: .06em; color: var(--muted); }

  /* ---- Responsive del armazón -------------------------------------------- */
  @media (max-width: 1180px) {
    .primary-nav { display: none; }
    .site-header .wrap { justify-content: space-between; }
    .menu-button { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; min-height: 0;
      border: 1px solid var(--line-strong); background: rgba(14, 22, 48, .6); color: var(--ice); cursor: pointer; clip-path: none; }
    .menu-button::after { display: none; }
    .menu-button:hover { border-color: var(--gold-line); background: rgba(148, 180, 255, .12); color: var(--gold-bright); }
    .menu-button svg { width: 20px; height: 20px; }
    .header-actions .live-chip { display: none; }
  }
  @media (max-width: 760px) {
    :root { --header-h: 62px; }
    .brand-emblem { height: 54px; }
    .header-actions .btn, .header-actions .header-link { display: none; }
    .account-name, .account-panel > summary svg { display: none; }
    .account-panel > summary { padding: 0 6px; height: 46px; }
    .account-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 8px); width: auto; }
    .tabbar { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
      height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
      background: rgba(5, 8, 18, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
      border-top: 1px solid var(--gold-line); }
    .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; overflow: visible;
      min-height: 0; height: var(--tabbar-h); padding: 0; margin: 0; border: 0; background: none; color: var(--muted);
      font: 600 .66rem/1 var(--f-ui); letter-spacing: .03em; clip-path: none; cursor: pointer; position: relative; }
    .tabbar button::after { display: none; }
    .tabbar svg { width: 22px; height: 22px; }
    .tabbar a:hover, .tabbar button:hover { color: var(--ice); background: none; text-decoration: none; }
    .tabbar a[aria-current="page"] { color: var(--gold-bright); }
    .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
    .tabbar .tab-cta { color: var(--gold-bright); }
    .tabbar .tab-gem { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -24px;
      background: var(--gold-grad); color: var(--gold-ink); filter: drop-shadow(0 6px 14px rgba(228, 185, 98, .5));
      clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
    .tabbar .tab-gem svg { width: 18px; height: 18px; }
    body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    .account-dock .dock-label { display: none; }
    .realm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-main { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
  }
  @media (max-width: 380px) { .brand-word { display: none; } }
  @media (max-height: 480px) and (orientation: landscape) and (max-width: 960px) {
    .tabbar { display: none; } body { padding-bottom: 0; }
  }
}

/* ========================================================================== */
@layer components {
  /* ---- Etiqueta con gema --------------------------------------------------- */
  .eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 .72rem/1.2 var(--f-title);
    letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
  .eyebrow::before { content: ""; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); flex: none; box-shadow: 0 0 10px currentColor; }

  /* ---- Encabezados de página ---------------------------------------------- */
  .page-heading, .community-hero { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end;
    justify-content: space-between; gap: 18px; padding: clamp(8px, 3vw, 44px) 0 30px; margin: 0 0 34px; }
  .page-heading::after, .community-hero::after,
  .page-shop .main-content > .section-head:first-child::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
    background:
      linear-gradient(var(--gold), var(--gold)) 0 4px / 120px 1px no-repeat,
      linear-gradient(90deg, var(--line-strong), transparent) 150px 4px / calc(100% - 150px) 1px no-repeat; }
  .page-heading::before, .community-hero::before,
  .page-shop .main-content > .section-head:first-child::before {
    content: ""; position: absolute; left: 128px; bottom: 0; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg);
    box-shadow: 0 0 12px var(--gold); }
  .page-heading h1, .page-heading h2, .community-hero h1 { margin: 16px 0 0; font-size: var(--t-h1); text-shadow: 0 2px 30px rgba(0, 0, 0, .7); }
  .page-heading p, .community-hero p { margin: 14px 0 0; color: var(--text); max-width: 62ch; font-size: var(--t-lg); text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
  .community-hero { display: block; }
  .community-hero:has(> img:not([hidden])) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 30px; align-items: center; }
  .community-hero:has(> img:not([hidden])) > :not(img) { grid-column: 2; }
  .community-hero > img { grid-row: 1 / span 4; width: clamp(104px, 14vw, 170px); height: auto; aspect-ratio: 1; object-fit: contain;
    border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff, #c9d8f5 70%); padding: 6px;
    box-shadow: 0 0 0 2px var(--gold), 0 0 0 7px rgba(228, 185, 98, .16), var(--shadow-2); }
  .community-hero > img.guild-emblem { border-radius: 0; background: var(--deep); image-rendering: pixelated; }

  .section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 0 0 20px; }
  .section-head h1 { margin: 16px 0 0; }
  .section-head h2 { margin: 0; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); }
  .section-head h3 { margin: 0; }
  .section-head > div > .eyebrow + h2 { margin-top: 10px; }
  .section-head p { margin: 0; }
  .section-head > a, .section-head nav a { font-weight: 600; }
  .section-head nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .section-head > span { font: 500 var(--t-sm) var(--f-mono); color: var(--muted); }

  /* ---- Superficies: placas con cantoneras de oro --------------------------- */
  .card, .panel, .box, .stat,
  :where(.main-content) section:not([class]) {
    position: relative; min-width: 0; margin: 0 0 20px; padding: clamp(18px, 2.4vw, 28px);
    border: 1px solid var(--line);
    background:
      linear-gradient(var(--gold), var(--gold)) left top / var(--tick) 1px no-repeat,
      linear-gradient(var(--gold), var(--gold)) left top / 1px var(--tick) no-repeat,
      linear-gradient(var(--gold), var(--gold)) right bottom / var(--tick) 1px no-repeat,
      linear-gradient(var(--gold), var(--gold)) right bottom / 1px var(--tick) no-repeat,
      var(--plate-grad);
    box-shadow: var(--shadow-1); }
  .card > :last-child, .panel > :last-child, .box > :last-child,
  :where(.main-content) section:not([class]) > :last-child { margin-bottom: 0; }
  :where(.main-content) section:not([class]) > h2:first-child { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.8rem); margin-bottom: .8em; }
  :where(.card, .panel, .character-panel, .box) section:not([class]) {
    padding: 22px 0 0; margin: 22px 0 0; border: 0; border-top: 1px solid var(--line); background: none; box-shadow: none; }
  .panel .panel, .card .card { box-shadow: none; }
  .card h3, .panel h3 { margin-bottom: .6em; }

  .grid, .stats-grid, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
  .grid { margin: 0 0 20px; }
  .grid > .card, .grid > .panel, .grid > section, .stats-grid > .stat { margin: 0; }
  .stats-grid { margin: 0 0 24px; }

  .stat { display: flex; flex-direction: column; gap: 6px; }
  .stat-label, .stat > span:first-child { font: 500 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .stat strong { font: 600 clamp(2rem, 1.6rem + 1.2vw, 2.9rem)/1 var(--f-display); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere;
    background: linear-gradient(180deg, #fff, var(--frost)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .stat-detail { color: var(--muted); font-size: var(--t-sm); }

  dl { margin: 0 0 1em; }
  .card dl:not([class]), .panel dl:not([class]) { display: grid; grid-template-columns: minmax(42%, 1fr) minmax(0, auto); }
  .card dl:not([class]) dt, .panel dl:not([class]) dt { padding: 11px 12px 11px 0; color: var(--text); border-bottom: 1px dashed var(--line-strong); }
  .card dl:not([class]) dd, .panel dl:not([class]) dd { margin: 0; padding: 11px 0; text-align: right; font-weight: 650; color: var(--ice);
    border-bottom: 1px dashed var(--line-strong); font-variant-numeric: tabular-nums; }

  /* ---- Tablas --------------------------------------------------------------- */
  .table-scroll, .scroll, .table-wrap { width: 100%; overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line);
    background: var(--deep); -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  table { width: 100%; border-collapse: collapse; font-size: .95rem; }
  .table-scroll table, .scroll table, .table-wrap table { min-width: 600px; }
  th { text-align: left; font: 500 .7rem/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  thead th, .table-scroll > table:not(:has(thead)) tr:first-child th, .scroll > table:not(:has(thead)) tr:first-child th { background: rgba(91, 135, 255, .09); color: var(--frost); }
  th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  thead th { border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
  tbody th[scope="row"] { font: 600 .95rem var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ice); }
  tbody tr:last-child > * { border-bottom: 0; }
  tbody tr { transition: background-color .15s; }
  tbody tr:hover { background: rgba(148, 180, 255, .06); }
  td a { font-weight: 600; }
  td p { margin: 4px 0 0; }
  td form { margin: 0; }
  td button, td .btn { min-height: 38px; padding: 0 14px; font-size: .85rem; --cut: 7px; }
  @media (max-width: 700px) { th, td { padding: 12px; } }
  table img { display: block; object-fit: contain; }

  /* ---- Formularios ---------------------------------------------------------- */
  label { font-weight: 600; font-size: .92rem; color: var(--ice); }
  input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="email"],
  input:not([type]), select, textarea {
    width: 100%; min-width: 0; min-height: 48px; padding: 0 14px; margin: 0;
    border: 1px solid var(--line-strong); border-radius: 0; background: rgba(3, 6, 13, .6); color: var(--ice);
    font: 500 1rem var(--f-ui); transition: border-color .15s, box-shadow .15s, background-color .15s; appearance: none; }
  textarea { padding: 12px 14px; min-height: 120px; }
  select { padding-right: 40px; cursor: pointer;
    background: rgba(3, 6, 13, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e4b962' stroke-width='1.8'/%3E%3C/svg%3E") right 15px center / 12px 8px no-repeat; }
  select option { background: var(--plate); color: var(--ice); }
  input:hover, select:hover, textarea:hover { border-color: var(--azure-bright); }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(228, 185, 98, .2); background-color: rgba(3, 6, 13, .85); }
  input:disabled, select:disabled { background-color: rgba(20, 29, 61, .6); color: var(--muted); cursor: not-allowed; border-color: var(--line); }
  input[type="hidden"] { display: none; }
  /* Casillas y opciones propias: sin la altura mínima de los campos y con marca visible. */
  input[type="checkbox"], input[type="radio"] { display: inline-grid; place-content: center; width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: none;
    cursor: pointer; appearance: none; border: 1px solid var(--line-strong); background: rgba(3, 6, 13, .7); transition: background-color .15s, border-color .15s, box-shadow .15s; }
  input[type="radio"] { border-radius: 50%; }
  input[type="checkbox"]::before { content: ""; width: 12px; height: 12px; background: var(--gold-ink); transform: scale(0); transition: transform .15s var(--ease);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); }
  input[type="radio"]::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-ink); transform: scale(0); transition: transform .15s var(--ease); }
  input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--gold-grad); border-color: var(--gold); }
  input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
  input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: none; }
  input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
  input[type="number"] { font-variant-numeric: tabular-nums; }
  ::placeholder { color: #7685aa; }
  input:-webkit-autofill { -webkit-text-fill-color: var(--ice); box-shadow: 0 0 0 100px #0a1022 inset; }
  label > input, label > select { display: block; margin-top: 7px; }
  /* Casilla con texto en una sola línea (componente «check»). */
  label.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; cursor: pointer;
    border: 1px solid var(--line); background: rgba(3, 6, 13, .55); }
  label.check > input { display: inline-grid; margin: 0; }
  label.check { line-height: 1.35; }
  label.check:has(input:checked) { border-color: var(--tone, var(--gold)); }
  .field-label { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; }
  .form-stack { display: grid; gap: 18px; }
  .form-field { display: grid; gap: 7px; align-content: start; }
  .form-field > :is(input, select, textarea) { margin-top: 0; }
  .form-field span.hint { font-weight: 400; color: var(--muted); font-size: var(--t-sm); }
  fieldset { min-width: 0; margin: 0 0 18px; padding: 18px 20px 20px; border: 1px solid var(--line); background: rgba(3, 6, 13, .35); }
  legend { padding: 0 8px; margin-left: -8px; font: 600 .7rem/1.3 var(--f-title); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
  fieldset > p { margin: 0 0 12px; }
  fieldset > :last-child { margin-bottom: 0; }

  /* ---- Pestañas ---------------------------------------------------------------- */
  /* Una sola barra de pestañas en toda la web (misma que el menú de personaje): fondo noche y subrayado dorado. */
  .tabs, .rank-tabs { display: flex; gap: 2px; margin: 0 0 20px; overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--line-strong); scroll-snap-type: x proximity;
    background: rgba(7, 11, 24, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .tabs::-webkit-scrollbar, .rank-tabs::-webkit-scrollbar { display: none; }
  .tabs a, .rank-tabs a, .tabs > button { position: relative; display: flex; align-items: center; min-height: 50px; padding: 0 17px; white-space: nowrap;
    color: var(--text); font: 600 .78rem/1 var(--f-title); letter-spacing: .12em; text-transform: uppercase; scroll-snap-align: start; }
  .tabs > button { overflow: visible; margin: 0; border: 0; clip-path: none; --b-bg: transparent; --b-fg: var(--text); --b-bg-h: rgba(148, 180, 255, .07); }
  .tabs > button::after { content: none; }
  .tabs a:hover, .rank-tabs a:hover { color: var(--ice); text-decoration: none; background: rgba(148, 180, 255, .07); }
  .tabs a[aria-current="page"], .rank-tabs a.selected, .rank-tabs a[aria-current="page"], .tabs > button[aria-selected="true"] { color: var(--gold-bright); }
  .tabs a[aria-current="page"]::after, .rank-tabs a.selected::after, .tabs > button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--gold); box-shadow: 0 0 14px var(--gold); transform: none; }

  /* ---- Píldoras, insignias, avisos ------------------------------------------ */
  .status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; font: 500 .72rem/1 var(--f-mono);
    letter-spacing: .08em; text-transform: uppercase; background: rgba(148, 180, 255, .1); color: var(--muted); white-space: nowrap; }
  .status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .status-pill.online { background: var(--ok-soft); color: var(--ok); }
  .status-pill.blocked { background: var(--bad-soft); color: var(--bad); }
  .badges { display: flex; flex-wrap: wrap; gap: 8px; }
  .badges span { padding: 7px 12px; border: 1px solid var(--line-strong); background: rgba(91, 135, 255, .1); color: var(--frost);
    font-size: .88rem; font-weight: 560; }
  .alert, .flash, .notice, .inline-status, [role="alert"]:not(.points-warning):not([hidden]) {
    position: relative; margin: 0 0 20px; padding: 14px 18px 14px 20px; border: 1px solid; border-left-width: 3px; font-size: .95rem; }
  .alert, .inline-status { background: var(--warn-soft); border-color: rgba(243, 197, 82, .35); border-left-color: var(--warn); color: #f6dfa0; }
  .flash, .notice { background: rgba(14, 22, 48, .96); border-color: var(--gold-line); border-left-color: var(--gold); color: var(--ice); box-shadow: var(--shadow-1); }
  [role="alert"]:not(.alert):not(.points-warning) { background: var(--bad-soft); border-color: rgba(255, 123, 144, .35); border-left-color: var(--bad); color: #ffc2cc; }
  .points-warning { color: var(--bad); font-weight: 600; }
  .danger-panel { border-color: rgba(255, 123, 144, .4); }
  .danger-panel h3, .danger-panel h2 { color: var(--bad); }
  .empty-state { padding: 44px 20px !important; text-align: center; color: var(--muted); }
  .muted, .muted-block { color: var(--muted); }
  small.muted, p.muted { font-size: var(--t-sm); }
  .text-danger { color: var(--bad); } .text-success { color: var(--ok); }

  h1 .help-tip, h2 .help-tip, h3 .help-tip { text-transform: none; letter-spacing: 0; vertical-align: .35em; }

  details:not(.dropdown) > summary { cursor: pointer; font-weight: 600; color: var(--azure-bright); }
  details:not(.account-panel):not(.dropdown) > summary { padding: 6px 0; }
  details[open]:not(.account-panel):not(.dropdown) > summary { margin-bottom: 8px; }

  .pagination, nav.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 26px 0 0; }
  .pagination a, nav.actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
    border: 1px solid var(--line-strong); background: rgba(14, 22, 48, .7); font-weight: 600; color: var(--ice); }
  .pagination a:hover, nav.actions a:hover { border-color: var(--gold); color: var(--gold-bright); text-decoration: none; }
  .pagination span, nav.actions span { font: 500 var(--t-sm) var(--f-mono); color: var(--muted); padding: 0 8px; }
  .actions, .action-bar, .toolbar, .flex { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .action-bar { margin: 6px 0 0; }

  .guild-emblem { width: 72px; height: 72px; image-rendering: pixelated; border: 1px solid var(--line-strong); background: var(--deep); padding: 4px; }
  .guild-emblem.small { width: 28px; height: 28px; padding: 2px; vertical-align: middle; margin-right: 6px; }

  .main-content > p:first-child > a:only-child { display: inline-flex; gap: 6px; min-height: 32px; align-items: center; font: 500 var(--t-sm) var(--f-mono); letter-spacing: .04em; }
}

/* ========================================================================== */
@layer pages {
  /* ---------- Arte de cabecera por vista ---------- */
  .page-ranking, .page-community, .page-public_character, .page-public_guild { --banner: url("art/duelo-1672.webp"); --banner-pos: 60% 30%; }
  .page-shop, .page-item_detail, .page-choose_seed, .page-buy_vip, .page-buy_zen, .page-coins, .page-wompi_start, .page-wompi_return { --banner: url("art/abismo-1672.webp"); --banner-pos: 60% 22%; }
  .page-informacion { --banner: url("art/asedio-1672.webp"); --banner-pos: 50% 30%; }
  .page-downloads { --banner: url("art/guardian-1672.webp"); --banner-pos: 50% 16%; }
  .page-characters, .page-progression, .page-inventory_page, .page-change_password { --banner: url("art/guardian-1672.webp"); --banner-pos: 50% 36%; }
  @media (max-width: 900px) {
    .page-ranking, .page-community, .page-public_character, .page-public_guild { --banner: url("art/duelo-1100.webp"); }
    .page-shop, .page-item_detail, .page-choose_seed, .page-buy_vip, .page-buy_zen, .page-coins, .page-wompi_start, .page-wompi_return { --banner: url("art/abismo-900.webp"); }
    .page-informacion { --banner: url("art/asedio-900.webp"); }
    .page-downloads, .page-characters, .page-progression, .page-inventory_page, .page-change_password { --banner: url("art/guardian-900.webp"); }
  }

  /* ====================== PORTADA ====================== */
  .hero { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
    min-height: clamp(640px, 100svh, 1080px); margin-top: calc(-1 * var(--header-h)); padding-top: var(--header-h); background: var(--abyss); }
  .hero-art { position: absolute; inset: 0; z-index: -3; }
  .hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; }
  .hero-veil { position: absolute; inset: 0; z-index: -2; pointer-events: none;
    background:
      linear-gradient(180deg, rgba(3, 6, 13, .75) 0%, transparent 22%, transparent 48%, rgba(7, 11, 24, .82) 82%, var(--night) 100%),
      linear-gradient(90deg, rgba(3, 6, 13, .94) 0%, rgba(3, 6, 13, .72) 30%, rgba(3, 6, 13, .08) 62%, rgba(3, 6, 13, .3) 100%); }
  /* Motas de hielo y chispas, muy tenues */
  .hero-motes { position: absolute; inset: -10% 0 0; z-index: -1; pointer-events: none; opacity: .8;
    background-image:
      radial-gradient(1.5px 1.5px at 12% 20%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 28% 64%, #cfe0ff 50%, transparent 51%),
      radial-gradient(1.5px 1.5px at 44% 34%, #fff 50%, transparent 51%), radial-gradient(2.5px 2.5px at 61% 78%, #ffd98a 50%, transparent 51%),
      radial-gradient(1.5px 1.5px at 73% 14%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 86% 52%, #ffc56b 50%, transparent 51%),
      radial-gradient(1.5px 1.5px at 94% 86%, #cfe0ff 50%, transparent 51%), radial-gradient(2px 2px at 6% 88%, #ffd98a 50%, transparent 51%);
    background-size: 100% 50%; animation: motes 26s linear infinite; }
  @keyframes motes { to { background-position: 0 -100%; } }
  .hero-inner { padding: clamp(40px, 7vw, 90px) 0 clamp(28px, 4vw, 48px); }
  .hero-copy { max-width: 720px; }
  .hero h1 { margin: 20px 0 0; font-size: clamp(2.5rem, 1.2rem + 6vw, 6.4rem); line-height: .96; letter-spacing: .02em;
    text-shadow: 0 4px 40px rgba(0, 0, 0, .75); }
  .hero h1 em { display: inline-block; font-size: 1.32em; line-height: .8; padding-right: .1em; filter: drop-shadow(0 0 26px rgba(228, 185, 98, .45)); }
  .hero h1 .h1-sub { display: block; margin-top: .9em; font-size: clamp(.82rem, .6rem + .8vw, 1.25rem); letter-spacing: .34em; color: var(--frost); font-weight: 500; }
  .hero-lede { margin: 26px 0 0; max-width: 50ch; font-size: clamp(1.02rem, .95rem + .4vw, 1.25rem); line-height: 1.6; color: var(--text);
    text-shadow: 0 1px 14px rgba(0, 0, 0, .9); }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
  .hero-note { margin: 18px 0 0; font: 500 var(--t-xs)/1.5 var(--f-mono); letter-spacing: .06em; color: var(--muted); }

  .ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 clamp(24px, 4vw, 46px);
    background: rgba(8, 13, 28, .72); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-2); position: relative; }
  .ledger::before, .ledger::after { content: ""; position: absolute; width: 16px; height: 16px; border: 1px solid var(--gold); }
  .ledger::before { left: -5px; top: -5px; border-right: 0; border-bottom: 0; }
  .ledger::after { right: -5px; bottom: -5px; border-left: 0; border-top: 0; }
  .ledger > div { padding: clamp(14px, 2vw, 22px) clamp(14px, 2.4vw, 28px); border-right: 1px solid var(--line); min-width: 0; }
  .ledger > div:last-child { border-right: 0; }
  .ledger dt { font: 500 .66rem/1.3 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
  .ledger dd { margin: 6px 0 0; font: 600 clamp(1.8rem, 1.3rem + 1.8vw, 3rem)/1 var(--f-display); color: var(--ice);
    font-variant-numeric: lining-nums tabular-nums; display: flex; align-items: center; gap: 10px; }
  .ledger dd small { font: 500 .9rem var(--f-mono); color: var(--gold); }

  /* Capítulos */
  .chapter { position: relative; padding: clamp(30px, 4.4vw, 60px) 0; isolation: isolate; }
  .chapter-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 40px; margin-bottom: clamp(18px, 2.4vw, 30px); }
  .chapter-head h2 { margin: 12px 0 0; max-width: 22ch; }
  .chapter-head p { margin: 12px 0 0; max-width: 56ch; color: var(--text); font-size: var(--t-lg); }
  .chapter-num { display: inline-flex; align-items: center; gap: 12px; font: 600 .72rem/1 var(--f-title); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
  .chapter-num b { font: italic 600 2.2rem/1 var(--f-display); letter-spacing: 0; background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 4px; }
  .chapter-num i { width: 44px; height: 1px; background: var(--gold-line); }
  .text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 .8rem/1 var(--f-title); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: var(--gold-bright); }
  .text-link:hover { color: #fff; text-decoration: none; }
  .text-link svg { width: 18px; height: 18px; transition: transform .2s var(--ease); }
  .text-link:hover svg { transform: translateX(5px); }

  /* 01 · El reino en cifras */
  .chapter-realm::before { content: ""; position: absolute; z-index: -1; right: 0; top: 0; bottom: 0; width: min(46vw, 700px);
    background: url("art/boceto-941.webp") 50% 12% / cover no-repeat; opacity: .1; mix-blend-mode: screen;
    mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
  .spec-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--gold-line); }
  .spec { position: relative; padding: 28px 24px 30px 0; border-bottom: 1px solid var(--line); min-width: 0; transition: background-color .3s; }
  .spec:not(:nth-child(3n)) { border-right: 1px solid var(--line); }
  .spec:not(:nth-child(3n + 1)) { padding-left: 28px; }
  .spec-code { font: 500 .66rem/1 var(--f-mono); letter-spacing: .16em; color: var(--gold); }
  .spec-value { display: block; margin: 18px 0 10px; font: 600 clamp(2.4rem, 1.8rem + 2.6vw, 4.6rem)/.9 var(--f-display);
    font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere;
    background: linear-gradient(180deg, #fff 20%, var(--frost) 60%, var(--azure) 120%); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .spec-value small { font: 500 .95rem var(--f-mono); -webkit-text-fill-color: var(--gold); letter-spacing: .04em; margin-left: 6px; }
  .spec-label { font-weight: 650; color: var(--ice); }
  .spec-hint { display: block; margin-top: 4px; font-size: var(--t-sm); color: var(--muted); }

  /* 02 · Clases: estandartes */
  .chapter-classes { background: linear-gradient(180deg, var(--night), var(--deep) 30%, var(--deep) 70%, var(--night)); }
  .class-roster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .class-card { --drop: 0px; position: relative; padding: 18px 14px 54px; min-width: 0; text-align: center; margin-top: var(--drop);
    background: linear-gradient(180deg, var(--plate-3) 0%, var(--plate) 55%, #0a1126 100%);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), 50% 100%, 0 calc(100% - 34px));
    transition: transform .45s var(--ease), filter .45s var(--ease); }
  .class-card:nth-child(even) { --drop: 30px; }
  .class-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--gold-grad); }
  .class-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .45s;
    background: radial-gradient(120% 60% at 50% 0%, rgba(228, 185, 98, .22), transparent 70%); }
  .class-card:hover { transform: translateY(-10px); filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .6)); }
  .class-card:hover::after { opacity: 1; }
  .class-index { display: block; font: 500 .64rem/1 var(--f-mono); letter-spacing: .18em; color: var(--gold); margin-bottom: 12px; }
  .class-portrait { position: relative; width: min(100%, 132px); aspect-ratio: 1; margin: 0 auto 14px; border-radius: 50%; overflow: hidden;
    background: radial-gradient(circle at 50% 35%, #fff, #c6d6f6 72%);
    box-shadow: 0 0 0 2px var(--gold), 0 0 0 6px rgba(228, 185, 98, .14), 0 12px 24px -8px rgba(0, 0, 0, .8); }
  .class-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transform: scale(1.18) translateY(4%); transition: transform .5s var(--ease); }
  .class-card:hover .class-portrait img { transform: scale(1.3) translateY(4%); }
  .class-card h3 { margin: 0 0 8px; font: 600 1rem/1.15 var(--f-title); letter-spacing: .06em; text-transform: uppercase; color: var(--ice); }
  .class-role { margin: 0 0 14px; font-size: .84rem; color: var(--text); line-height: 1.45; }
  .class-path { list-style: none; margin: 0; padding: 12px 0 0; display: grid; gap: 5px; border-top: 1px solid var(--line); }
  .class-path li { font: 500 .68rem/1.35 var(--f-mono); color: var(--muted); }
  .class-path li::before { content: "↓ "; color: var(--gold); }
  .class-path li:last-child { color: var(--gold-bright); }

  /* 03 · Leyendas */
  .legends { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .leaderboard { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .leaderboard li { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 16px;
    padding: 14px 22px 14px 0; border: 1px solid var(--line); background: linear-gradient(90deg, var(--plate-2), var(--plate));
    transition: transform .25s var(--ease), border-color .25s; }
  .leaderboard li:hover { transform: translateX(6px); border-color: var(--line-strong); }
  .lb-rank { text-align: center; font: italic 600 2.3rem/1 var(--f-display); color: var(--azure-bright); font-variant-numeric: lining-nums; }
  .leaderboard li:first-child { padding-block: 24px; border-color: var(--gold-line);
    background: radial-gradient(90% 160% at 0% 50%, rgba(228, 185, 98, .2), transparent 60%), linear-gradient(90deg, var(--plate-3), var(--plate));
    box-shadow: var(--glow-gold); }
  .leaderboard li:first-child .lb-rank { font-size: 3.6rem; background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .leaderboard li:first-child .lb-name { font: 600 1.5rem/1.1 var(--f-title); letter-spacing: .05em; text-transform: uppercase; color: var(--gold-bright); }
  .lb-name { font: 650 1.12rem/1.2 var(--f-ui); color: var(--ice); }
  .lb-name:hover { color: var(--gold-bright); text-decoration: none; }
  .lb-class { display: block; margin-top: 3px; font-size: var(--t-sm); color: var(--muted); }
  .lb-stats { display: flex; gap: 20px; font: 500 var(--t-xs)/1.2 var(--f-mono); color: var(--muted); text-align: right; }
  .lb-stats b { display: block; margin-bottom: 3px; font: 600 1.4rem/1 var(--f-display); color: var(--ice); font-variant-numeric: lining-nums tabular-nums; }
  .side-stack { display: grid; gap: 20px; }
  .side-card { padding: 22px 24px; background: var(--plate-grad); border: 1px solid var(--line); }
  .side-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px;
    font: 600 .86rem/1.2 var(--f-title); letter-spacing: .14em; text-transform: uppercase; }
  .side-card h3 a { font: 500 var(--t-xs) var(--f-mono); letter-spacing: .08em; }
  .roll { list-style: none; margin: 0; padding: 0; }
  .roll li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px dashed var(--line-strong); min-width: 0; }
  .roll li:last-child { border-bottom: 0; }
  .roll a { font-weight: 620; color: var(--ice); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .roll a:hover { color: var(--gold-bright); }
  .roll .roll-meta { margin-left: auto; font: 500 var(--t-xs) var(--f-mono); color: var(--muted); white-space: nowrap; }
  .roll .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 8px var(--ok); }
  .roll .guild-emblem.small { margin: 0; }
  .roll-empty { color: var(--muted); font-size: var(--t-sm); }
  .side-card small { display: block; margin-top: 10px; color: var(--muted); font-size: var(--t-xs); }

  /* 04 · El mundo */
  .chapter-world { background: var(--abyss); }
  .chapter-world .world-art { position: absolute; inset: 0; z-index: -1; }
  .chapter-world .world-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: .85; }
  .chapter-world .world-art::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--night) 0%, rgba(7, 11, 24, .25) 28%, rgba(7, 11, 24, .6) 62%, var(--night) 100%),
      linear-gradient(90deg, rgba(7, 11, 24, .8), transparent 55%); }
  .atlas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .atlas a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; min-height: 150px; padding: 22px;
    border: 1px solid var(--line-strong); background: rgba(6, 10, 22, .66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--ice);
    transition: transform .3s var(--ease), border-color .3s, background-color .3s; }
  .atlas a:hover { text-decoration: none; transform: translateY(-5px); border-color: var(--gold); background: rgba(10, 16, 34, .86); }
  .atlas-num { position: absolute; top: 14px; left: 22px; font: italic 600 1.7rem/1 var(--f-display); color: var(--gold); }
  .atlas strong { display: block; font: 600 1.05rem/1.2 var(--f-title); letter-spacing: .08em; text-transform: uppercase; }
  .atlas .atlas-desc { display: block; margin-top: 6px; color: var(--text); font-size: var(--t-sm); }
  .atlas svg { width: 22px; height: 22px; color: var(--gold); transition: transform .25s var(--ease); }
  .atlas a:hover svg { transform: translateX(5px); }

  /* Llamada final: el dragón */
  .cta-band { position: relative; isolation: isolate; padding: clamp(36px, 5vw, 70px) 0 clamp(32px, 4.5vw, 60px);
    background: radial-gradient(70% 90% at 78% 40%, rgba(214, 120, 30, .28), transparent 62%), linear-gradient(180deg, var(--night), #0b0a14 50%, var(--abyss)); }
  .cta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(24px, 5vw, 70px); align-items: center; }
  .cta-band h2 { font-size: clamp(2rem, 1.3rem + 3vw, 4rem); margin: 18px 0 0; }
  .steps { list-style: none; counter-reset: step; margin: 30px 0 34px; padding: 0; display: grid; border-top: 1px solid var(--line-strong); }
  .steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line-strong); }
  .steps li::before { content: counter(step, upper-roman); font: italic 600 1.7rem/1.1 var(--f-display); color: var(--gold); }
  .steps strong { display: block; }
  .steps span { font-size: var(--t-sm); color: var(--text); }
  .cta-actions { display: flex; flex-wrap: wrap; gap: 14px; }
  .dragon { position: relative; margin: clamp(-190px, -12vw, -40px) -12% 0 -4%; }
  .dragon img { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .7)) drop-shadow(0 0 60px rgba(240, 150, 40, .25));
    animation: hover-flight 7s ease-in-out infinite; transform-origin: 55% 50%; }
  @keyframes hover-flight { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-16px) rotate(1deg); } }

  @media (prefers-reduced-motion: no-preference) {
    .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
    .js .reveal.is-in { opacity: 1; transform: none; }
    .js .reveal .stagger > * { opacity: 0; translate: 0 22px; transition: opacity .7s var(--ease), translate .7s var(--ease), transform .45s var(--ease), filter .45s var(--ease), border-color .3s, background-color .3s; }
    .js .reveal.is-in .stagger > * { opacity: 1; translate: 0 0; }
    .js .reveal.is-in .stagger > :nth-child(2) { transition-delay: .07s, .07s, 0s, 0s, 0s, 0s; } .js .reveal.is-in .stagger > :nth-child(3) { transition-delay: .14s, .14s, 0s, 0s, 0s, 0s; }
    .js .reveal.is-in .stagger > :nth-child(4) { transition-delay: .21s, .21s, 0s, 0s, 0s, 0s; } .js .reveal.is-in .stagger > :nth-child(5) { transition-delay: .28s, .28s, 0s, 0s, 0s, 0s; }
    .js .reveal.is-in .stagger > :nth-child(6) { transition-delay: .35s, .35s, 0s, 0s, 0s, 0s; } .js .reveal.is-in .stagger > :nth-child(7) { transition-delay: .42s, .42s, 0s, 0s, 0s, 0s; }
    .hero-copy > *, .hero .ledger { animation: rise 1s var(--ease) both; }
    .hero-copy > :nth-child(2) { animation-delay: .1s; } .hero-copy > :nth-child(3) { animation-delay: .2s; }
    .hero-copy > :nth-child(4) { animation-delay: .3s; } .hero-copy > :nth-child(5) { animation-delay: .4s; }
    .hero .ledger { animation-delay: .55s; }
    .hero-art img { animation: arrive 2.4s var(--ease) both; }
    .main-content > .page-heading, .main-content > .community-hero, .main-content > .section-head:first-child, .auth-layout { animation: rise .8s var(--ease) both; }
    /* Paralaje ligado al desplazamiento (solo navegadores compatibles) */
    @supports (animation-timeline: scroll()) {
      @media (min-width: 701px) { .hero-art { animation: parallax linear both; animation-timeline: scroll(root); animation-range: 0 100vh; } }
      @keyframes parallax { to { transform: translateY(14%) scale(1.06); } }
    }
  }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } }
  @keyframes arrive { from { opacity: 0; transform: scale(1.1); filter: blur(6px); } }

  /* ====================== ACCESO / REGISTRO ====================== */
  .page-login .main-content::before, .page-register .main-content::before { display: none; }
  .auth-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 460px); gap: clamp(28px, 5vw, 72px); align-items: center; }
  .auth-art { position: relative; margin: 0; align-self: stretch; min-height: 520px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--abyss);
    clip-path: polygon(26px 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%, 0 26px); }
  .auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; animation: ken 24s ease-in-out infinite alternate; }
  @keyframes ken { to { transform: scale(1.08) translateY(-1.5%); } }
  .page-register .auth-art img { object-position: 64% 30%; }
  .auth-art blockquote { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 60px 30px 28px;
    background: linear-gradient(0deg, rgba(3, 6, 13, .95) 35%, transparent); }
  .auth-art blockquote p { margin: 0; font: italic 600 clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem)/1.15 var(--f-display); color: var(--ice); }
  .auth-art blockquote footer { margin-top: 12px; font: 600 .7rem var(--f-title); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
  .auth-layout .page-heading { margin-bottom: 26px; padding-top: 0; }
  .auth-layout .page-heading h1 { font-size: clamp(2rem, 1.5rem + 1.8vw, 3rem); }
  .auth-layout .page-heading p { font-size: 1rem; }
  .auth-card { padding: clamp(22px, 3vw, 34px); }
  .narrow-panel { max-width: 560px; }
  .auth-card button[type="submit"] { width: 100%; min-height: 54px; }
  .auth-card > p.muted { margin-top: 18px; text-align: center; }

  /* ====================== DESCARGAS ====================== */
  .download-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
  .download-card { margin: 0; border-color: var(--gold-line); }
  .download-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; }
  .download-heading h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); }
  .download-heading p { margin: 0; }
  .download-platform { padding: 7px 12px; background: var(--gold-grad); color: var(--gold-ink); font: 600 var(--t-xs)/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
  .download-details { display: grid; grid-template-columns: minmax(100px, .35fr) minmax(0, 1fr); gap: 1px; margin: 24px 0; background: var(--line); border: 1px solid var(--line); }
  .download-details div { padding: 14px 16px; background: var(--deep); min-width: 0; }
  .download-details dt { font: 500 .7rem/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .download-details dd { margin: 6px 0 0; font-weight: 650; color: var(--ice); }
  .download-hash { font: 500 .78rem/1.5 var(--f-mono) !important; overflow-wrap: anywhere; color: var(--text) !important; }
  .download-button { width: 100%; min-height: 60px; font-size: 1.08rem; --cut: 13px; }
  .download-steps { margin: 0; }
  .download-steps ol { list-style: none; counter-reset: dl; margin: 0; padding: 0; }
  .download-steps li { counter-increment: dl; display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px dashed var(--line-strong); }
  .download-steps li:last-child { border-bottom: 0; }
  .download-steps li::before { content: counter(dl, upper-roman); font: italic 600 1.7rem/1.1 var(--f-display); color: var(--gold); }
  .download-steps strong { display: block; }
  .download-steps span { color: var(--muted); font-size: var(--t-sm); }

  /* ====================== RANKING ====================== */

  .page-public_character .stats-grid, .page-public_guild .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* ====================== TIENDA ====================== */
  .page-shop .main-content::before, .page-buy_vip .main-content::before, .page-buy_zen .main-content::before {
    background: linear-gradient(180deg, rgba(7, 11, 24, .2) 0%, rgba(7, 11, 24, .7) 60%, var(--night) 100%),
      linear-gradient(90deg, rgba(7, 11, 24, .9) 0%, rgba(7, 11, 24, .35) 55%, transparent 100%),
      url("art/dragon-700.webp") right max(4vw, calc(50vw - 700px)) top 58% / auto 78% no-repeat,
      var(--banner) var(--banner-pos) / cover no-repeat, var(--deep); }
  .shop-search { margin: 0 0 24px; }
  .shop-search fieldset { display: grid; grid-template-columns: minmax(0, 2fr) repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 14px; align-items: end;
    border: 0; padding: 0; margin: 0; background: none; }
  .shop-search legend { margin-bottom: 12px; }
  .shop-search label { display: grid; gap: 7px; }
  .shop-search label > input, .shop-search label > select { margin: 0; }
  .shop-search .filter-actions { display: flex; align-items: center; gap: 14px; }
  .shop-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 16px;
    font: 500 var(--t-sm) var(--f-mono); color: var(--muted); }
  .shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
  .product { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--plate-grad); border: 1px solid var(--line);
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease); }
  .product:hover { border-color: var(--gold); box-shadow: var(--glow-gold), var(--shadow-2); transform: translateY(-5px); }
  .product:focus-within { border-color: var(--gold); }
  .product-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-bottom: 1px solid var(--line); overflow: hidden;
    background: radial-gradient(60% 70% at 50% 60%, rgba(91, 135, 255, .34), transparent 70%), var(--abyss); }
  .product-media::before { content: ""; position: absolute; left: 50%; top: 56%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid var(--line-strong); box-shadow: 0 0 0 14px rgba(150, 180, 255, .04); transition: transform .6s var(--ease), border-color .3s; }
  .product:hover .product-media::before { transform: translate(-50%, -50%) rotate(135deg); border-color: var(--gold-line); }
  .product-media img { position: relative; width: 62%; max-width: 150px; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .7)); transition: transform .35s var(--ease); }
  .product:hover .product-media img { transform: scale(1.1) translateY(-3px); }
  .product-media small { position: relative; font: 500 var(--t-xs) var(--f-mono); color: var(--muted); }
  .product-tag { position: absolute; z-index: 1; top: 10px; left: 10px; padding: 5px 8px; background: rgba(3, 6, 13, .7); border: 1px solid var(--line-strong);
    font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--frost); max-width: calc(100% - 20px);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .product-tag.is-game { left: auto; right: 10px; background: var(--gold-grad); color: var(--gold-ink); border-color: transparent; font-weight: 700; }
  .product-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
  .product-body h3 { margin: 0; font: 650 1.05rem/1.3 var(--f-ui); }
  .product-body h3 a { color: var(--ice); }
  .product-body h3 a::after { content: ""; position: absolute; inset: 0; }
  .product-body h3 a:hover { text-decoration: none; color: var(--gold-bright); }
  .product-class { font-size: var(--t-xs); color: var(--muted); }
  .product-desc { margin: 0; font-size: var(--t-sm); color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .product-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
  .product-price { font: 600 1.45rem/1 var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
  .product-price small { display: block; margin-top: 4px; font: 500 .66rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .product-cta { font: 600 var(--t-sm) var(--f-ui); color: var(--azure-bright); white-space: nowrap; }
  .product-variants { font-size: var(--t-xs); color: var(--muted); }
  .product details { position: relative; z-index: 1; font-size: var(--t-sm); }
  .product details summary { font-size: var(--t-sm); min-height: 32px; }
  .product details ul { margin: 0; max-height: 160px; overflow: auto; }
  .seed-selector fieldset { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 0; padding: 0; margin: 0; background: none; }
  .seed-selector legend { margin-bottom: 12px; }

  /* Ficha de artículo: vitrina de reliquia */
  .page-item_detail .main-content > h2, .page-choose_seed .main-content > h2 {
    font-size: var(--t-h1); margin: 14px 0 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line-strong); text-shadow: 0 2px 30px rgba(0, 0, 0, .7); }
  .page-item_detail .main-content > .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; }
  .page-item_detail .grid > article.card { position: sticky; top: calc(var(--header-h) + 20px); }
  .item-figure { display: block; margin: 6px auto 20px; width: 100%; max-width: 280px; aspect-ratio: 1; padding: 20px; border: 1px solid var(--line);
    background: radial-gradient(55% 55% at 50% 55%, rgba(91, 135, 255, .4), transparent 70%), var(--abyss); }
  .item-figure > img { display: block; width: 100%; height: 100%; object-fit: contain; }
  #selected-options { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
  #selected-options li { padding: 6px 10px; background: rgba(228, 185, 98, .1); border: 1px solid var(--gold-line); font-size: var(--t-sm); color: var(--gold-bright); }
  [aria-labelledby="resumen-compra"] strong { font-size: 1.15rem; }
  #price { font: 600 2.2rem var(--f-display); color: var(--gold-bright); }
  .buy-form .item-inline-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; margin: 0 0 12px; }
  .buy-form .item-inline-field label { margin: 0; }
  .buy-form .item-checkbox-line { margin: 0 0 6px; }
  .buy-form .item-checkbox-line label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px;
    background: rgba(14, 22, 48, .7); border: 1px solid var(--line); font-weight: 520; color: var(--text); cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
  .buy-form .item-checkbox-line label:hover { border-color: var(--azure-bright); }
  .buy-form .item-checkbox-line label:has(input:checked) { border-color: var(--gold); background: rgba(228, 185, 98, .1); color: var(--gold-bright); }
  .buy-form .item-checkbox-line label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
  .buy-form .socket-config-row { display: grid; grid-template-columns: 70px minmax(0, 1.6fr) auto minmax(70px, .6fr); gap: 10px; align-items: center; margin-bottom: 10px; }
  .buy-form .socket-config-row label { margin: 0; font-size: var(--t-sm); }
  .buy-form button[type="submit"] { width: 100%; min-height: 60px; font-size: 1.06rem; --b-bg: var(--gold-grad); --b-fg: var(--gold-ink);
    --b-bg-h: linear-gradient(180deg, #fff0c4, #efca7a 46%, #b9872f); font-weight: 720; }
  .buy-form fieldset:last-of-type .btn { width: 100%; min-height: 54px; }

  /* ====================== PERSONAJES ====================== */
  .page-shop .main-content > .section-head:first-child { position: relative; padding: clamp(8px, 3vw, 44px) 0 30px; margin-bottom: 30px; }
  .page-shop .main-content > .section-head:first-child h1 { font-size: var(--t-h1); margin: 16px 0 10px; text-shadow: 0 2px 30px rgba(0, 0, 0, .7); }
  .page-shop .main-content > .section-head:first-child p.muted { color: var(--text); font-size: var(--t-lg); text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
  .character-panel { padding: 0; overflow: hidden; }
  .character-panel > section, .character-panel > .grid { margin: 0 !important; padding: clamp(18px, 2.4vw, 28px) !important; }
  .character-panel > .grid { gap: 18px; background: rgba(3, 6, 13, .45); border-top: 1px solid var(--line); }
  .character-panel > .grid > .card { box-shadow: none; }
  .character-hero { display: grid; grid-template-columns: clamp(130px, 17vw, 200px) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px);
    align-items: center; padding: clamp(20px, 3vw, 36px); position: relative; isolation: isolate; border-bottom: 1px solid var(--gold-line);
    background: radial-gradient(60% 120% at 0% 50%, rgba(228, 185, 98, .16), transparent 60%), linear-gradient(120deg, var(--plate-3), var(--deep)); }
  .character-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16; mix-blend-mode: screen;
    background: url("art/boceto-941.webp") 80% 30% / 520px auto no-repeat;
    mask-image: linear-gradient(90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); }
  .character-overview h3 { margin: 0; font: 600 clamp(1.8rem, 1.3rem + 2vw, 3rem)/1 var(--f-title); letter-spacing: .04em; text-transform: uppercase; color: var(--ice); overflow-wrap: anywhere; }
  .character-class { margin: 8px 0 16px; font: 600 .74rem var(--f-title); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
  .character-location { margin: 0 0 12px; font: 500 var(--t-sm) var(--f-mono); color: var(--text); }
  .character-overview a { font-weight: 600; color: var(--gold-bright); }
  .stat-form .scroll { margin-bottom: 12px; }
  .stat-form input[type="number"] { width: 110px; min-height: 44px; display: inline-block; margin-left: 6px; }
  .stat-form td label { font: 600 var(--t-sm) var(--f-mono); color: var(--gold); }
  .stat-form output[data-projected] { font-weight: 650; color: var(--gold-bright); }
  .stat-form > p { font: 500 var(--t-sm) var(--f-mono); color: var(--text); }

  /* Progresión */
  .progress-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
  .progress-profile { position: sticky; top: calc(var(--header-h) + 20px); text-align: center; border-color: var(--gold-line); }
  .progress-profile .portrait { margin: 6px auto 20px; }
  .progress-assisted { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
  .progress-assisted h3 { margin: 0 0 6px; }
  .progress-profile h2 { margin: 0; font-size: 1.7rem; overflow-wrap: anywhere; }
  .progress-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
  /* Nivel, resets y nivel maestro: misma altura y la acción siempre abajo. */
  .progress-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; align-items: stretch; }
  .progress-card .facts { margin-bottom: 12px; }
  .progress-card .note { margin: 0 0 12px; }
  .progress-card-foot { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
  .quest-evolution-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
  .quest-evolution-link > span { flex: 1 1 220px; }
  .quest-evolution-link .btn svg.arrow { width: 14px; height: 14px; }
  .progress-card { display: flex; flex-direction: column; margin: 0; }
  .progress-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .progress-card-head h2 { margin: 0; font-size: 1.3rem; }
  .progress-card form, .progress-card > button { margin-top: auto; }
  .progress-form { display: grid; gap: 10px; }
  .progress-input { display: flex; gap: 8px; }
  .progress-input input { flex: 1; }
  .progress-input .btn-secondary { min-height: 48px; padding: 0 14px; }
  .progress-total { margin: 0; font: 500 var(--t-sm) var(--f-mono); color: var(--muted); }
  .progress-total strong { font: 600 1.6rem var(--f-display); color: var(--gold-bright); }
  .progress-card button[type="submit"], .progress-card > button { width: 100%; }

  /* Inventario */
  .item-cell { display: flex; align-items: center; gap: 14px; }
  .item-thumb { display: grid; place-items: center; flex: none; width: 56px; height: 56px; background: var(--abyss); border: 1px solid var(--line); }
  .item-thumb img { width: 100%; height: 100%; object-fit: contain; }
  .cell-action { text-align: right; width: 1%; white-space: nowrap; }
  .table-stack .status-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

  /* VIP, Zen, WCoinC: ofrendas */
  .page-buy_vip .grid > .card, .page-buy_zen .grid > .card, .page-coins .grid > .panel { display: flex; flex-direction: column; text-align: center; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
  .page-buy_vip .grid > .card:hover, .page-buy_zen .grid > .card:hover, .page-coins .grid > .panel:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: var(--glow-gold); }
  .page-buy_vip .grid > .card h3, .page-buy_zen .grid > .card h3, .page-coins .grid > .panel h3 { font: 600 1.5rem/1.1 var(--f-title); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; color: var(--gold-bright); }
  .page-buy_vip .grid > .card dl { text-align: left; }
  .page-buy_vip .grid > .card form, .page-buy_zen .grid > .card button, .page-coins .grid > .panel button { margin-top: auto; }
  .page-buy_vip .grid > .card button, .page-buy_zen .grid > .card button, .page-coins .grid > .panel button { width: 100%; }
  .page-buy_vip .grid > .card button, .page-buy_zen .grid > .card button, .page-coins .grid > .panel button {
    --b-bg: var(--gold-grad); --b-fg: var(--gold-ink); --b-bg-h: linear-gradient(180deg, #fff0c4, #efca7a 46%, #b9872f); font-weight: 720; }
  .page-buy_zen .grid > .card p strong, .page-coins .grid > .panel p strong { color: var(--gold-bright); }
  .page-coins .panel > p:first-child strong { font: 600 1.8rem var(--f-display); color: var(--gold-bright); }
  .page-coins .panel > form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }

  /* Información del servidor */
  .page-informacion .main-content > section { scroll-margin-top: calc(var(--header-h) + 70px); }
  .page-informacion .tabs { position: sticky; top: var(--header-h); z-index: 10; background: rgba(7, 11, 24, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .times { font: 500 var(--t-sm)/1.8 var(--f-mono); color: var(--gold-bright); }
  #map-search { max-width: 360px; margin: 8px 0 16px; display: block; }
}

/* ========================================================================== */
@layer pages {
  @media (max-width: 1180px) {
    .class-roster { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 22px;
      scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .class-roster::-webkit-scrollbar { display: none; }
    .class-card { flex: 0 0 clamp(190px, 26vw, 230px); scroll-snap-align: center; --drop: 0px !important; }
    .legends { grid-template-columns: 1fr; }
    .side-stack { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 900px) {
    .hero-art img { object-position: 60% 30%; }
    .hero-veil { background:
      linear-gradient(180deg, rgba(3, 6, 13, .7) 0%, transparent 18%, rgba(3, 6, 13, .1) 34%, rgba(7, 11, 24, .9) 62%, var(--night) 100%); }
    .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ledger > div:nth-child(2) { border-right: 0; }
    .ledger > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
    .spec-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spec { padding: 22px 16px 24px 0 !important; border-right: 0 !important; }
    .spec:nth-child(odd) { border-right: 1px solid var(--line) !important; }
    .spec:nth-child(even) { padding-left: 18px !important; }
    .chapter-head { grid-template-columns: 1fr; }
    .atlas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cta-grid { grid-template-columns: 1fr; }
    .dragon { order: -1; margin: -110px -8% -10px; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-art { min-height: 0; aspect-ratio: 16 / 9; order: -1; }
    .page-register .auth-art img { object-position: 64% 30%; }
  .auth-art blockquote { padding: 40px 20px 18px; }
    .download-layout { grid-template-columns: 1fr; }
    .page-item_detail .main-content > .grid { grid-template-columns: 1fr; }
    .page-item_detail .grid > article.card { position: static; }
    .progress-layout { grid-template-columns: 1fr; }
    .progress-profile { position: static; }
  }
  @media (max-width: 700px) {
    /* Teléfono: el arte corona la pantalla y el texto respira debajo */
    .hero { --art-h: min(118vw, 540px); min-height: 0; justify-content: flex-start; background: var(--night);
      padding-top: calc(var(--art-h) - 150px); }
    .hero-art { bottom: auto; height: var(--art-h); }
    .hero-art img { object-position: 50% 30%; }
    .hero-veil { bottom: auto; height: calc(var(--art-h) + 2px); background:
      linear-gradient(180deg, rgba(3, 6, 13, .8) 0%, rgba(3, 6, 13, .15) 20%, transparent 38%, rgba(7, 11, 24, .78) 70%, var(--night) 100%); }
    .hero-motes { bottom: auto; height: var(--art-h); }
    .hero-inner { padding: 0 0 26px; }
    .hero h1 { font-size: clamp(2.3rem, 11.5vw, 3.4rem); margin-top: 14px; }
    .hero h1 em { display: block; line-height: 1; margin-top: -.04em; }
    .hero h1 .h1-sub { margin-top: .7em; font-size: .78rem; letter-spacing: .22em; }
    .hero-lede { margin-top: 18px; }
    .hero-actions { margin-top: 24px; }
  }
  @media (max-width: 640px) {
    .hero-actions .btn { flex: 1 1 100%; }
    .spec-value { font-size: 2.2rem; margin: 14px 0 8px; }
    .spec-value small { font-size: .8rem; }
    .spec-hint { font-size: var(--t-xs); }
    .side-stack { grid-template-columns: 1fr; }
    .leaderboard li { grid-template-columns: 54px minmax(0, 1fr); padding-right: 16px; }
    .lb-stats { grid-column: 2; justify-content: flex-start; text-align: left; }
    .lb-rank { font-size: 1.9rem; }
    .leaderboard li:first-child .lb-rank { font-size: 2.6rem; }
    .leaderboard li:first-child .lb-name { font-size: 1.2rem; }
    .atlas { grid-template-columns: 1fr; }
    .atlas a { min-height: 0; padding: 18px 18px 18px 64px; }
    .atlas-num { top: 50%; left: 20px; transform: translateY(-50%); }
    .character-hero { grid-template-columns: 1fr; }
      .buy-form .item-inline-field { grid-template-columns: 1fr; gap: 6px; }
    .buy-form .socket-config-row { grid-template-columns: 1fr 1fr; }
    .buy-form .socket-config-row label { grid-column: 1 / -1; }
    .seed-selector fieldset { grid-template-columns: 1fr; }
    .shop-search fieldset { grid-template-columns: 1fr; }
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .product-body { padding: 12px 12px 14px; gap: 6px; }
    .product-body h3 { font-size: .95rem; }
    .product-desc, .product-variants, .product .product-tag:not(.is-game) { display: none; }
    .product-foot { flex-wrap: wrap; gap: 4px; }
    .product-price { font-size: 1.2rem; }
    .product-cta { font-size: var(--t-xs); }
    .page-shop .main-content::before, .page-buy_vip .main-content::before, .page-buy_zen .main-content::before {
      background: linear-gradient(180deg, rgba(7, 11, 24, .35) 0%, rgba(7, 11, 24, .78) 60%, var(--night) 100%),
        url("art/dragon-700.webp") right -40px top 30px / auto 58% no-repeat,
        var(--banner) var(--banner-pos) / cover no-repeat, var(--deep); }
    .page-public_character .stats-grid, .page-public_guild .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .community-hero:has(> img:not([hidden])) { grid-template-columns: 1fr; }
    .community-hero:has(> img:not([hidden])) > :not(img) { grid-column: 1; }
    .community-hero > img { grid-row: auto; margin-bottom: 14px; }
    .download-details { grid-template-columns: 1fr; }
  }
  @media (max-width: 340px) {
    .ledger dd { font-size: 1.5rem; }
    .spec-sheet { grid-template-columns: 1fr; }
    .spec:nth-child(odd) { border-right: 0 !important; }
    .spec:nth-child(even) { padding-left: 0 !important; }
    .shop-grid { grid-template-columns: 1fr; }
  }
  @media (max-height: 520px) and (orientation: landscape) {
    .hero { min-height: 520px; }
    .hero h1 { font-size: clamp(2rem, 6vw, 3rem); }
  }
}

/* ========================================================================== */
@layer utilities {
  /* Los controles pequeños conservan su tamaño aunque una vista ponga sus botones al 100 %. */
  .help-tip { width: 24px; height: 24px; flex: none; }
  .pw-toggle { width: 48px; }
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .sheet-session { margin-top: 18px; }
  .sheet-cta { margin-top: 22px; }
  .sheet-cta .btn { width: 100%; }
  .skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 18px; background: var(--gold); color: var(--gold-ink); font-weight: 700; }
  .skip-link:focus { top: 12px; color: var(--gold-ink); }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .hero-motes { display: none; }
  }
  @media print {
    .site-header, .account-dock, .tabbar, .site-footer, .nav-sheet, button, .main-content::before { display: none !important; }
    body { background: #fff; color: #000; padding: 0; }
    h1, h2, h3, strong, td, th, dd, dt, p { color: #000 !important; -webkit-text-fill-color: #000; text-shadow: none !important; }
    .card, .panel, .stat, section { background: #fff !important; box-shadow: none !important; border-color: #999 !important; }
  }
}

/* ==========================================================================
   Regalo diario y ceremonia de pago · efectos compartidos
   ========================================================================== */
@layer components {
  /* ---- Botón de regalo (cabecera) ---------------------------------------- */
  .gift-button { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0;
    border: 1px solid var(--line-strong); background: rgba(14, 22, 48, .6); color: var(--gold-bright); clip-path: none; overflow: visible; }
  .gift-button::after { display: none; }
  .gift-button svg { width: 22px; height: 22px; transform-origin: 50% 90%; }
  .gift-button:hover { border-color: var(--gold); background: rgba(228, 185, 98, .14); color: #fff; }
  .gift-button.has-gift { border-color: var(--gold-line); }
  .gift-button.has-gift svg { animation: gift-wiggle 3.6s ease-in-out infinite; }
  .gift-dot { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold);
    box-shadow: 0 0 0 2px var(--abyss); animation: gold-ping 2.2s ease-out infinite; }
  @keyframes gift-wiggle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-12deg) scale(1.08); } 90% { transform: rotate(10deg) scale(1.08); } 94% { transform: rotate(-6deg); } }
  @keyframes gold-ping { 0% { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 2px rgba(228, 185, 98, .7); } 70%, 100% { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 10px rgba(228, 185, 98, 0); } }

  /* ---- Contenedor: ventana modal y página --------------------------------- */
  dialog.daily { padding: 0; margin: auto; border: 0; background: transparent; color: var(--text); overflow: visible;
    width: min(1120px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); }
  dialog.daily::backdrop { background: radial-gradient(60% 60% at 50% 38%, rgba(27, 40, 80, .6), rgba(3, 6, 13, .9)); backdrop-filter: blur(7px); animation: backdrop-in .4s ease both; }
  dialog.daily[open] { animation: daily-in .6s var(--ease) both; }
  dialog.daily.is-closing { animation: daily-out .22s ease-in forwards; }
  dialog.daily.is-closing::backdrop { animation: backdrop-out .22s ease-in forwards; }
  html:has(dialog[open]) { overflow: hidden; }
  @keyframes daily-in { from { opacity: 0; transform: translateY(34px) scale(.94); } }
  @keyframes daily-out { to { opacity: 0; transform: translateY(14px) scale(.97); } }
  @keyframes backdrop-in { from { opacity: 0; } }
  @keyframes backdrop-out { to { opacity: 0; } }

  .daily-shell { position: relative; overflow: hidden; max-height: calc(100dvh - 24px); overflow-y: auto; padding: clamp(20px, 3vw, 34px);
    border: 1px solid var(--gold-line);
    background:
      radial-gradient(70% 55% at 50% -12%, rgba(228, 185, 98, .24), transparent 62%),
      linear-gradient(rgba(148, 180, 255, .045) 1px, transparent 1px) 0 0 / 100% 44px,
      linear-gradient(180deg, var(--plate-2), var(--deep) 70%);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), 0 0 80px -30px rgba(228, 185, 98, .35);
    clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
  .daily-inline { margin: 0 0 30px; }
  .daily-inline .daily-shell { max-height: none; overflow: hidden; }
  .daily-shell { transition: min-height .5s var(--ease); }
  .daily-shell.has-stage { min-height: min(580px, calc(100dvh - 24px)); }
  .daily-loading { display: grid; justify-items: center; gap: 22px; margin: 18px 0; }
  .daily-loading .sk-cards { width: 100%; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  @media (max-width: 760px) { .daily-loading .sk-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

  .daily-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: end; margin: 0 0 22px; padding-right: 44px; }
  .daily-inline .daily-head { padding-right: 0; }
  .daily-title { margin: 12px 0 8px; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.7rem); text-shadow: 0 2px 24px rgba(0, 0, 0, .7); }
  .daily-lede { margin: 0; max-width: 56ch; color: var(--text); font-size: var(--t-sm); }
  .daily-meta { display: flex; gap: 10px; }
  .daily-chip { min-width: 128px; padding: 10px 14px; border: 1px solid var(--line-strong); background: rgba(3, 6, 13, .5); }
  .daily-chip-label { display: block; font: 500 .62rem/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .daily-chip-value { display: block; margin-top: 4px; font: 600 1.55rem/1 var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; }
  .daily-close { position: absolute; top: -6px; right: -6px; width: 42px; height: 42px; min-height: 0; padding: 0; clip-path: none; font-size: 1rem;
    --b-bg: rgba(148, 180, 255, .1); --b-fg: var(--ice); --b-bg-h: rgba(148, 180, 255, .22); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .daily-close::after { display: none; }

  /* ---- Calendario ----------------------------------------------------------- */
  .daily-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; padding: 22px 0 10px; perspective: 1200px; }
  .daily-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0; padding: 14px 8px 12px; margin: 0;
    border: 1px solid var(--line-strong); color: var(--text); font: inherit; text-align: center; white-space: normal; overflow: hidden; cursor: pointer;
    background: linear-gradient(180deg, var(--plate-3), var(--plate) 70%, #0a1126);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .22s var(--ease), border-color .25s, box-shadow .25s, filter .3s;
    animation: card-in .75s var(--ease) both; animation-delay: calc(var(--i) * 75ms + 280ms); }
  .daily-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(90% 60% at 50% 18%, rgba(228, 185, 98, .26), transparent 70%); }
  .daily-card::after { content: ""; position: absolute; inset: 0; background: none; transform: none; transition: none; pointer-events: none; }
  .daily-card:hover { background: linear-gradient(180deg, var(--plate-3), var(--plate)); }
  .daily-card:hover::before { opacity: 1; }
  .daily-card:active { transform: scale(.965); }
  .daily-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  .no-intro .daily-card { animation: none; }
  @keyframes card-in { from { opacity: 0; transform: translateY(34px) rotateX(-18deg); } }

  .daily-day { font: 600 .7rem/1 var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
  .daily-art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; }
  .daily-piece { position: relative; grid-area: 1 / 1; width: 64%; transition: transform .4s var(--ease); }
  .daily-piece img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)); }
  .daily-art[data-count="2"] .daily-piece { width: 54%; }
  .daily-art[data-count="2"] .daily-piece:nth-child(1) { transform: translate(-30%, -8%); }
  .daily-art[data-count="2"] .daily-piece:nth-child(2) { transform: translate(30%, 10%); }
  .daily-qty { position: absolute; right: -6px; bottom: -4px; padding: 3px 7px; background: var(--gold-grad); color: var(--gold-ink);
    font: 700 .72rem/1 var(--f-mono); letter-spacing: .02em; box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
  .daily-name { min-height: 2.5em; font-size: .8rem; line-height: 1.25; color: var(--ice); font-weight: 600; text-wrap: balance; }
  .daily-seal { display: inline-grid; place-items: center; min-width: 74px; padding: 5px 9px; border: 1px solid var(--line-strong); background: rgba(3, 6, 13, .55);
    font: 600 .62rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

  .daily-card[data-status="today"] { border-color: var(--gold); transform: translateY(-8px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    box-shadow: 0 0 0 1px rgba(228, 185, 98, .35), 0 18px 40px -16px rgba(228, 185, 98, .55);
    background: radial-gradient(100% 70% at 50% 0%, rgba(228, 185, 98, .22), transparent 65%), linear-gradient(180deg, var(--plate-3), var(--plate)); }
  .daily-card[data-status="today"]::before { opacity: 1; animation: today-breathe 2.6s ease-in-out infinite; }
  .daily-card[data-status="today"] .daily-day { color: var(--gold-bright); }
  .daily-card[data-status="today"] .daily-art { animation: art-float 3.4s ease-in-out infinite; }
  .daily-card[data-status="today"] .daily-seal { background: var(--gold-grad); border-color: transparent; color: var(--gold-ink); }
  .daily-card[data-status="claimed"] { border-color: var(--gold-line); }
  .daily-card[data-status="claimed"] .daily-art { filter: saturate(.55) brightness(.72); }
  .daily-card[data-status="claimed"] .daily-seal { border-color: var(--gold-line); color: var(--gold); }
  .daily-card[data-status="claimed"] .daily-seal::before { content: "✓ "; }
  .daily-card[data-status="locked"] { opacity: .62; filter: saturate(.6); border-color: var(--line); cursor: not-allowed;
    background: repeating-linear-gradient(135deg, rgba(148, 180, 255, .05) 0 6px, transparent 6px 14px), linear-gradient(180deg, var(--plate-2), var(--plate)); }
  .daily-card.is-grand { border-color: var(--gold-line); }
  .daily-card.is-grand .daily-day::after { content: " · gran premio"; color: var(--gold); }
  .daily-card.is-grand[data-status="locked"]::before { opacity: .7; }
  .daily-card.just-claimed .daily-seal { animation: stamp .7s var(--ease) both; }
  .daily-card.is-nudge, .daily-claim.is-nudge { animation: nudge .45s ease both; }
  @keyframes today-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
  @keyframes art-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
  @keyframes nudge { 0%, 100% { translate: 0; } 20% { translate: -7px; } 40% { translate: 6px; } 60% { translate: -4px; } 80% { translate: 3px; } }
  @keyframes stamp { 0% { transform: scale(3) rotate(-14deg); opacity: 0; } 55% { transform: scale(.9) rotate(3deg); opacity: 1; } 100% { transform: none; } }

  .daily-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .daily-note { margin: 0; font-size: var(--t-sm); color: var(--text); min-height: 2.6em; }
  .daily-note[data-tone="warn"] { color: var(--warn); }
  .daily-note[data-tone="error"] { color: var(--bad); font-weight: 600; }
  .daily-note[data-tone="ok"] { color: var(--ok); }
  .daily-claim { position: relative; min-width: 260px; min-height: 60px; font-size: 1.05rem; --cut: 13px; }
  .daily-claim[aria-disabled="true"] { filter: grayscale(.7) brightness(.62); cursor: not-allowed; }
  .daily-claim.is-ready { animation: ready-glow 2.4s ease-in-out infinite; }
  @keyframes ready-glow { 0%, 100% { filter: drop-shadow(0 6px 14px rgba(228, 185, 98, .3)); } 50% { filter: drop-shadow(0 8px 30px rgba(228, 185, 98, .75)); } }
  @keyframes fx-spin { to { transform: rotate(360deg); } }
  .daily-error { padding: 30px 0; text-align: center; }

  /* ---- Escenario de revelado ------------------------------------------------- */
  .daily-stage { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 24px 20px; text-align: center; overflow: hidden; opacity: 0;
    background: radial-gradient(70% 70% at 50% 42%, rgba(14, 22, 48, .94), rgba(3, 6, 13, .985)); }
  .daily-stage.is-open { animation: stage-in .3s ease forwards; }
  .daily-stage.is-out { animation: stage-out .3s ease forwards; }
  @keyframes stage-in { to { opacity: 1; } }
  @keyframes stage-out { from { opacity: 1; } to { opacity: 0; } }
  .stage-rays { position: absolute; left: 50%; top: 44%; width: 1100px; height: 1100px; margin: -550px 0 0 -550px; pointer-events: none; opacity: .3;
    background: repeating-conic-gradient(from 0deg, rgba(228, 185, 98, .55) 0 2deg, transparent 2deg 12deg);
    -webkit-mask-image: radial-gradient(closest-side, #000, transparent 72%); mask-image: radial-gradient(closest-side, #000, transparent 72%);
    animation: fx-spin 40s linear infinite; }
  .stage-ring { position: absolute; left: 50%; top: 44%; width: 470px; height: 470px; margin: -235px 0 0 -235px; border-radius: 50%; pointer-events: none;
    border: 1px dashed rgba(228, 185, 98, .45); box-shadow: inset 0 0 70px rgba(228, 185, 98, .12), 0 0 70px rgba(228, 185, 98, .1); animation: fx-spin 36s linear infinite reverse; }
  .stage-eyebrow { position: relative; margin: 0; font: 600 .74rem/1 var(--f-title); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); opacity: 0; animation: fx-rise .45s .05s var(--ease) forwards; }
  .stage-title { position: relative; margin: 8px 0 22px; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3.2rem); opacity: 0; animation: fx-rise .5s .1s var(--ease) forwards;
    background: linear-gradient(100deg, #fff6d8 20%, #e4b962 45%, #fff6d8 60%, #e4b962 80%) 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: none; filter: drop-shadow(0 0 22px rgba(228, 185, 98, .45)); }
  .stage-title { animation: fx-rise .5s .1s var(--ease) forwards, shine-text 3.6s 1.2s linear infinite; }
  @keyframes shine-text { to { background-position: -220% 0; } }
  .stage-loot { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 3vw, 34px); margin: 0 0 18px; padding: 0; list-style: none; }
  .stage-piece { position: relative; width: clamp(96px, 14vw, 140px); display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0; transform: scale(.2) translateY(40px); }
  .stage-piece.is-in { animation: piece-pop .85s cubic-bezier(.2, 1.4, .4, 1) forwards; }
  .stage-piece img { width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .65)) drop-shadow(0 0 22px rgba(228, 185, 98, .35)); }
  .stage-piece.is-coin img { animation: coin-spin 1.4s .1s ease-out both; }
  .stage-qty { font: 700 clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem)/1 var(--f-display); font-variant-numeric: lining-nums tabular-nums;
    background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .stage-name { font-size: var(--t-sm); font-weight: 600; color: var(--ice); }
  @keyframes piece-pop { 0% { opacity: 0; transform: scale(.2) translateY(40px); } 60% { opacity: 1; transform: scale(1.12) translateY(-6px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
  @keyframes coin-spin { 0% { transform: rotateY(720deg) scale(.6); } 100% { transform: rotateY(0) scale(1); } }
  .stage-chest { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 14px; animation: fx-rise .6s var(--ease) both; }
  .stage-chest img { width: 84px; height: 84px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .6)); }
  .stage-chest.is-bump img { animation: bump .6s var(--ease); }
  @keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.28) rotate(-4deg); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
  .stage-dest, .stage-balance { margin: 0; max-width: 52ch; font-size: var(--t-sm); color: var(--text); text-wrap: balance; }
  .stage-balance strong { font: 600 1.35rem var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; }
  .stage-continue { position: relative; min-width: 220px; opacity: 0; }
  .stage-continue.is-in { animation: fx-rise .6s var(--ease) forwards; }
  @keyframes fx-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  /* Chispas */
  .daily-spark { position: absolute; z-index: 9; width: calc(9px * var(--s)); height: calc(9px * var(--s)); background: var(--h); pointer-events: none;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 4px var(--h)); animation: spark var(--d) cubic-bezier(.12, .7, .3, 1) forwards; }
  @keyframes spark { 0% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0) rotate(240deg); opacity: 0; } }

  @media (max-width: 900px) {
    .daily-head { grid-template-columns: 1fr; padding-right: 40px; }
    .daily-meta { flex-wrap: wrap; }
    .daily-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * clamp(20px, 3vw, 34px)); padding: 22px clamp(20px, 3vw, 34px) 12px; scrollbar-width: none; }
    .daily-track::-webkit-scrollbar { display: none; }
    .daily-card { flex: 0 0 clamp(142px, 34vw, 176px); scroll-snap-align: center; }
  }
  @media (max-width: 640px) {
    dialog.daily { width: 100vw; max-height: 100dvh; margin: auto 0 0; }
    dialog.daily .daily-shell { max-height: 100dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px); }
    .daily-lede { display: none; }
    .daily-foot { grid-template-columns: 1fr; }
    .daily-claim { width: 100%; }
    .daily-chip { min-width: 0; flex: 1; }
    .stage-ring { width: 320px; height: 320px; margin: -160px 0 0 -160px; }
    .stage-rays { width: 760px; height: 760px; margin: -380px 0 0 -380px; }
  }
}

/* ==========================================================================
   WCoinC · página de recarga y ceremonia de pago
   ========================================================================== */
@layer components {
  .coin-balance { display: flex; align-items: center; gap: 18px; margin: 0 0 26px; padding: 16px 20px; border: 1px solid var(--gold-line);
    background: radial-gradient(80% 140% at 0% 50%, rgba(228, 185, 98, .16), transparent 65%), rgba(3, 6, 13, .5); }
  .coin-balance img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); }
  .coin-balance-label { display: block; font: 500 .68rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .coin-balance strong { display: block; margin-top: 6px; font: 600 clamp(2rem, 1.5rem + 1.6vw, 3rem)/1 var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; }
  .coin-balance small { font: 600 .9rem var(--f-mono); color: var(--muted); letter-spacing: .08em; }

  .wcoin-packages { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; margin: 18px 0 14px; }
  .wcoin-package { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; overflow: hidden; padding-top: 22px;
    transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
  .wcoin-package::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .75;
    background: radial-gradient(70% 55% at 50% 30%, rgba(228, 185, 98, .22), transparent 70%); transition: opacity .3s; }
  .wcoin-package:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: var(--glow-gold); }
  .wcoin-package:hover::before { opacity: 1; }
  .wcoin-package img { position: relative; width: min(100%, 190px); height: 150px; object-fit: contain; margin-bottom: 6px;
    filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)); transition: transform .45s var(--ease); }
  .wcoin-package:hover img { transform: scale(1.08) translateY(-4px) rotate(-2deg); }
  .wcoin-package h3 { position: relative; margin: 0; font: 600 .95rem/1.2 var(--f-title); letter-spacing: .1em; text-transform: uppercase; color: var(--ice); }
  .wcoin-amount { position: relative; margin: 6px 0 0; font: 500 .9rem var(--f-mono); color: var(--muted); letter-spacing: .06em; }
  .wcoin-amount strong { display: block; font: 600 2.6rem/1 var(--f-display); letter-spacing: 0; color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; }
  .wcoin-price { position: relative; margin: 2px 0 14px; color: var(--text); font-weight: 600; }
  .wcoin-package button { position: relative; width: 100%; margin-top: auto; }
  .wcoin-package[data-tier="6"], .wcoin-package[data-tier="5"] { border-color: var(--gold-line); }

  /* Una vista por moneda: pestañas con la moneda y accesos a las demás pasarelas */
  .coin-tabs a { gap: 9px; }
  .coin-tabs a img { width: 22px; height: 22px; object-fit: contain; }
  .coin-tabs a svg { width: 18px; height: 18px; }
  .coin-view .coin-balance { max-width: 520px; }
  .coin-view h2 { margin-top: 8px; }
  .coin-others { margin-top: clamp(22px, 3vw, 34px); }
  .coin-others h2 { margin: 0 0 12px; font: 600 .78rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
  .coin-others-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
  .coin-other { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; padding: 14px 16px; min-height: 76px;
    border: 1px solid var(--line); background: rgba(3, 6, 13, .55); color: var(--text); text-decoration: none;
    transition: border-color .25s, background .25s, transform .25s var(--ease); }
  .coin-other:hover, .coin-other:focus-visible { border-color: var(--gold-line); background: rgba(228, 185, 98, .07); transform: translateY(-2px); text-decoration: none; }
  .coin-other img { width: 48px; height: 48px; object-fit: contain; }
  .coin-other strong { display: block; font: 600 .92rem/1.2 var(--f-title); letter-spacing: .06em; color: var(--ice); }
  .coin-other small { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; line-height: 1.3; }
  .coin-other b { font: 600 1.05rem/1 var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; }
  .coin-other-go { width: 18px; height: 18px; color: var(--gold); transition: transform .25s var(--ease); }
  .coin-other:hover .coin-other-go { transform: translateX(3px); }
  .coin-other-zen { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--gold-line); border-radius: 50%; color: var(--gold-bright); }
  .coin-other-zen svg { width: 24px; height: 24px; }
  .coin-other:has(.coin-other-zen) { grid-template-columns: 48px minmax(0, 1fr) 18px; }

  .pay-state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
    background: rgba(148, 180, 255, .1); color: var(--muted); white-space: nowrap; }
  .pay-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .pay-state[data-state="CREDITED"] { background: var(--ok-soft); color: var(--ok); }
  .pay-state[data-state="PAID_PENDING_CREDIT"] { background: var(--warn-soft); color: var(--warn); }
  .pay-state[data-state="DECLINED"], .pay-state[data-state="VOIDED"], .pay-state[data-state="ERROR"] { background: var(--bad-soft); color: var(--bad); }

  /* ---- Ceremonia ------------------------------------------------------------ */
  dialog.daily.pay { width: min(580px, calc(100vw - 24px)); }
  .pay-shell { padding: 44px clamp(20px, 5vw, 44px) 32px; text-align: center; }
  .pay-shell .stage-eyebrow { display: block; margin-top: 6px; }
  .pay-shell .stage-title { margin: 8px 0 14px; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); animation-delay: .2s, 1.2s; }
  .pay-shell .stage-rays { top: 120px; }
  .pay-shell .stage-ring { top: 120px; width: 380px; height: 380px; margin: -190px 0 0 -190px; }
  .pay-orb { position: relative; width: 170px; height: 170px; margin: 0 auto 28px; display: grid; place-items: center; }
  .pay-orb img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .6)) drop-shadow(0 0 26px rgba(228, 185, 98, .35)); }
  .pay-orb.is-credited img { animation: coin-drop 1.1s var(--ease) both; }
  .pay-orb.is-waiting img, .pay-orb.is-connected img { animation: orb-breathe 2.4s ease-in-out infinite; }
  .pay-orb.is-failed img { filter: grayscale(.9) brightness(.6) drop-shadow(0 12px 14px rgba(0, 0, 0, .6)); animation: nudge .6s ease both; }
  .pay-ring { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); overflow: visible; transform: rotate(-90deg); pointer-events: none; }
  .pay-ring circle { fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(228, 185, 98, .8)); }
  .pay-orb.is-credited .pay-ring circle { stroke-dasharray: 296; stroke-dashoffset: 296; animation: ring-draw 1.4s .35s var(--ease) forwards; }
  .pay-orb.is-waiting .pay-ring circle, .pay-orb.is-connected .pay-ring circle { stroke-dasharray: 18 14; animation: fx-spin 9s linear infinite; transform-origin: 50% 50%; stroke: var(--azure-bright); }
  .pay-orb.is-failed .pay-ring circle { stroke: var(--bad); stroke-dasharray: 296; filter: drop-shadow(0 0 6px rgba(255, 123, 144, .7)); }
  .pay-badge { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 1.05rem; font-weight: 700;
    background: var(--plate-3); border: 2px solid var(--line-strong); color: var(--azure-bright); box-shadow: 0 6px 14px rgba(0, 0, 0, .5); }
  .pay-orb.is-failed .pay-badge { background: #3a1019; border-color: var(--bad); color: var(--bad); }
  @keyframes coin-drop { 0% { transform: translateY(-160px) scale(.5) rotate(-18deg); opacity: 0; } 55% { transform: translateY(10px) scale(1.06); opacity: 1; } 75% { transform: translateY(-14px) scale(.98); } 100% { transform: none; opacity: 1; } }
  @keyframes ring-draw { to { stroke-dashoffset: 0; } }
  @keyframes orb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
  .pay-amount { position: relative; margin: 0; font: 500 1rem var(--f-mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
  .pay-amount strong { display: block; margin-bottom: 2px; font: 600 clamp(3rem, 2.2rem + 3vw, 4.4rem)/1 var(--f-display); letter-spacing: 0; text-transform: none; font-variant-numeric: lining-nums tabular-nums;
    background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(228, 185, 98, .45)); }
  .pay-detail { position: relative; max-width: 46ch; margin: 12px auto 0; font-size: var(--t-sm); color: var(--text); text-wrap: balance; }
  .pay-balance { position: relative; margin: 14px 0 0; font-size: var(--t-sm); color: var(--text); }
  .pay-balance strong { font: 600 1.5rem var(--f-display); color: var(--gold-bright); font-variant-numeric: lining-nums tabular-nums; }
  .pay-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 7px 14px; border: 1px solid rgba(243, 197, 82, .4); background: var(--warn-soft); color: var(--warn);
    font: 600 .72rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
  .pay-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: gold-ping 2s ease-out infinite; }
  .pay-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .pay-actions.is-hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
  .pay-shell[data-kind="failed"] .stage-title { background: linear-gradient(100deg, #ffd1d8, #ff7b90); -webkit-background-clip: text; background-clip: text; filter: none; animation: fx-rise .8s .2s var(--ease) forwards; }
  .pay-shell[data-kind="failed"] .stage-eyebrow { color: var(--bad); }
  .pay-shell[data-kind="waiting"] .stage-title, .pay-shell[data-kind="connected"] .stage-title { animation: fx-rise .8s .2s var(--ease) forwards, shine-text 5s 1.2s linear infinite; }

  .pay-fallback { max-width: 640px; margin-inline: auto; text-align: center; }
  .pay-fallback .pay-orb { margin-block: 8px 18px; }
  .pay-fallback h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
  .pay-fallback .actions { justify-content: center; margin-top: 20px; }
  .pay-orb > .seal { position: absolute; inset: -18px; width: auto; height: auto; }

  @media (max-width: 640px) {
    .pay-shell { padding-top: 40px; }
    .pay-orb { width: 140px; height: 140px; }
    .pay-actions .btn { flex: 1 1 100%; }
    .wcoin-package img { height: 120px; }
    .coin-balance img { width: 52px; height: 52px; }
  }
}

/* ---- Inicio: telemetría como capítulo propio ---- */
@layer pages {
  .chapter-telemetry { background: var(--abyss); }
  .chapter-telemetry::before { content: ""; position: absolute; z-index: -1; left: 0; top: 0; bottom: 0; width: min(46vw, 700px);
    background: url("art/boceto-941.webp") 50% 40% / cover no-repeat; opacity: .08; mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(270deg, transparent, #000 60%); mask-image: linear-gradient(270deg, transparent, #000 60%); }
  .chapter-telemetry .realm-grid { background: rgba(10, 16, 34, .72); backdrop-filter: blur(6px); box-shadow: var(--shadow-1); }
  .chapter-telemetry .realm-grid > div { padding: clamp(20px, 2.6vw, 30px) clamp(18px, 2.4vw, 28px); }
  .chapter-telemetry .realm-grid dd { font-size: clamp(2rem, 1.5rem + 1.6vw, 3.2rem); }
  .chapter-telemetry .chapter-head > .sync-indicator { align-self: end; }
  @media (max-width: 900px) { .chapter-telemetry .chapter-head > .sync-indicator { justify-self: start; } }
}

/* ==========================================================================
   Regalo diario · cofre de MU Libre
   ========================================================================== */
@layer components {
  .gift-button img { width: 34px; height: 34px; object-fit: contain; transform-origin: 50% 90%; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .5)); transition: transform .3s var(--ease); }
  .gift-button:hover img { transform: scale(1.14) rotate(-6deg); }
  .gift-button.has-gift img { animation: gift-wiggle 3.6s ease-in-out infinite; }

  /* Cabecera del calendario con el regalo */
  .daily-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .daily-hero { width: clamp(92px, 11vw, 132px); height: auto; margin: -8px 0 -14px -6px; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .6)) drop-shadow(0 0 28px rgba(228, 185, 98, .3));
    animation: gift-float 4.2s ease-in-out infinite; }
  .daily-hero.is-open { filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .6)) drop-shadow(0 0 34px rgba(228, 185, 98, .5)); }
  @keyframes gift-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
  .daily-close { grid-column: auto; }

  /* Escenario: título solo al abrir; cofre que tiembla y se abre */
  .daily-shell.has-stage { min-height: min(680px, calc(100dvh - 24px)); }
  .daily-stage { justify-content: safe center; overflow-y: auto; }
  .daily-stage .stage-title { opacity: 0; animation: none; margin: 6px 0 12px; }
  .daily-stage .stage-title.is-in { animation: fx-rise .8s var(--ease) forwards, shine-text 3.6s .8s linear infinite; }
  .daily-stage .stage-rays, .daily-stage .stage-ring { top: 62%; }
  .stage-loot { min-height: 168px; align-items: flex-end; margin: 0 0 6px; }
  .stage-piece { transform: none; opacity: 0; width: clamp(92px, 12vw, 128px); }
  .stage-piece.is-shown { opacity: 1; animation: none; }
  .stage-chest { margin: 0 0 12px; animation: none; }
  .stage-box { position: relative; width: clamp(150px, 20vw, 200px); aspect-ratio: 1; margin: 0 auto; }
  .stage-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .65)); transition: opacity .35s ease, transform .5s var(--ease); }
  .stage-box .box-open { opacity: 0; transform: scale(.82) translateY(14px); }
  .stage-box.is-opened .box-closed { opacity: 0; transform: scale(1.18) translateY(-10px); }
  .stage-box.is-opened .box-open { opacity: 1; transform: none; animation: chest-pop .7s var(--ease); }
  .stage-box.is-shaking .box-closed { animation: chest-shake .6s ease-in-out; }
  .stage-box.is-bump .box-open { animation: bump .6s var(--ease); }
  .stage-glow { position: absolute; inset: -30%; border-radius: 50%; opacity: 0; transition: opacity .5s;
    background: radial-gradient(closest-side, rgba(255, 210, 120, .55), rgba(228, 185, 98, .18) 55%, transparent 72%); }
  .stage-box.is-opened .stage-glow { opacity: 1; animation: glow-pulse 2.6s ease-in-out infinite; }
  .stage-box.is-shaking .stage-glow { opacity: .55; }
  .stage-flash { position: absolute; inset: -80%; pointer-events: none; opacity: 0; background: radial-gradient(closest-side, #fff, rgba(255, 224, 160, .8) 35%, transparent 70%); }
  .stage-box.is-opened .stage-flash { animation: flash .75s ease-out; }
  @keyframes chest-shake { 0%, 100% { transform: translate(0, 0) rotate(0); } 10% { transform: translate(-2px, 0) rotate(-2deg); } 20% { transform: translate(3px, -1px) rotate(2.5deg); } 30% { transform: translate(-4px, 0) rotate(-3deg); }
    40% { transform: translate(5px, -2px) rotate(3.5deg); } 50% { transform: translate(-6px, 0) rotate(-4deg); } 60% { transform: translate(7px, -2px) rotate(4.5deg); } 70% { transform: translate(-8px, 0) rotate(-5deg) scale(1.03); }
    80% { transform: translate(8px, -3px) rotate(5deg) scale(1.05); } 90% { transform: translate(-5px, 0) rotate(-3deg) scale(1.06); } }
  @keyframes chest-pop { 0% { transform: scale(.82) translateY(14px); } 55% { transform: scale(1.1) translateY(-6px); } 100% { transform: none; } }
  @keyframes glow-pulse { 0%, 100% { transform: scale(.94); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
  @keyframes flash { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
  .stage-dest { opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s var(--ease); }
  .is-labeled .stage-dest { opacity: 1; transform: none; }

  @media (max-width: 900px) { .daily-head { grid-template-columns: auto minmax(0, 1fr); } .daily-meta { grid-column: 1 / -1; } }
  @media (max-width: 640px) {
    .daily-hero { width: 76px; margin: -4px 0 0 -4px; }
    .daily-head { gap: 6px 12px; align-items: center; }
    .stage-loot { min-height: 140px; }
    .stage-box { width: 150px; }
  }
  @media (max-height: 760px) { .stage-loot { min-height: 130px; } .stage-piece { width: 92px; } .stage-box { width: 140px; } }
}

/* ---- Regalo diario · pulido estético (marco, riel de racha, sellos y gran premio) ---- */
@layer pages {
  /* Marco: esquinas de oro y un halo superior más cálido. */
  .daily-shell { box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(228, 185, 98, .08) inset, 0 0 90px -30px rgba(228, 185, 98, .4); }
  .daily-shell::before { content: ""; position: absolute; inset: 10px; pointer-events: none; z-index: 0; opacity: .85;
    --c: rgba(240, 205, 130, .75);
    background:
      linear-gradient(var(--c), var(--c)) left top / 34px 1px, linear-gradient(var(--c), var(--c)) left top / 1px 34px,
      linear-gradient(var(--c), var(--c)) right top / 34px 1px, linear-gradient(var(--c), var(--c)) right top / 1px 34px,
      linear-gradient(var(--c), var(--c)) left bottom / 34px 1px, linear-gradient(var(--c), var(--c)) left bottom / 1px 34px,
      linear-gradient(var(--c), var(--c)) right bottom / 34px 1px, linear-gradient(var(--c), var(--c)) right bottom / 1px 34px;
    background-repeat: no-repeat; }
  .daily-shell > :is(.daily-head, .daily-track, .daily-foot) { position: relative; z-index: 1; }
  .daily-hero { animation: hero-bob 4.2s ease-in-out infinite; }
  @keyframes hero-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
  .daily-title { letter-spacing: .01em; background: linear-gradient(180deg, #fff 30%, #d9e3ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 18px rgba(0, 0, 0, .6)); }

  /* Racha con segmentos */
  .daily-chip { position: relative; border-color: rgba(228, 185, 98, .28); background: linear-gradient(180deg, rgba(20, 30, 62, .7), rgba(3, 6, 13, .6));
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
  .daily-pips { display: flex; gap: 3px; margin-top: 8px; }
  .daily-pips i { flex: 1; height: 4px; background: rgba(148, 180, 255, .16); transform: skewX(-20deg); }
  .daily-pips i.is-on { background: var(--gold-grad); box-shadow: 0 0 8px rgba(228, 185, 98, .6); }

  /* Riel que une los siete días */
  .daily-track { position: relative; padding-top: 30px; --half: calc((100% - 72px) / 14); }
  .daily-track::before, .daily-track::after { content: ""; position: absolute; z-index: 0; top: 51px; left: var(--half); right: var(--half); height: 2px; pointer-events: none; }
  .daily-track > .daily-card { z-index: 1; }
  .daily-track::before { background: linear-gradient(90deg, rgba(148, 180, 255, .1), rgba(148, 180, 255, .22), rgba(148, 180, 255, .1)); }
  .daily-track::after { right: auto; width: calc((100% - 2 * var(--half)) * var(--reach, 0)); background: var(--gold-grad);
    box-shadow: 0 0 12px rgba(228, 185, 98, .7); transform-origin: left; animation: rail-fill 1.1s .55s var(--ease) both; }
  @keyframes rail-fill { from { transform: scaleX(0); } }

  /* Tarjetas */
  .daily-card { gap: 6px; padding: 16px 10px 14px; border-color: rgba(148, 180, 255, .2);
    background: radial-gradient(120% 60% at 50% 0%, rgba(78, 116, 220, .16), transparent 60%), linear-gradient(180deg, #16224a, #0d1530 72%, #0a1126); }
  .daily-card::after { inset: auto 0 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(148, 180, 255, .35), transparent); }
  .daily-node { width: 9px; height: 9px; transform: rotate(45deg); margin: -2px 0 2px; background: rgba(148, 180, 255, .25); box-shadow: 0 0 0 3px rgba(3, 6, 13, .6); }
  .daily-art::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(110, 150, 255, .22), transparent 75%); }
  .daily-art::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 6%; height: 10%; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); }
  .daily-piece { z-index: 1; }
  .daily-qty { clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
  .daily-art[data-count="2"] .daily-piece:nth-child(1) .daily-qty { right: auto; left: -6px; }
  .daily-name { color: #e8eeff; }
  .daily-seal { display: inline-flex; align-items: center; gap: 6px; min-width: 84px; justify-content: center;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }

  /* Reclamado: sello de oro sobre el objeto */
  .daily-card[data-status="claimed"] { border-color: rgba(228, 185, 98, .35);
    background: radial-gradient(120% 60% at 50% 0%, rgba(228, 185, 98, .1), transparent 60%), linear-gradient(180deg, #141d3c, #0b1229 72%, #090f22); }
  .daily-card[data-status="claimed"] .daily-node { background: var(--gold-grad); box-shadow: 0 0 0 3px rgba(3, 6, 13, .6), 0 0 10px rgba(228, 185, 98, .8); }
  .daily-card[data-status="claimed"] .daily-art { filter: saturate(.45) brightness(.6); }
  .daily-card[data-status="claimed"] .daily-name { color: var(--muted); }
  .daily-card[data-status="claimed"] .daily-seal::before { content: ""; width: 9px; height: 5px; margin-top: -3px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
  .daily-stamp { position: absolute; left: 50%; top: 36%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; pointer-events: none; z-index: 2;
    background: radial-gradient(circle, rgba(255, 236, 180, .95) 0 40%, rgba(228, 185, 98, .95) 41% 62%, rgba(150, 104, 30, .95) 63% 66%, transparent 67%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .55), 0 0 18px rgba(228, 185, 98, .45); transform: rotate(-12deg); }
  .daily-stamp::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 9px; margin: -7px 0 0 -9px; border: solid #3a2706; border-width: 0 0 3px 3px; transform: rotate(-45deg); }
  .daily-card.just-claimed .daily-stamp { animation: stamp .7s .2s var(--ease) both; }

  /* Hoy: borde de oro que respira y luz detrás del objeto */
  .daily-card[data-status="today"] { border-color: transparent;
    background: radial-gradient(110% 70% at 50% 8%, rgba(255, 210, 120, .3), transparent 62%), linear-gradient(180deg, #1d2c5c, #111a3a 70%, #0b1229);
    box-shadow: inset 0 0 0 1px rgba(255, 220, 150, .85), inset 0 0 26px rgba(228, 185, 98, .22), 0 18px 40px -16px rgba(228, 185, 98, .6); }
  .daily-card[data-status="today"] .daily-node { background: #fff3cf; box-shadow: 0 0 0 3px rgba(3, 6, 13, .6), 0 0 0 6px rgba(228, 185, 98, .35), 0 0 14px #ffd98a; animation: node-pulse 1.8s ease-in-out infinite; }
  .daily-card[data-status="today"] .daily-art::before { background: radial-gradient(closest-side, rgba(255, 214, 130, .55), rgba(228, 185, 98, .12) 55%, transparent 78%); animation: today-breathe 2.6s ease-in-out infinite; }
  .daily-card[data-status="today"] .daily-day { text-shadow: 0 0 12px rgba(228, 185, 98, .6); }
  @keyframes node-pulse { 50% { box-shadow: 0 0 0 3px rgba(3, 6, 13, .6), 0 0 0 9px rgba(228, 185, 98, 0), 0 0 22px #ffd98a; } }

  /* Bloqueado: sereno, sin rayas */
  .daily-card[data-status="locked"] { opacity: 1; filter: none; border-color: rgba(148, 180, 255, .1);
    background: linear-gradient(180deg, #111a38, #0a1027 72%, #080d1f); }
  .daily-card[data-status="locked"] .daily-art { filter: saturate(.35) brightness(.5); }
  .daily-card[data-status="locked"] .daily-day, .daily-card[data-status="locked"] .daily-name { color: rgba(170, 186, 230, .55); }
  .daily-card[data-status="locked"] .daily-seal { color: rgba(170, 186, 230, .55); border-color: rgba(148, 180, 255, .14); }
  .daily-card[data-status="locked"] .daily-seal::before { content: "·"; font-size: 1rem; line-height: 0; }
  .daily-card[data-status="locked"]:hover { background: linear-gradient(180deg, #14204a, #0b1229); }

  /* Día 7: gran premio */
  .daily-card.is-grand { border-color: rgba(228, 185, 98, .55); padding-top: 26px;
    background: radial-gradient(100% 60% at 50% 30%, rgba(228, 185, 98, .2), transparent 65%), linear-gradient(180deg, #23214a, #141633 70%, #0d0f26); }
  .daily-card.is-grand .daily-day::after { content: none; }
  .daily-card.is-grand .daily-art::before { inset: -6%; border-radius: 0; background: repeating-conic-gradient(from 0deg, rgba(255, 214, 130, .22) 0 4deg, transparent 4deg 18deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 72%); mask-image: radial-gradient(closest-side, #000 20%, transparent 72%); animation: fx-spin 24s linear infinite; }
  .daily-card.is-grand[data-status="locked"] .daily-art { filter: saturate(.75) brightness(.78); }
  .daily-card.is-grand[data-status="locked"] .daily-name { color: #e7d6ae; }
  .daily-ribbon { position: absolute; top: 0; left: 50%; translate: -50% 0; padding: 4px 12px 5px; white-space: nowrap; background: var(--gold-grad); color: var(--gold-ink);
    font: 700 .58rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 6px 100%); }

  /* Botón en espera: limpio en lugar de apagado */
  .daily-claim[aria-disabled="true"] { filter: none; --b-bg: linear-gradient(180deg, rgba(148, 180, 255, .1), rgba(148, 180, 255, .04)); --b-bg-h: var(--b-bg);
    --b-fg: #c9d4f2; box-shadow: inset 0 0 0 1px rgba(148, 180, 255, .28); }

  /* Revelado: pedestal de luz bajo cada pieza */
  .stage-piece::after { content: ""; order: -1; position: absolute; left: 8%; right: 8%; top: 62%; height: 18%; border-radius: 50%; z-index: -1; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 214, 130, .45), transparent); filter: blur(2px); }
  .stage-name { letter-spacing: .02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }

  @media (max-width: 900px) {
    .daily-track::before, .daily-track::after { display: none; }
    .daily-track { padding-top: 22px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .daily-hero, .daily-card.is-grand .daily-art::before, .daily-card[data-status="today"] .daily-node { animation: none; }
  }
}

/* ---- Confirmación de pago · pulido estético (recorrido, recibo, halo y acciones) ---- */
@layer pages {
  dialog.daily.pay { width: min(600px, calc(100vw - 24px)); }
  .pay-shell { padding: 46px clamp(22px, 5vw, 48px) 34px; }
  .pay-shell > .daily-close { position: absolute; top: 16px; right: 16px; z-index: 3; }
  .pay-shell .stage-eyebrow, .pay-shell .stage-title, .pay-amount, .pay-detail, .pay-steps, .pay-receipt, .pay-balance, .pay-chip, .pay-actions { position: relative; z-index: 1; }

  /* Halo y pedestal bajo las monedas */
  .pay-orb { margin-bottom: 22px; }
  .pay-orb::before { content: ""; position: absolute; inset: -22%; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 214, 130, .34), rgba(228, 185, 98, .1) 55%, transparent 76%); }
  .pay-orb::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -6%; height: 14%; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent); }
  .pay-orb img { z-index: 1; }
  .pay-orb.is-credited::before { animation: glow-pulse 2.8s ease-in-out infinite; }
  .pay-orb.is-waiting::before, .pay-orb.is-connected::before { background: radial-gradient(closest-side, rgba(110, 150, 255, .3), rgba(78, 116, 220, .08) 55%, transparent 76%); }
  .pay-orb.is-failed::before { background: radial-gradient(closest-side, rgba(255, 123, 144, .2), transparent 72%); }
  .pay-badge { z-index: 2; }
  .pay-orb.is-connected .pay-badge { background: #2a2208; border-color: var(--warn); color: var(--warn); font-size: .9rem; }

  /* Recorrido del pago */
  .pay-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; max-width: 440px; margin: 20px auto 4px; padding: 0; list-style: none; counter-reset: step; }
  .pay-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px;
    font: 600 .66rem/1.25 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(170, 186, 230, .55); counter-increment: step; }
  .pay-steps li::before { content: counter(step); position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px;
    border-radius: 50%; border: 1px solid rgba(148, 180, 255, .25); background: #0d1530; font: 700 .72rem/1 var(--f-mono); color: inherit; }
  .pay-steps li::after { content: ""; position: absolute; top: 13px; left: calc(50% + 20px); width: calc(100% - 40px); height: 2px; background: rgba(148, 180, 255, .16); }
  .pay-steps li:last-child::after { display: none; }
  .pay-steps li[data-step="done"] { color: var(--gold); }
  .pay-steps li[data-step="done"]::before { content: "✓"; background: var(--gold-grad); border-color: transparent; color: var(--gold-ink); box-shadow: 0 0 12px rgba(228, 185, 98, .55); }
  .pay-steps li[data-step="done"]::after { background: var(--gold-grad); box-shadow: 0 0 8px rgba(228, 185, 98, .5); }
  .pay-steps li[data-step="current"] { color: var(--ice); }
  .pay-steps li[data-step="current"]::before { border-color: var(--azure-bright); color: var(--azure-bright); animation: step-pulse 1.8s ease-in-out infinite; }
  .pay-steps li[data-step="blocked"] { color: var(--warn); }
  .pay-steps li[data-step="blocked"]::before { content: "!"; border-color: var(--warn); color: var(--warn); background: #241d08; animation: step-pulse-warn 1.8s ease-in-out infinite; }
  .pay-steps li[data-step="failed"] { color: var(--bad); }
  .pay-steps li[data-step="failed"]::before { content: "✕"; border-color: var(--bad); color: var(--bad); background: #2a0d14; }
  @keyframes step-pulse { 50% { box-shadow: 0 0 0 6px rgba(110, 150, 255, 0), 0 0 16px rgba(110, 150, 255, .6); } }
  @keyframes step-pulse-warn { 50% { box-shadow: 0 0 16px rgba(243, 197, 82, .55); } }

  /* Recibo */
  .pay-receipt { max-width: 400px; margin: 16px auto 0; padding: 4px 16px; border: 1px solid rgba(148, 180, 255, .16);
    background: linear-gradient(180deg, rgba(20, 30, 62, .55), rgba(3, 6, 13, .45));
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
  .pay-receipt div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 0; }
  .pay-receipt div + div { border-top: 1px dashed rgba(148, 180, 255, .16); }
  .pay-receipt dt { font: 500 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .pay-receipt dd { margin: 0; font-size: var(--t-sm); font-weight: 600; color: var(--ice); font-variant-numeric: tabular-nums; }
  .pay-receipt .is-ref dd { font: 500 .78rem/1.2 var(--f-mono); color: #c9d4f2; word-break: break-all; text-align: right; }
  .pay-detail { margin-top: 14px; color: #c9d4f2; }
  .pay-balance { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 16px; padding: 8px 16px; border: 1px solid rgba(228, 185, 98, .3); background: rgba(228, 185, 98, .07); }
  .pay-chip { clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
  .pay-shell[data-kind="failed"] .pay-receipt { border-color: rgba(255, 123, 144, .2); }
  .pay-actions .btn { min-width: 170px; }

  @media (max-width: 640px) {
    .pay-shell { padding: 40px 18px 26px; }
    .pay-steps li { font-size: .58rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    .pay-orb::before, .pay-steps li::before { animation: none; }
  }
}

/* ---- Personajes (retrato y hero), relojes del pie y badge de recompensas ------------------ */
@layer pages {
  [hidden] { display: none !important; }

  /* Hero: el boceto cubre todo el ancho y se desvanece por los cuatro bordes (antes terminaba en un corte recto). */
  .character-hero { grid-template-columns: clamp(150px, 22vw, 236px) minmax(0, 1fr); overflow: hidden; }
  .character-hero::before { inset: 0; opacity: .24; mix-blend-mode: screen;
    background: url("art/boceto-941.webp") 50% 28% / cover no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 22%, #000 64%, #000 88%, transparent), linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 22%, #000 64%, #000 88%, transparent), linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
    mask-composite: intersect; }

  /* Retrato: la imagen llena el marco circular (recortada al contorno, fondo transparente). */
  .portrait-frame { position: absolute; inset: 0; display: grid; }
  .portrait-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; mix-blend-mode: normal;
    transform: scale(1.06) translateY(3%); transform-origin: 50% 100%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
  .portrait-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 10px;
    background: radial-gradient(70% 70% at 50% 35%, #26407a, #0b1330 75%); color: var(--ice); }
  .portrait-fallback b { display: grid; place-items: center; width: 44%; aspect-ratio: 1; border-radius: 50%; font: 700 clamp(1.6rem, 4vw, 2.6rem)/1 var(--f-title);
    background: linear-gradient(180deg, #243a7a, #12214f); color: var(--gold-bright); box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(10, 18, 50, .4); }
  .portrait-fallback small { font: 600 .66rem/1.25 var(--f-title); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .portrait-fallback.is-static { position: static; width: 100%; height: 100%; }
  @media (max-width: 760px) {
    .character-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .character-hero .portrait { --size: min(210px, 62vw); }
    .character-overview { width: 100%; }
    .character-hero::before { background-position: 60% 20%; opacity: .2; }
  }

  /* Relojes del pie */
  .footer-clocks { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 22px); padding: 26px 0 8px; border-top: 1px solid var(--line); }
  .clock-card { --tone: #ef6a3b; position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon time" "icon meta"; align-items: center; column-gap: 16px; row-gap: 2px;
    padding: 16px clamp(16px, 2.4vw, 26px) 20px; overflow: hidden; isolation: isolate;
    background: radial-gradient(120% 140% at 0% 0%, rgba(239, 106, 59, .13), transparent 58%), linear-gradient(180deg, rgba(20, 30, 62, .78), rgba(5, 9, 20, .86));
    border: 1px solid rgba(239, 106, 59, .3); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    box-shadow: inset 0 1px 0 rgba(255, 220, 190, .06); transition: border-color .3s, transform .3s var(--ease); }
  .clock-card[data-clock="local"] { --tone: #e4b962; border-color: rgba(228, 185, 98, .34);
    background: radial-gradient(120% 140% at 0% 0%, rgba(228, 185, 98, .14), transparent 58%), linear-gradient(180deg, rgba(20, 30, 62, .78), rgba(5, 9, 20, .86)); }
  .clock-card:hover { border-color: var(--tone); transform: translateY(-2px); }
  .clock-icon { grid-area: icon; width: clamp(34px, 5vw, 46px); height: auto; aspect-ratio: 1; padding: 9px; fill: none; stroke: var(--tone); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
    border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); background: color-mix(in srgb, var(--tone) 10%, transparent); border-radius: 50%; box-sizing: content-box; }
  .clock-time { grid-area: time; display: flex; align-items: baseline; gap: 2px; font: 700 clamp(2.1rem, 1.3rem + 3.2vw, 3.3rem)/1 var(--f-display); color: var(--tone);
    font-variant-numeric: lining-nums tabular-nums; text-shadow: 0 0 22px color-mix(in srgb, var(--tone) 38%, transparent); }
  .clock-time small { margin-left: 6px; font: 600 clamp(.9rem, .7rem + .8vw, 1.25rem)/1 var(--f-mono); letter-spacing: .02em; color: color-mix(in srgb, var(--tone) 62%, #fff); opacity: .8; }
  .clock-colon { font-style: normal; padding: 0 1px; animation: clock-blink 1s steps(2, start) infinite; }
  .clock-meta { grid-area: meta; display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: var(--t-xs); color: var(--muted); }
  .clock-meta strong { font: 600 .74rem/1.3 var(--f-title); letter-spacing: .16em; text-transform: uppercase; color: var(--ice); }
  .clock-meta span { overflow-wrap: anywhere; }
  .clock-sweep { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(148, 180, 255, .1); }
  .clock-sweep i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, transparent, var(--tone)); box-shadow: 0 0 10px var(--tone); transition: width .9s linear; }
  .clock-card.is-night .clock-icon { box-shadow: 0 0 18px color-mix(in srgb, #7aa2ff 30%, transparent); }
  @keyframes clock-blink { 50% { opacity: .25; } }
  @media (max-width: 640px) { .footer-clocks { grid-template-columns: 1fr; } .clock-card { padding-block: 14px 18px; } }
  @media (prefers-reduced-motion: reduce) { .clock-colon { animation: none; } .clock-sweep i { transition: none; } }

  /* Badge numérico de recompensas por reclamar (no se muestra si no hay) */
  .count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 100px; font: 700 .7rem/1 var(--f-mono);
    color: #fff; background: linear-gradient(180deg, #ff8a52, #d9441f); box-shadow: 0 0 0 2px var(--abyss), 0 3px 10px rgba(217, 68, 31, .5); vertical-align: middle; animation: badge-pop .5s var(--ease) both; }
  .count-badge::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid rgba(255, 138, 82, .6); animation: badge-ring 2.4s ease-out infinite; pointer-events: none; }
  .count-badge { position: relative; }
  .gift-button .gift-badge { position: absolute; top: -5px; right: -5px; margin: 0; z-index: 2; }
  a > .count-badge { margin-left: 8px; }
  .account-dock a .count-badge, .tabbar a .count-badge { min-width: 18px; height: 18px; font-size: .64rem; }
  @keyframes badge-pop { from { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.2); } }
  @keyframes badge-ring { 0% { transform: scale(.9); opacity: .9; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .count-badge, .count-badge::after { animation: none; } }

  /* Recompensas: la forja de duendes como fondo del regalo diario (modal y página) */
  .daily-shell { background-image: radial-gradient(70% 55% at 50% -12%, rgba(228, 185, 98, .22), transparent 62%),
      linear-gradient(90deg, rgba(4, 8, 18, .55), rgba(4, 8, 18, .1) 60%), linear-gradient(180deg, rgba(4, 8, 18, .5) 0%, rgba(4, 8, 18, .76) 36%, rgba(4, 8, 18, .93) 100%), url("rewards/forja-1440.webp");
    background-size: auto, auto, auto, cover; background-position: center, center, center, 58% 22%; background-repeat: no-repeat; }
  .daily-head .daily-title, .daily-head .daily-lede { text-shadow: 0 2px 14px rgba(0, 0, 0, .85); }
  .daily-stage { background: radial-gradient(70% 70% at 50% 42%, rgba(10, 17, 38, .72), rgba(3, 6, 13, .95)); backdrop-filter: blur(3px); }
  .daily-card { backdrop-filter: blur(2px); }
  @media (max-width: 760px) {
    .daily-shell { background-image: radial-gradient(70% 45% at 50% -10%, rgba(228, 185, 98, .22), transparent 62%),
        linear-gradient(180deg, rgba(4, 8, 18, .5) 0%, rgba(4, 8, 18, .82) 30%, rgba(4, 8, 18, .95) 100%), url("rewards/forja-720.webp");
      background-size: auto, auto, cover; background-position: center, center, 62% 0%; }
  }
}


/* ==========================================================================
   Núcleo de interacción · v4
   Componentes de estado compartidos por todas las vistas: sello rúnico
   (carga), acción ocupada, toasts, tooltip, modal, skeleton, selector de
   personaje, hechos, medidor y elección. API en static/ui.js.
   ========================================================================== */
@layer components {
  /* ---- Sello rúnico: el indicador de carga del reino --------------------- */
  .seal { --seal: 44px; position: relative; display: inline-grid; grid-template: 100% / 100%; place-items: center; flex: none;
    width: var(--seal); height: var(--seal); color: var(--gold); vertical-align: middle; }
  .seal > svg { grid-area: 1 / 1; width: 100%; height: 100%; max-width: none; overflow: visible; }
  .seal::before { content: ""; grid-area: 1 / 1; width: 100%; height: 100%; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 62%, rgba(248, 226, 166, .05) 70%, rgba(248, 226, 166, .85) 99%, transparent 100%);
    -webkit-mask: radial-gradient(closest-side, transparent 74%, #000 76%, #000 98%, transparent 100%);
    mask: radial-gradient(closest-side, transparent 74%, #000 76%, #000 98%, transparent 100%);
    animation: seal-sweep 1.15s linear infinite; }
  .seal-runes { filter: drop-shadow(0 0 5px rgba(228, 185, 98, .45)); animation: seal-turn 7s linear infinite; }
  .seal-core { width: 36% !important; height: 36% !important; color: var(--gold-bright);
    filter: drop-shadow(0 0 8px rgba(248, 226, 166, .8)); animation: seal-core 1.6s ease-in-out infinite; }
  .seal--sm { --seal: 20px; }
  .seal--sm .seal-runes { filter: none; }
  .seal--lg { --seal: 96px; }
  .seal--ink { color: var(--gold-ink); }
  .seal--ink::before { background: conic-gradient(from 0deg, transparent 0 60%, rgba(29, 20, 4, .9) 99%, transparent 100%); }
  .seal--ink .seal-core { color: var(--gold-ink); filter: none; }
  @keyframes seal-turn { to { transform: rotate(360deg); } }
  @keyframes seal-sweep { to { transform: rotate(-360deg); } }
  @keyframes seal-core { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.74); opacity: .7; } }
  /* Navegación lenta: barra dorada bajo la cabecera y sello en la esquina. */
  .nav-loader { position: fixed; z-index: 92; inset: 0 0 auto; height: 0; pointer-events: none; }
  .nav-loader .seal { position: fixed; right: 18px; bottom: calc(18px + var(--tabbar-h, 0px)); opacity: 0; transition: opacity .25s; }
  .nav-loader-bar { position: fixed; top: var(--header-h); left: 0; width: 100%; height: 2px; opacity: 0; transition: opacity .25s;
    background: linear-gradient(90deg, transparent, var(--gold-bright), var(--gold), transparent) 0 0 / 40% 100% no-repeat;
    animation: nav-bar 1.1s ease-in-out infinite; }
  .is-navigating .nav-loader .seal, .is-navigating .nav-loader-bar { opacity: 1; }
  @keyframes nav-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
  @media (min-width: 761px) { .nav-loader .seal { bottom: 18px; } }
  .loading-block { display: grid; justify-items: center; gap: 14px; padding: 40px 16px; text-align: center;
    font: 600 .72rem/1.3 var(--f-title); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }

  /* Acción ocupada: el botón conserva su ancho y muestra el sello. */
  .is-busy { pointer-events: none; cursor: progress !important; }
  button.is-busy, .btn.is-busy { filter: saturate(.85) brightness(.96); }
  .is-busy > .seal { margin-right: 2px; }
  .btn-gold.is-busy > .seal, .buy-form button.is-busy > .seal { color: var(--gold-ink); }
  .btn-gold.is-busy > .seal::before { background: conic-gradient(from 0deg, transparent 0 60%, rgba(29, 20, 4, .9) 99%, transparent 100%); }
  .btn-gold.is-busy > .seal .seal-core { color: var(--gold-ink); filter: none; }
  [aria-busy="true"].busy-veil { position: relative; }
  [aria-busy="true"].busy-veil::after { content: ""; position: absolute; inset: 0; z-index: 3; background: rgba(7, 11, 24, .45); backdrop-filter: blur(1px); }

  /* ---- Skeleton: la forma del contenido mientras llega ------------------- */
  .skeleton, .sk-host:not(.is-loaded) { position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(100deg, rgba(148, 180, 255, .06) 30%, rgba(148, 180, 255, .17) 50%, rgba(148, 180, 255, .06) 70%) 0 0 / 260% 100%, var(--plate);
    animation: sk-shine 1.5s ease-in-out infinite; }
  .skeleton { display: block; color: transparent !important; -webkit-text-fill-color: transparent; border-radius: 2px; pointer-events: none; user-select: none; }
  .skeleton * { visibility: hidden; }
  .sk-line { height: .9em; width: var(--w, 100%); margin: .35em 0; }
  .sk-title { height: 1.4em; width: var(--w, 60%); margin: 0 0 .5em; }
  .sk-block { width: 100%; aspect-ratio: var(--ratio, 4 / 3); }
  .sk-circle { width: var(--d, 64px); aspect-ratio: 1; border-radius: 50%; }
  strong.skeleton, span.skeleton, dd > .skeleton { display: inline-block; min-width: 4ch; height: 1em; vertical-align: -.1em; }
  .sk-host:not(.is-loaded) > img { opacity: 0; }
  .sk-host > img { transition: opacity .35s var(--ease); }
  .sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
  .sk-cards > .skeleton { aspect-ratio: 3 / 4; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
  @keyframes sk-shine { from { background-position: 130% 0, 0 0; } to { background-position: -130% 0, 0 0; } }

  /* ---- Toasts: confirmación, error, advertencia, aviso -------------------- */
  .toast-region { position: fixed; z-index: 90; top: calc(var(--header-h) + 14px); right: max(14px, env(safe-area-inset-right));
    display: grid; gap: 10px; width: min(400px, calc(100vw - 28px)); pointer-events: none; }
  .toast { --tone: var(--azure-bright); --tone-soft: rgba(91, 135, 255, .16);
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
    padding: 14px 12px 16px 14px; pointer-events: auto; overflow: hidden; color: var(--text);
    border: 1px solid var(--line-strong); border-left: 0;
    background:
      linear-gradient(var(--tone), var(--tone)) left top / 3px 100% no-repeat,
      radial-gradient(120% 140% at 0% 0%, var(--tone-soft), transparent 55%),
      linear-gradient(180deg, rgba(27, 40, 80, .97), rgba(10, 16, 34, .98));
    box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .85), 0 0 0 1px rgba(3, 6, 13, .6);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    animation: toast-in .42s var(--ease) both; }
  .toast[data-tone="success"] { --tone: var(--ok); --tone-soft: rgba(79, 220, 159, .14); }
  .toast[data-tone="error"] { --tone: var(--bad); --tone-soft: rgba(255, 123, 144, .16); }
  .toast[data-tone="warning"] { --tone: var(--warn); --tone-soft: rgba(243, 197, 82, .15); }
  .toast.is-leaving { animation: toast-out .28s ease-in forwards; }
  .toast-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; color: var(--tone);
    background: rgba(3, 6, 13, .55); border: 1px solid color-mix(in srgb, var(--tone) 55%, transparent);
    clip-path: polygon(50% 0, 100% 25%, 100% 72%, 50% 100%, 0 72%, 0 25%); }
  .toast-icon svg { width: 18px; height: 18px; }
  .toast-title { margin: 1px 0 0; font: 600 .7rem/1.2 var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: var(--tone); }
  .toast-msg { grid-column: 2; margin: 0; font-size: .92rem; line-height: 1.45; color: var(--ice); overflow-wrap: anywhere; }
  .toast-action { grid-column: 2; justify-self: start; margin-top: 6px; font: 600 .8rem/1 var(--f-ui); color: var(--gold-bright); }
  .toast-close { grid-row: 1; grid-column: 3; width: 30px; height: 30px; min-height: 0; padding: 0; clip-path: none;
    --b-bg: transparent; --b-fg: var(--muted); --b-bg-h: rgba(148, 180, 255, .12); }
  .toast-close::after { display: none; }
  .toast-close svg { width: 14px; height: 14px; }
  .toast-timer { position: absolute; left: 3px; right: 0; bottom: 0; height: 2px; background: var(--tone); opacity: .7;
    transform-origin: left; animation: toast-timer var(--life, 5s) linear forwards; }
  .toast:hover .toast-timer, .toast:focus-within .toast-timer { animation-play-state: paused; }
  @keyframes toast-in { from { opacity: 0; transform: translateX(28px) scale(.97); } }
  @keyframes toast-out { to { opacity: 0; transform: translateX(28px); } }
  @keyframes toast-timer { to { transform: scaleX(0); } }
  @media (max-width: 760px) {
    .toast-region { left: 10px; right: 10px; width: auto; top: calc(var(--header-h) + 8px); }
  }

  /* ---- Tooltip: la explicación vive aquí, no en párrafos ------------------ */
  .help-tip { display: inline-grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; margin-left: 6px; vertical-align: middle;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); --b-bg: rgba(91, 135, 255, .22); --b-fg: var(--frost); --b-bg-h: var(--gold);
    border: 0; font: 600 .74rem/1 var(--f-mono); cursor: help; overflow: visible; }
  .help-tip::after { display: none; }
  .help-tip:hover, .help-tip:focus-visible, .help-tip[aria-expanded="true"] { color: var(--gold-ink); background: var(--gold); }
  .tooltip { position: fixed; z-index: 95; top: 0; left: 0; max-width: min(300px, calc(100vw - 20px)); padding: 10px 12px;
    font: 500 .84rem/1.45 var(--f-ui); color: var(--ice); text-align: left; text-wrap: pretty; pointer-events: none;
    background: linear-gradient(180deg, var(--plate-3), var(--plate)); border: 1px solid var(--gold-line);
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .85); opacity: 0; transform: translateY(4px); transition: opacity .14s ease, transform .14s ease; }
  .tooltip.is-on { opacity: 1; transform: none; }
  .tooltip::before { content: ""; position: absolute; left: var(--arrow, 50%); width: 9px; height: 9px; background: var(--plate-3);
    border: 1px solid var(--gold-line); transform: translateX(-50%) rotate(45deg); }
  .tooltip[data-side="top"]::before { bottom: -5px; border-top: 0; border-left: 0; background: var(--plate); }
  .tooltip[data-side="bottom"]::before { top: -5px; border-bottom: 0; border-right: 0; }
  .tip-host { display: inline-flex; }

  /* ---- Modal: confirmaciones y editores ---------------------------------- */
  dialog.modal { --tone: var(--gold); padding: 0; margin: auto; border: 0; background: transparent; color: var(--text); overflow: visible;
    width: min(560px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); }
  dialog.modal.modal--wide { width: min(880px, calc(100vw - 24px)); }
  dialog.modal::backdrop { background: radial-gradient(60% 60% at 50% 40%, rgba(27, 40, 80, .5), rgba(3, 6, 13, .88)); backdrop-filter: blur(5px); }
  dialog.modal[open] { animation: modal-in .32s var(--ease) both; }
  dialog.modal[data-tone="warning"] { --tone: var(--warn); }
  dialog.modal[data-tone="danger"], dialog.modal[data-tone="error"] { --tone: var(--bad); }
  dialog.modal[data-tone="success"] { --tone: var(--ok); }
  .modal-shell { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); border: 1px solid var(--line-strong);
    background: radial-gradient(90% 60% at 50% -10%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 60%), linear-gradient(180deg, var(--plate-2), var(--deep));
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
  .modal-shell::before { content: ""; display: block; height: 2px; flex: none; background: linear-gradient(90deg, transparent, var(--tone), transparent); }
  .modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
  .modal-head > :first-child { flex: 1; min-width: 0; }
  .modal-head h2 { margin: 0; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); }
  .modal-head .eyebrow { display: flex; margin-bottom: 6px; color: var(--tone); }
  .modal-close { width: 38px; height: 38px; min-height: 0; padding: 0; clip-path: none; --b-bg: rgba(148, 180, 255, .08); --b-fg: var(--text); --b-bg-h: rgba(148, 180, 255, .2); }
  .modal-close::after { display: none; }
  .modal-close svg { width: 16px; height: 16px; }
  .modal-body { padding: 4px 20px 18px; overflow-y: auto; min-height: 0; }
  .modal-body > p:last-child { margin-bottom: 0; }
  .modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
  @keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
  @media (max-width: 640px) {
    dialog.modal, dialog.modal.modal--wide { width: 100vw; margin: auto 0 0; max-height: 92dvh; }
    .modal-shell { max-height: 92dvh; clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%, 0 14px); padding-bottom: env(safe-area-inset-bottom); }
    .modal-foot > * { flex: 1 1 auto; }
  }

  /* ---- Etiquetas de estado (tonos) ---------------------------------------- */
  .status-pill[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
  .status-pill[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
  .status-pill[data-tone="bad"] { background: var(--bad-soft); color: var(--bad); }
  .status-pill[data-tone="info"] { background: rgba(91, 135, 255, .14); color: var(--azure-bright); }
  .status-pill[data-tone="gold"] { background: rgba(228, 185, 98, .12); color: var(--gold-bright); }
  .status-pill.offline, .status-pill[data-tone="muted"] { background: rgba(148, 180, 255, .08); color: var(--muted); }
  .status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

  /* ---- Estado de la cuenta y del personaje (account_state / character-state) ---
     Icono propio en lugar del punto; «vivo» (en el juego, OffAttack) late despacio. */
  .account-state, .character-state { gap: 8px; text-decoration: none; white-space: nowrap; }
  .account-state::before, .character-state::before { display: none; }
  .account-state > svg, .character-state > svg { width: 14px; height: 14px; flex: none; }
  .account-state[data-tone="gold"], .character-state[data-tone="gold"] { box-shadow: inset 0 0 0 1px rgba(228, 185, 98, .28); }
  a.account-state:hover, a.account-state:focus-visible { background: rgba(228, 185, 98, .2); color: var(--gold-bright); }
  .account-state:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  .picker > .character-state { flex: none; }
  @media (prefers-reduced-motion: no-preference) {
    .account-state.is-live > svg, .character-state.is-live > svg { animation: state-beat 2.4s ease-in-out infinite; }
  }
  @keyframes state-beat { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

  /* ---- Selector de personaje u origen ------------------------------------- */
  .picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 22px; padding: 12px 14px;
    background: rgba(10, 16, 34, .72); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .picker > label { font: 600 .7rem/1 var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
  .picker > select { flex: 1 1 260px; width: auto; max-width: 420px; }
  .picker > .picker-meta { margin-left: auto; font: 500 var(--t-xs)/1.3 var(--f-mono); color: var(--muted); }
  .picker > button, .picker > .btn { flex: none; }

  /* ---- Hechos: rejilla de clave/valor ------------------------------------- */
  /* Flex y no grid: la última fila se reparte el ancho, así nunca quedan celdas vacías. */
  .facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 0 0 16px; background: var(--line); border: 1px solid var(--line); }
  .facts > div { flex: 1 0 calc(100% / var(--cols, 4) - 1px); min-width: 0; padding: 10px 12px; background: rgba(3, 6, 13, .6); }
  .facts dt { font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 4px; }
  .facts dt .help-tip { width: 18px; height: 18px; margin-left: 2px; font-size: .62rem; }
  .facts dd { margin: 4px 0 0; font: 600 1.35rem/1.15 var(--f-display); color: var(--ice); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: break-word; }
  .facts dd.is-text { font: 600 .98rem/1.35 var(--f-ui); }
  .facts dd[data-tone="ok"] { color: var(--ok); }
  .profile-facts { margin: 0 0 24px; }
  .profile-facts dd { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.3rem); }
  .facts--2 { --cols: 2; } .facts--3 { --cols: 3; } .facts--5 { --cols: 5; } .facts--6 { --cols: 6; }
  @media (max-width: 1180px) { .facts--5, .facts--6 { --cols: 3; } }
  @media (max-width: 760px) { .facts { --cols: 2 !important; } }

  /* ---- Medidor (elemento <progress> nativo: sin estilos en la plantilla) ---- */
  progress.meter { display: block; width: 100%; height: 8px; margin: 12px 0 8px; border: 0; appearance: none; -webkit-appearance: none;
    background: rgba(148, 180, 255, .12); color: var(--gold); overflow: hidden; }
  progress.meter::-webkit-progress-bar { background: rgba(148, 180, 255, .12); }
  progress.meter::-webkit-progress-value { background: var(--gold-grad); box-shadow: 0 0 12px rgba(228, 185, 98, .6); transition: width .6s var(--ease); }
  progress.meter::-moz-progress-bar { background: var(--gold-grad); }

  /* ---- Nota en línea con tono ---------------------------------------------- */
  .note { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; font-size: .9rem; line-height: 1.45;
    border: 1px solid var(--line); border-left: 3px solid var(--azure); background: rgba(91, 135, 255, .08); color: var(--ice); }
  .note[data-tone="ok"] { border-left-color: var(--ok); background: var(--ok-soft); }
  .note[data-tone="warn"] { border-left-color: var(--warn); background: var(--warn-soft); color: #f6dfa0; }
  .note[data-tone="bad"] { border-left-color: var(--bad); background: var(--bad-soft); color: #ffc2cc; }
  .note > .help-tip { margin-left: auto; }
  .sync-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font: 500 var(--t-xs)/1.4 var(--f-mono); color: var(--muted); }
  .sync-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--azure-bright); flex: none; }
  .sync-line[data-tone="ok"]::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
  .sync-line[data-tone="warn"]::before { background: var(--warn); }
  .sync-line[data-tone="bad"]::before { background: var(--bad); }

  /* ---- Elección (tarjeta seleccionable con radio) -------------------------- */
  .choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; }
  .choice { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 12px; min-height: 68px;
    padding: 8px 12px 8px 8px; margin: 0; border: 1px solid var(--line); background: rgba(14, 22, 48, .7); color: var(--text); font: inherit;
    text-align: left; white-space: normal; cursor: pointer; clip-path: none; transition: border-color .15s, background-color .15s; }
  button.choice { --b-bg: rgba(14, 22, 48, .7); --b-fg: var(--text); --b-bg-h: rgba(27, 40, 80, .9); justify-content: start; }
  .choice::after { display: none; }
  .choice:hover { border-color: var(--azure-bright); }
  .choice:has(input:checked), .choice[aria-pressed="true"] { border-color: var(--gold); background: rgba(228, 185, 98, .1); }
  .choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
  .choice > input { position: absolute; opacity: 0; pointer-events: none; }
  .choice:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
  .choice strong { grid-column: 2; font-size: .92rem; line-height: 1.25; }
  .choice small { grid-column: 2; display: flex; align-items: center; gap: 6px; font: 500 .7rem/1.3 var(--f-mono); color: var(--muted); }
  .choice[data-compat]::before { content: ""; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
  .choice[data-compat="observed"]::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
  .choice[data-compat="unverified"]::before { background: var(--warn); }
  .choice[data-compat="reported_failure"]::before { background: var(--bad); }
  .choice.is-static { cursor: default; opacity: .8; }
  .legend-dots { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font: 500 var(--t-xs)/1.3 var(--f-mono); color: var(--muted); }
  .legend-dots span { display: inline-flex; align-items: center; gap: 6px; }
  .legend-dots span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--muted)); }

  /* ---- Icono de habilidad (sprites del cliente, celdas de 40×56) ---------- */
  .skill-icon { display: block; flex: none; width: 40px; height: 56px; background-color: var(--abyss); background-repeat: no-repeat;
    background-size: 512px 512px; border: 1px solid var(--line-strong); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); }
  .skill-icon[data-sheet="basic"] { background-image: url("skills/normal-basic.jpg"); }
  .skill-icon[data-sheet="extended"] { background-image: url("skills/normal-extended.jpg"); }
  .skill-icon[data-sheet="fighter"] { background-image: url("skills/normal-ragefighter.jpg"); }
  .skill-icon:not([data-sheet]) { background: repeating-linear-gradient(135deg, rgba(148, 180, 255, .06) 0 5px, transparent 5px 10px), var(--abyss); }

  /* ---- Retrato de clase: componente autocontenido -------------------------- */
  .portrait { position: relative; display: block; flex: none; width: var(--size, 96px); aspect-ratio: 1; overflow: hidden; isolation: isolate;
    border-radius: 50%; background: radial-gradient(70% 70% at 50% 35%, #26407a, #0b1330 75%);
    box-shadow: 0 0 0 2px var(--gold), 0 0 0 6px rgba(228, 185, 98, .14), var(--shadow-1); }
  .portrait--sm { --size: 64px; } .portrait--md { --size: 112px; } .portrait--lg { --size: clamp(130px, 17vw, 200px); }
  .portrait > .portrait-frame { position: absolute; inset: 0; }

  /* ---- Cabecera de personaje dentro de un panel (retrato, nombre, estados) ---- */
  .char-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; padding: 18px clamp(16px, 2.4vw, 26px);
    border-bottom: 1px solid var(--gold-line);
    background: radial-gradient(60% 140% at 0% 50%, rgba(228, 185, 98, .14), transparent 60%), linear-gradient(120deg, rgba(27, 40, 80, .8), rgba(10, 16, 34, .4)); }
  .char-head h2 { margin: 0; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); overflow-wrap: break-word; }
  .char-head p { margin: 4px 0 0; font: 600 .72rem/1.2 var(--f-title); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
  .char-head > .status-row { justify-content: flex-end; }
  @media (max-width: 900px) {
    .char-head { grid-template-columns: auto minmax(0, 1fr); }
    .char-head > .status-row { grid-column: 1 / -1; justify-content: flex-start; }
  }

  /* ---- Tabla apilable: en móvil cada fila es una ficha (sin desplazamiento lateral) ---- */
  @media (max-width: 640px) {
    .table-scroll:has(> .table-stack) { overflow: visible; }
    .table-scroll .table-stack { min-width: 0; }
    .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table-stack, .table-stack tbody { display: block; }
    .table-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
      padding: 14px 0; border-bottom: 1px solid var(--line); }
    .table-stack td { display: block; padding: 0; border: 0; }
    .table-stack td:first-child { grid-column: 1 / -1; }
    .table-stack td:not(:first-child):not(.cell-action) { grid-column: 1; font: 500 var(--t-xs)/1.4 var(--f-mono); letter-spacing: .06em; color: var(--muted); }
    .table-stack td.cell-action { grid-column: 2; grid-row: 2 / span 2; width: auto; }
  }

  /* ---- Estado vacío -------------------------------------------------------- */
  .empty-state { display: grid; justify-items: center; gap: 10px; }
  .empty-state::before { content: ""; width: 34px; height: 34px; background: var(--gold); opacity: .55; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    box-shadow: 0 0 20px var(--gold); }
  .empty-state > :last-child { margin-bottom: 0; }
  .choice-grid > .empty-state, .sk-cards > .empty-state { grid-column: 1 / -1; padding: 28px 16px !important; }

  @media (prefers-reduced-motion: reduce) {
    .seal::before, .seal-runes { animation: none; }
    .seal-core { animation: seal-core 2.4s ease-in-out infinite !important; animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
    .skeleton, .sk-host:not(.is-loaded) { animation: none; }
  }
}

/* ==========================================================================
   Vistas de entrenamiento: OffAttack y MU Helper (sobre el núcleo v4)
   ========================================================================== */
@layer pages {
  /* ---- Fondo de vista a pantalla completa (componente «wallpaper») ----
     Cada vista con arte propio declara --wall (escritorio, 16:9) y --wall-m (móvil, 9:16).
     Fijo en escritorio, desplazable en móvil; el velo garantiza la lectura de los paneles. */
  body.page-discord_market { --wall: url("wallpapers/discord-market-desktop.webp"); --wall-m: url("wallpapers/discord-market-mobile.webp");
    background-color: var(--night); background-image: linear-gradient(180deg, rgba(4, 9, 21, .55), rgba(4, 9, 21, .8) 55%, var(--night)), var(--wall);
    background-position: center center, center center; background-repeat: no-repeat, no-repeat; background-size: cover, cover; background-attachment: fixed, fixed; }
  body.page-discord_market .main-content::before { display: none; }
  @media (max-width: 760px) {
    body.page-discord_market { background-image: linear-gradient(180deg, rgba(4, 9, 21, .35), rgba(4, 9, 21, .62) 55%, var(--night) 98%), var(--wall-m);
      background-size: 100% 178vw, 100% auto; background-position: center top, center top; background-attachment: scroll, scroll; }
  }
  body.page-autofarm { --wall: url("wallpapers/offattack-desktop.webp"); --wall-m: url("wallpapers/offattack-mobile.webp"); }
  body.page-progression { --wall: url("wallpapers/mejorar-desktop.webp"); --wall-m: url("wallpapers/mejorar-mobile.webp"); }
  body.page-inventory_page { --wall: url("wallpapers/inventario-desktop.webp"); --wall-m: url("wallpapers/inventario-mobile.webp"); }
  body.view-pk { --wall: url("wallpapers/pk-desktop.webp"); --wall-m: url("wallpapers/pk-mobile.webp"); }
  body:is(.page-equipment_sets, .page-equipment_set_detail) { --wall: url("wallpapers/sets-desktop.webp"); --wall-m: url("wallpapers/sets-mobile.webp"); }
  body:is(.page-autofarm, .page-progression, .page-inventory_page, .view-pk, .page-equipment_sets, .page-equipment_set_detail) { background-color: var(--night);
    background-image: linear-gradient(180deg, rgba(4, 9, 21, .55), rgba(4, 9, 21, .8) 55%, var(--night)), var(--wall);
    background-position: center center, center center; background-repeat: no-repeat, no-repeat; background-size: cover, cover;
    background-attachment: fixed, fixed; }
  @media (max-width: 760px) {
    body:is(.page-autofarm, .page-progression, .page-inventory_page, .view-pk, .page-equipment_sets, .page-equipment_set_detail) {
      /* La ilustración 9:16 encaja al ancho (no al alto de toda la página) y se funde con la noche. */
      background-image: linear-gradient(180deg, rgba(4, 9, 21, .35), rgba(4, 9, 21, .62) 55%, var(--night) 98%), var(--wall-m);
      background-size: 100% 178vw, 100% auto; background-position: center top, center top; background-attachment: scroll, scroll; }
  }
  body:is(.page-autofarm, .page-progression, .page-inventory_page, .view-pk, .page-equipment_sets, .page-equipment_set_detail) .main-content::before { display: none; }
  /* Modal de reset: ilustración de fondo con velo; datos en rejilla alineada. */
  dialog.modal--reset { width: min(620px, calc(100vw - 24px)); }
  .modal--reset .modal-shell { background: linear-gradient(180deg, rgba(6, 11, 26, .55) 0%, rgba(6, 11, 26, .86) 42%, rgba(6, 11, 26, .96) 100%),
    url("wallpapers/reset-desktop.webp") 38% 18% / cover no-repeat, var(--deep); }
  .modal--reset .modal-head { min-height: 150px; align-items: flex-end; padding-top: 26px; }
  .modal--reset .modal-head h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }
  .modal--reset .modal-close { align-self: flex-start; }
  .modal--reset .modal-body { display: grid; gap: 14px; }
  .modal--reset .reset-facts { margin: 0; }
  .modal--reset .reset-facts > div { background: rgba(10, 16, 34, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .modal--reset .form-field, .modal--reset .check { margin: 0; }
  .modal--reset .modal-foot { border-top-color: rgba(255, 123, 144, .22); }
  @media (max-width: 640px) {
    .modal--reset .modal-shell { background-image: linear-gradient(180deg, rgba(6, 11, 26, .45) 0%, rgba(6, 11, 26, .88) 38%, rgba(6, 11, 26, .97) 100%),
      url("wallpapers/reset-mobile.webp"); background-position: center, center 12%; }
    .modal--reset .modal-head { min-height: 170px; }
    .modal--reset .reset-facts { --cols: 2; }
  }
  .page-mu_helper_page { --banner: url("art/guardian-1672.webp"); --banner-pos: 50% 36%; }
  @media (max-width: 900px) { .page-mu_helper_page { --banner: url("art/guardian-900.webp"); } }

  /* Encabezado del personaje dentro del panel */
  .af-panel, .mh-panel { padding: 0; overflow: hidden; background-color: rgba(10, 16, 34, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .af-block { margin: 0; padding: 18px clamp(16px, 2.4vw, 26px); border-bottom: 1px solid var(--line); }
  .af-block .facts { margin-bottom: 12px; }
  .af-block > .note:last-child, .af-block > .note:last-of-type { margin-bottom: 0; }
  .af-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
  .af-block-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .af-block[data-af-progress].is-empty :is(.facts, .meter) { display: none; }
  @media (max-width: 520px) { .af-block-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .af-block-actions > * { justify-content: center; padding-inline: 6px; } }
  .af-block-head h3 { display: flex; align-items: center; margin: 0 auto 0 0; font: 600 .82rem/1.2 var(--f-title); letter-spacing: .18em; text-transform: uppercase; color: var(--ice); }
  .af-sample { font: 500 var(--t-xs)/1.3 var(--f-mono); color: var(--muted); }
  .af-skill { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 0 0 14px; padding: 10px 12px;
    border: 1px solid var(--line); background: rgba(3, 6, 13, .45); }
  .af-skill strong { display: block; font-size: 1.05rem; }
  .af-label { display: block; font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
  .af-actions { padding: 18px clamp(16px, 2.4vw, 26px) 6px; }
  .af-actions .note { margin: 0; }
  .af-action-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
  .af-action-form .form-field { flex: 1 1 220px; max-width: 320px; }
  .af-action-form button[type="submit"] { flex: none; }
  .af-panel > .sync-line { margin: 0; padding: 10px clamp(16px, 2.4vw, 26px) 16px; }
  .af-search { margin: 0 0 14px; }
  .af-support { margin: 16px 0 0; }
  .af-support .choice-grid { margin-top: 8px; }
  .af-options { margin-top: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .af-reset-points { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line); background: rgba(3, 6, 13, .45); }
  .af-reset-points:disabled { opacity: .55; }
  .af-reset-points legend { padding: 0 6px; font: 500 var(--t-xs)/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .tone-ok { --tone: var(--ok); } .tone-warn { --tone: var(--warn); } .tone-bad { --tone: var(--bad); }
  @media (max-width: 640px) {
    .af-skill { grid-template-columns: auto minmax(0, 1fr); }
    .af-skill > .status-pill { grid-column: 2; justify-self: start; }
    .af-options { grid-template-columns: 1fr; }
    .af-action-form .form-field { max-width: none; }
    .af-action-form button[type="submit"] { width: 100%; }
  }
}

@layer pages {
  /* ---- MU Helper (web) ---- */
  .mh-panel { padding: 0; }
  .mh-panel > .note { margin: 16px clamp(16px, 2.4vw, 26px) 0; }
  .mh-panel > form, .mh-panel > form.mh-actions { padding: 0 clamp(16px, 2.4vw, 26px); }
  .mh-panel > form:last-child { padding-bottom: 22px; }
  .mh-tabs { margin: 18px 0 6px; }
  .mh-tabs > button { flex: 1; justify-content: center; }
  .mh-tabpanel { padding: 0; border: 0; }
  .mh-group { margin: 18px 0; }
  .mh-group h3 { margin: 0 0 12px; font: 600 .78rem/1.2 var(--f-title); letter-spacing: .18em; text-transform: uppercase; color: var(--ice); }
  .mh-grid { gap: 12px; }
  .mh-setting { padding: 12px; border: 1px solid var(--line); background: rgba(3, 6, 13, .4); }
  .mh-skill { display: flex; align-items: center; gap: 10px; }
  .mh-skill-btn { flex: 1; justify-content: flex-start; min-width: 0; white-space: normal; text-align: left; clip-path: none;
    --b-bg: rgba(14, 22, 48, .8); --b-fg: var(--ice); --b-bg-h: rgba(27, 40, 80, .95); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .mh-skill-btn::after { content: none; }
  .mh-help { margin: 10px 0 0; font-size: var(--t-sm); color: var(--muted); }
  .mh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 0; }
  .mh-more { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
  .mh-more .table-scroll table { min-width: 420px; }
  /* Barra de guardado: el aviso va encima, nunca entre botones; el dorado cierra a la derecha. */
  .mh-savebar { display: grid; gap: 12px; margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
  .mh-savebar .mh-actions { margin: 0; justify-content: flex-end; }
  .mh-save-note { margin: 0; font-size: var(--t-sm); }
  .mh-save-note svg { width: 16px; height: 16px; flex: none; }
  .mh-more > summary { display: flex; align-items: center; gap: 10px; }
  .mh-more > summary .status-pill { font-size: .66rem; padding: 4px 8px; }
  .mh-diff-wrap { margin-top: 14px; }
  .mh-diff td.mh-diff-draft { color: var(--gold-bright); }
  .mh-choices { max-height: min(52dvh, 460px); overflow: auto; margin-top: 12px; padding-right: 4px; }
  .mh-choices .choice { min-height: 64px; }
  @media (max-width: 640px) {
    .mh-actions > button { width: 100%; }
    .mh-savebar .mh-actions { flex-direction: column-reverse; }
  }
}


/* ==========================================================================
   Ranking v5 · arena competitiva (podio de pedestales + tabla de leyendas)
   ========================================================================== */
@layer components {
  /* Sello de clase: retrato recortado en círculo (miniaturas WebP 96/320 px). */
  .sigil { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--s, 44px); aspect-ratio: 1; border-radius: 50%;
    overflow: hidden; background: radial-gradient(70% 70% at 50% 35%, #26407a, #0b1330 75%); border: 1px solid var(--gold-line); }
  .sigil > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
  .sigil--96 { --s: 44px; }
  .sigil--320 { --s: clamp(96px, 12vw, 150px); }
  .sigil--emblem { background: var(--deep); }
  .sigil--emblem > img { width: 62%; height: 62%; object-fit: contain; image-rendering: pixelated; }
}

@layer pages {
  .rank-heading { align-items: center; }
  .rank-live { align-self: center; }

  /* Selector de categoría: segmentos tallados */
  .rank-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 clamp(28px, 4vw, 44px); }
  .rank-switch a { display: grid; place-items: center; min-height: 52px; padding: 0 10px; text-align: center;
    font: 600 .78rem/1.1 var(--f-title); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
    background: rgba(10, 16, 34, .72); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: color .2s, background .2s, border-color .2s; }
  .rank-switch a:hover { color: var(--ice); text-decoration: none; background: rgba(27, 40, 80, .8); }
  .rank-switch a[aria-current="page"] { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: var(--gold); }

  /* Podio: #2 · #1 · #3 sobre pedestales de distinta altura */
  .arena { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 22px); align-items: end;
    margin: 0 0 clamp(30px, 5vw, 56px); padding: clamp(10px, 3vw, 30px) clamp(0px, 2vw, 24px) 0;
    background: radial-gradient(60% 80% at 50% 100%, rgba(228, 185, 98, .14), transparent 70%); }
  .pedestal { --tone: #cfd8e8; --tone-soft: rgba(207, 216, 232, .16); --lift: 70px;
    position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
  .pedestal--1 { --tone: var(--gold-bright); --tone-soft: rgba(228, 185, 98, .22); --lift: 110px; }
  .pedestal--3 { --tone: #e0a06a; --tone-soft: rgba(224, 160, 106, .16); --lift: 44px; }
  .pedestal-figure { position: relative; margin-bottom: 8px; }
  .pedestal .sigil { border: 2px solid var(--tone); box-shadow: 0 0 0 6px var(--tone-soft), 0 18px 40px rgba(0, 0, 0, .55); }
  .pedestal--1 .sigil { --s: clamp(118px, 15vw, 190px); }
  .medal { position: absolute; right: -4px; bottom: -4px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px;
    font: 700 1.15rem/1 var(--f-display); color: #0b1020; background: var(--tone); border: 2px solid #0b1020;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
  .pedestal--1 .medal { width: 50px; height: 50px; font-size: 1.45rem; }
  .pedestal h2 { margin: 0; max-width: 100%; font: 600 clamp(.95rem, .8rem + .8vw, 1.35rem)/1.15 var(--f-title); letter-spacing: .06em;
    text-transform: uppercase; overflow-wrap: anywhere; }
  .pedestal h2 a { color: var(--ice); }
  .pedestal--1 h2 a { color: var(--gold-bright); }
  .pedestal p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
  .pedestal-stat { display: grid; justify-items: center; margin-top: 4px; font: 600 clamp(1.6rem, 1.1rem + 2vw, 2.6rem)/1 var(--f-display);
    color: var(--tone); font-variant-numeric: lining-nums tabular-nums; }
  .pedestal-stat small { margin-top: 5px; font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .pedestal-base { width: 100%; height: var(--lift); margin-top: 14px; border: 1px solid var(--line-strong); border-bottom: 0;
    background: linear-gradient(180deg, var(--tone-soft), rgba(10, 16, 34, .9) 70%); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
  .pedestal.is-empty { opacity: .55; }
  .pedestal.is-empty .sigil { border-style: dashed; box-shadow: none; }

  /* Tabla de leyendas */
  .board { padding: clamp(18px, 3vw, 30px); }
  .board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin: 0 0 18px; }
  .board-head h2 { margin: 0; }
  .board-count { font: 500 var(--t-sm) var(--f-mono); color: var(--muted); }
  .board-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; gap: 10px; align-items: center; margin: 0 0 18px; }
  .board-filters label { display: block; margin: 0; }
  .board-filters input, .board-filters select { width: 100%; margin: 0; }
  .ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .lb-row { display: grid; grid-template-columns: 46px auto minmax(0, 1fr) repeat(3, minmax(72px, 110px)); align-items: center; gap: 14px;
    padding: 10px 16px; background: rgba(3, 6, 13, .45); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
  .lb-row:hover { border-color: var(--line-strong); background: rgba(27, 40, 80, .45); }
  .lb-rank { font: italic 600 1.35rem/1 var(--f-display); color: var(--azure-bright); text-align: center; font-variant-numeric: lining-nums tabular-nums; }
  .lb-row--top { --tone: #cfd8e8; border-left: 3px solid var(--tone); background: linear-gradient(90deg, rgba(207, 216, 232, .08), rgba(3, 6, 13, .45) 40%); }
  .lb-row--1 { --tone: var(--gold-bright); background: linear-gradient(90deg, rgba(228, 185, 98, .14), rgba(3, 6, 13, .45) 45%); }
  .lb-row--3 { --tone: #e0a06a; }
  .lb-row--top .lb-rank { color: var(--tone); font-size: 1.6rem; }
  .lb-row--top .sigil { border-color: var(--tone); }
  .lb-name { display: grid; gap: 2px; min-width: 0; }
  .lb-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .lb-name-line > a { min-width: 0; font-weight: 650; color: var(--ice); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lb-row--1 .lb-name-line > a { color: var(--gold-bright); }
  .lb-name small { color: var(--muted); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lb-stat { display: grid; justify-items: end; gap: 3px; text-align: right; }
  .lb-stat b { font: 600 1.15rem/1 var(--f-display); color: var(--frost); font-variant-numeric: lining-nums tabular-nums; }
  .lb-stat b i { font-style: normal; font-size: .8em; color: var(--azure-bright); margin-left: 2px; }
  .lb-stat small { font: 500 .62rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .lb-stat--main b { font-size: 1.45rem; color: var(--gold-bright); }
  .lb-stat--text b { font: 600 var(--t-sm)/1.2 var(--f-ui); text-align: right; }
  .board-empty { display: grid; justify-items: center; gap: 10px; padding: clamp(30px, 6vw, 64px) 16px; text-align: center;
    background: radial-gradient(50% 60% at 50% 40%, rgba(91, 135, 255, .12), transparent 70%); border: 1px dashed var(--line-strong); }
  .board-empty img { width: 120px; height: auto; opacity: .9; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); }
  .board-empty h3 { margin: 6px 0 0; font: 600 1.3rem/1.2 var(--f-title); letter-spacing: .06em; text-transform: uppercase; }
  .board-empty p { margin: 0 0 8px; color: var(--muted); }

  @media (max-width: 900px) {
    .board-filters { grid-template-columns: 1fr 1fr; }
    .board-search { grid-column: 1 / -1; }
    .lb-row { grid-template-columns: 38px auto minmax(0, 1fr) repeat(2, minmax(60px, 90px)); }
    .lb-row > .lb-stat:nth-of-type(1):not(.lb-stat--main) { display: none; }
  }
  @media (max-width: 640px) {
    .rank-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .arena { gap: 6px; padding-inline: 0; }
    .pedestal { --lift: 42px; }
    .pedestal--1 { --lift: 70px; }
    .pedestal--3 { --lift: 26px; }
    .pedestal .sigil { --s: 76px; box-shadow: 0 0 0 4px var(--tone-soft); }
    .pedestal--1 .sigil { --s: 100px; }
    .medal { width: 30px; height: 30px; font-size: .95rem; }
    .pedestal--1 .medal { width: 36px; height: 36px; font-size: 1.1rem; }
    .pedestal p { display: none; }
    .lb-row { grid-template-columns: 30px auto minmax(0, 1fr) minmax(56px, auto); gap: 10px; padding: 10px 12px; }
    .lb-row > .lb-stat:not(.lb-stat--main) { display: none; }
  }
}

/* ---- Página de error (404/403/405/500): sello rúnico con el código ---- */
@layer pages {
  .page-none { --banner: url("art/asedio-1672.webp"); --banner-pos: 50% 40%; }
  @media (max-width: 900px) { .page-none { --banner: url("art/asedio-900.webp"); } }
  .lost { display: grid; justify-items: center; gap: 12px; max-width: 640px; margin: clamp(10px, 4vw, 40px) auto clamp(20px, 6vw, 60px); text-align: center; }
  .lost-mark { position: relative; display: grid; place-items: center; width: clamp(180px, 32vw, 260px); aspect-ratio: 1; margin-bottom: 10px; color: var(--gold); }
  .lost-runes { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 18px rgba(228, 185, 98, .35)); }
  .lost-mark span { font: 600 clamp(3.2rem, 2rem + 6vw, 5.4rem)/1 var(--f-display); letter-spacing: .04em; color: var(--gold-bright);
    text-shadow: 0 4px 30px rgba(0, 0, 0, .8); font-variant-numeric: lining-nums; }
  .lost h1 { margin: 0; font-size: var(--t-h2); }
  .lost p { margin: 0 0 10px; color: var(--text); max-width: 46ch; }
  .lost .action-bar { justify-content: center; }
  @media (prefers-reduced-motion: no-preference) {
    .lost-runes { animation: lost-turn 60s linear infinite; }
  }
  @keyframes lost-turn { to { transform: rotate(360deg); } }
}

/* ---- Documentos (legal, quiénes somos): índice lateral + lectura cómoda ---- */
@layer pages {
  .page-legal_page, .page-about { --banner: url("art/asedio-1672.webp"); --banner-pos: 50% 30%; }
  @media (max-width: 900px) { .page-legal_page, .page-about { --banner: url("art/asedio-900.webp"); } }
  .doc-date { font: 500 var(--t-sm) var(--f-mono); color: var(--muted); }
  .doc-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: start; }
  .doc-aside { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 18px; }
  .doc-toc, .doc-others { padding: 16px 18px; background: rgba(10, 16, 34, .72); border: 1px solid var(--line); }
  .doc-toc summary { cursor: pointer; font: 600 .72rem/1 var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); list-style: none; }
  .doc-toc summary::-webkit-details-marker { display: none; }
  .doc-toc nav, .doc-others { display: grid; gap: 2px; }
  .doc-toc nav { margin-top: 12px; }
  .doc-toc a, .doc-others a { padding: 6px 0; color: var(--text); font-size: var(--t-sm); }
  .doc-toc a:hover, .doc-others a:hover { color: var(--gold-bright); text-decoration: none; }
  .doc-others h2 { margin: 0 0 8px; font: 600 .72rem/1 var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
  .doc-others a[aria-current="page"] { color: var(--gold-bright); font-weight: 650; }
  .doc { padding: clamp(22px, 4vw, 48px); }
  .doc-intro { margin: 0 0 10px; font-size: var(--t-lg); color: var(--ice); max-width: 68ch; }
  .doc section { max-width: 72ch; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 20px); }
  .doc h2 { margin: 0 0 12px; font-size: var(--t-h3); }
  .doc p, .doc li { color: var(--text); line-height: 1.7; }
  .doc p { margin: 0 0 12px; }
  .doc ul { margin: 0 0 12px; padding-left: 22px; }
  .doc li { margin: 4px 0; }
  .doc li::marker { color: var(--gold); }
  @media (max-width: 900px) {
    .doc-layout { grid-template-columns: 1fr; }
    .doc-aside { position: static; }
    .doc-others { display: none; }
    .doc-toc:not([open]) nav { display: none; }
  }
  @media (min-width: 761px) and (max-width: 1180px) { .footer-main { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
}

/* ==========================================================================
   Misiones · lista de requisitos, cadena y cobro (componentes v5)
   ========================================================================== */
@layer components {
  /* Lista de comprobación: estado + requisito + solución. Reutilizable (misiones, reset). */
  .checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .checklist > li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
    min-height: 52px; padding: 8px 12px; background: rgba(3, 6, 13, .45); border: 1px solid var(--line); }
  .checklist > li:not(:has(.item-thumb)) { grid-template-columns: auto minmax(0, 1fr) auto; }
  .checklist .item-thumb { width: 44px; height: 44px; }
  .checklist .item-thumb:has(> img[hidden]) { visibility: hidden; }
  .check-label { display: grid; gap: 2px; min-width: 0; color: var(--ice); font-weight: 600; }
  .checklist .inline-buy { margin: 0; }
  .check-label small { font: 500 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .04em; color: var(--muted); }
  .check-mark { position: relative; display: grid; place-items: center; width: 26px; height: 26px; flex: none;
    border: 1px solid var(--line-strong); background: var(--abyss); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
  .check-mark::after { content: ""; width: 10px; height: 10px; background: var(--muted); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
  .check-mark[data-state="ok"] { border-color: var(--ok); background: rgba(79, 220, 159, .14); }
  .check-mark[data-state="ok"]::after { background: var(--ok); }
  .check-mark[data-state="missing"] { border-color: var(--warn); background: rgba(243, 197, 82, .12); }
  .check-mark[data-state="missing"]::after { background: var(--warn); }
  .checklist > li:has(.check-mark[data-state="ok"]) .check-label { color: var(--text); }

  .reward-row, .chip-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .reward-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: var(--t-sm); color: var(--frost);
    background: rgba(228, 185, 98, .08); border: 1px solid var(--gold-line); }
  .reward-chip b { color: var(--gold-bright); font-weight: 700; }
}

@layer pages {
  .page-quests_page { --banner: url("art/guardian-1672.webp"); --banner-pos: 50% 36%; }
  @media (max-width: 900px) { .page-quests_page { --banner: url("art/guardian-900.webp"); } }
  .progress-options:has(> .quest-card) { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .quest-card { display: grid; gap: 16px; padding: clamp(18px, 3vw, 28px); }
  .quest-card h2, .quest-others h2 { font-size: var(--t-h3); overflow-wrap: break-word; }
  .quest-card.is-current { border-color: var(--gold-line); box-shadow: 0 0 0 1px rgba(228, 185, 98, .12), var(--shadow-2); }
  .quest-card:not(.is-current) { opacity: .82; }
  .quest-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .quest-head h2 { margin: 6px 0 0; }
  .quest-checkout { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
  .quest-checkout .facts { margin: 0; }
  .quest-checkout dd.is-total { color: var(--gold-bright); }
  .quest-checkout .tip-host, .quest-checkout .btn-gold { width: 100%; }
  .reset-card { display: grid; gap: 14px; align-content: start; }
  .reset-card .facts { margin: 0; }
  .reset-more summary { cursor: pointer; font-size: var(--t-sm); color: var(--muted); }
  .reset-more .facts { margin-top: 10px; }
  .quest-others { display: grid; gap: 12px; padding: clamp(18px, 3vw, 28px); }
  .quest-others h2 { margin: 0; }

  /* Cadena de misiones: hecho · actual · bloqueado */
  .quest-path { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; text-align: left; }
  .quest-path li { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0 8px 2px; font-size: var(--t-sm); color: var(--muted); }
  .quest-path li::before { content: ""; flex: none; width: 12px; height: 12px; border: 1px solid var(--line-strong); background: var(--abyss); transform: rotate(45deg); z-index: 1; }
  .quest-path li:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 24px; bottom: -8px; width: 1px; background: var(--line-strong); }
  .quest-path li[data-state="done"] { color: var(--text); }
  .quest-path li[data-state="done"]::before { background: var(--ok); border-color: var(--ok); }
  .quest-path li[data-state="current"] { color: var(--gold-bright); font-weight: 650; }
  .quest-path li[data-state="current"]::before { background: var(--gold); border-color: var(--gold-bright); box-shadow: 0 0 12px var(--gold); }
  @media (max-width: 640px) {
    .checklist > li, .checklist > li:not(:has(.item-thumb)) { grid-template-columns: auto minmax(0, 1fr); }
    .checklist > li > .btn, .checklist > li > .status-pill { grid-column: 2; justify-self: start; }
    .checklist .item-thumb { display: none; }
  }
}

/* Gestión de personajes: navegación secundaria y operaciones independientes. */
@layer components {
}
@layer pages {
  .product-foot { display:grid; grid-template-columns:minmax(0,1fr); align-items:start; gap:8px; }
  .product-price { min-width:0; white-space:normal; overflow-wrap:anywhere; line-height:1.2; }
  .product-amount { display:block; }
  .product-cta { display:block; white-space:normal; text-align:center; padding:9px; border:1px solid var(--line-strong); background:rgba(148,180,255,.07); }
  .character-directory { display:grid; gap:14px; }
  .character-operation { padding:clamp(12px,2vw,24px); }
  .character-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
  .character-directory .status-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:10px 0 0; }
  .destination-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:10px; border:0; padding:0; }
  .destination-option { display:flex; align-items:center; gap:8px; padding:14px; border:1px solid var(--line); cursor:pointer; }
  .destination-option:has(input:checked) { border-color:var(--gold); background:rgba(228,185,98,.08); }
  .destination-option span { display:grid; gap:5px; }
  .destination-option small { color:var(--muted); }
  .destination-option[data-blocked] { cursor:not-allowed; }
  .destination-option[data-blocked] img { opacity:.45; filter:grayscale(.8); }
  .destination-option .destination-why { color:var(--warn); }
}

@layer pages {
  .product-currency { display:block; font:600 var(--t-sm)/1.35 var(--f-ui); }
  .destination-option { align-items:flex-start; min-width:0; }
  .destination-option span { min-width:0; flex:1; }
  .destination-map { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover; border:1px solid var(--line); }
  .destination-map[hidden] { display:none; }
  .product-media small[data-error-fallback] { padding:14px; color:var(--muted); text-align:center; }
}

@layer components {
  /* ---- Barra de filtros: búsqueda + campos clave, «Más filtros» plegable y chips de filtros activos ---- */
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .filter-bar { display: grid; gap: 14px; margin: 0 0 22px; padding: 16px; background: var(--plate-grad, var(--plate)); border: 1px solid var(--line); }
  .filter-main { display: grid; grid-template-columns: minmax(0, 1fr) repeat(auto-fit, minmax(170px, max-content)); gap: 12px; align-items: end; }
  .filter-search input { width: 100%; min-height: 48px; margin: 0; padding-left: 44px; font-size: var(--t-md);
    background: var(--abyss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394b4ff' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 15px center; }
  .filter-field { display: grid; gap: 6px; font: 600 var(--t-xs)/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .filter-field select, .filter-field input { margin: 0; min-height: 44px; font: 500 var(--t-sm)/1.2 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--text); }
  .filter-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .filter-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); cursor: pointer; color: var(--text); }
  .filter-toggle:has(input:checked) { border-color: var(--gold); color: var(--gold-bright); }
  .filter-toggle input { margin: 0; accent-color: var(--gold); }
  .filter-more { border-top: 1px solid var(--line); padding-top: 12px; }
  .filter-more > summary { cursor: pointer; width: max-content; font: 600 var(--t-sm)/1.2 var(--f-ui); color: var(--azure-bright); list-style: none; }
  .filter-more > summary::-webkit-details-marker { display: none; }
  .filter-more > summary::before { content: "+ "; color: var(--gold); }
  .filter-more[open] > summary::before { content: "− "; }
  .filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px 14px; margin-top: 12px; }
  .filter-active { display: flex; flex-wrap: wrap; gap: 8px; }
  .filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: 0; padding: 0 12px; clip-path: none;
    border: 1px solid var(--gold-line, var(--gold)); background: rgba(228, 185, 98, .08); color: var(--gold-bright); font: 600 var(--t-xs)/1 var(--f-ui); cursor: pointer; }
  .filter-chip::after { content: "×"; font-size: 1rem; line-height: 1; opacity: .8; }
  .filter-chip.is-clear { border-color: var(--line); background: transparent; color: var(--muted); }
  /* ---- Cambio en curso (MU.commit): velo que bloquea la página mientras el servidor guarda ---- */
  .commit-veil { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 14px;
    padding: 24px; text-align: center; background: rgba(4, 7, 16, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    animation: veil-in .25s var(--ease) both; cursor: progress; }
  .commit-veil-label { font: 700 var(--t-lg)/1.2 var(--f-title); letter-spacing: .08em; color: var(--gold-bright); text-shadow: 0 2px 18px rgba(0, 0, 0, .8); }
  .commit-veil small { color: var(--muted); font-size: var(--t-sm); }
  .is-committing .nav-loader { display: none; }
  @keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
  /* ---- Punto de aviso titilante (opciones destacadas de un menú) ---- */
  .pulse-dot { position: relative; display: inline-block; width: 8px; height: 8px; margin-left: 8px; vertical-align: middle;
    border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
  .pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok);
    opacity: 0; animation: pulse-ring 1.8s var(--ease) infinite; }
  @keyframes pulse-ring { 0% { transform: scale(.5); opacity: .9; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .pulse-dot::after { animation: none; } }
  .pulse-dot--end { flex: none; margin: 0 6px 0 auto; align-self: center; justify-self: end; }
  .dropdown-panel a:has(.pulse-dot--end) { grid-template-columns: 32px minmax(0, 1fr) auto; }
  /* ---- Tienda: barra común de objeto y conjunto (volver a resultados + buscador) ---- */
  .shop-tabs { margin-bottom: 18px; }
  .shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 0 0 24px; }
  .shop-back { gap: 8px; }
  .shop-back svg { width: 16px; height: 16px; transform: scaleX(-1); }
  .shop-search { display: flex; gap: 8px; align-items: center; flex: 0 1 420px; min-width: 0; margin: 0; }
  .shop-search .filter-search { flex: 1 1 auto; min-width: 0; }
  .shop-search .filter-search input { min-height: 44px; }
  .shop-search button { flex: none; margin: 0; min-height: 44px; }
  @media (max-width: 560px) {
    .shop-toolbar { flex-direction: column; align-items: stretch; }
    .shop-search { flex-basis: auto; }
    .shop-back { align-self: flex-start; }
  }
  .filter-chip.is-clear::after { content: none; }
  /* Facetas: chips seleccionables (radio) con contador; los vacíos se atenúan. */
  .facet-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
  .facet { position: relative; cursor: pointer; }
  .facet input { position: absolute; opacity: 0; pointer-events: none; }
  .facet span { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line);
    background: rgba(14, 22, 48, .7); color: var(--text); font: 600 var(--t-sm)/1 var(--f-ui); transition: border-color .15s, background-color .15s; }
  .facet b { font: 600 var(--t-xs)/1 var(--f-mono); color: var(--muted); }
  .facet:hover span { border-color: var(--azure-bright); }
  .facet input:checked + span { border-color: var(--gold); background: rgba(228, 185, 98, .12); color: var(--gold-bright); }
  .facet input:checked + span b { color: var(--gold); }
  .facet input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
  .facet.is-empty span { opacity: .45; cursor: not-allowed; }
  .pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 0; font: 500 var(--t-xs)/1 var(--f-mono); color: var(--muted); }
  #equipment-results[aria-busy="true"], #set-results[aria-busy="true"] { opacity: .55; transition: opacity .2s; }

  /* ---- Selector segmentado (dos o tres modos excluyentes) ---- */
  .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); margin: 0 0 16px; }
  .segmented label { position: relative; cursor: pointer; }
  .segmented input { position: absolute; opacity: 0; pointer-events: none; }
  .segmented span { display: grid; place-items: center; min-height: 42px; padding: 0 12px; font: 600 var(--t-sm)/1.1 var(--f-ui); color: var(--muted); text-align: center; }
  .segmented input:checked + span { background: rgba(228, 185, 98, .12); color: var(--gold-bright); box-shadow: inset 0 -2px 0 var(--gold); }
  .segmented input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }
  /* Variante de navegación: los segmentos son enlaces (filtros por URL). */
  .segmented > a { display: grid; place-items: center; min-height: 42px; padding: 0 14px; font: 600 var(--t-sm)/1.1 var(--f-ui); color: var(--muted); text-align: center; }
  .segmented > a:hover { color: var(--ice); text-decoration: none; background: rgba(148, 180, 255, .06); }
  .segmented > a[aria-current="page"] { background: rgba(228, 185, 98, .12); color: var(--gold-bright); box-shadow: inset 0 -2px 0 var(--gold); }
}

@layer pages {
  /* ---- Tienda: acceso a conjuntos ---- */
  .set-promo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: center; margin: 0 0 16px; padding: 16px 20px;
    border: 1px solid var(--gold-line, var(--gold)); background: linear-gradient(100deg, rgba(228, 185, 98, .14), rgba(14, 22, 48, .6) 60%); color: var(--text); text-decoration: none; }
  .set-promo .eyebrow { grid-column: 1; }
  .set-promo strong { grid-column: 1; font: 700 var(--t-lg)/1.2 var(--f-title); color: var(--ice); }
  .set-promo > span:not(.eyebrow):not(.set-promo-cta) { grid-column: 1; color: var(--muted); font-size: var(--t-sm); }
  .set-promo-cta { grid-column: 2; grid-row: 1 / span 3; color: var(--gold-bright); font-weight: 700; white-space: nowrap; }
  .set-promo:hover { border-color: var(--gold); text-decoration: none; }

  /* ---- Conjuntos: tarjetas con el personaje equipado ---- */
  .set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
  .set-card { display: flex; flex-direction: column; height: 100%; color: var(--text); text-decoration: none; background: var(--plate-grad, var(--plate));
    border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s, transform .25s; }
  .set-card:hover { border-color: var(--gold); box-shadow: var(--glow-gold, none); transform: translateY(-4px); text-decoration: none; }
  .set-card-media { position: relative; display: grid; place-items: end center; aspect-ratio: 3 / 4; overflow: hidden; border-bottom: 1px solid var(--line);
    background: radial-gradient(55% 45% at 50% 62%, rgba(91, 135, 255, .32), transparent 72%), radial-gradient(40% 8% at 50% 96%, rgba(0, 0, 0, .55), transparent), var(--abyss); }
  .set-card-media > img { width: 100%; height: 100%; object-fit: contain; }
  .set-card-media .status-pill { position: absolute; top: 10px; left: 10px; }
  .set-card-mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 16%; align-self: center; }
  .set-card-mosaic img { width: 100%; height: auto; }
  .set-card-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
  .set-card-name { font: 700 var(--t-lg)/1.15 var(--f-title); color: var(--ice); }
  .set-card-meta { font: 500 var(--t-xs)/1.3 var(--f-mono); color: var(--muted); }
  .set-card-pieces { display: flex; gap: 4px; }
  .set-card-pieces img { width: 36px; height: 36px; background: var(--abyss); border: 1px solid var(--line); }
  .set-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }

  /* ---- Conjunto: escenario (render y giro) + configuración ---- */
  .set-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
  .set-stage { position: sticky; top: calc(var(--header-h) + 16px); padding: 16px; }
  .set-viewer { position: relative; aspect-ratio: 3 / 4; height: min(68vh, 720px); max-width: 100%; margin: 0 auto; overflow: hidden; cursor: grab; touch-action: pan-y;
    background: radial-gradient(55% 45% at 50% 62%, rgba(91, 135, 255, .34), transparent 72%), radial-gradient(42% 7% at 50% 95%, rgba(0, 0, 0, .6), transparent), var(--abyss); }
  .set-viewer:active { cursor: grabbing; }
  .set-viewer > img { width: 100%; height: 100%; object-fit: contain; }
  .set-spin { position: absolute; inset: 0; background-repeat: no-repeat; background-size: 800% 100%; }
  .set-viewer-controls { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; }
  .set-pieces { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
  .set-pieces li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); }
  .set-pieces li > span:last-child { display: grid; gap: 2px; }
  .set-pieces small { font: 600 var(--t-xs)/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .set-pieces .item-thumb { width: 44px; height: 44px; }
  .set-pieces li.is-base { opacity: .6; }
  .set-config { display: grid; gap: 12px; padding: 20px; }
  .set-config h2 { margin: 0; font-size: var(--t-h3); }
  .set-config .form-field > span { display: inline-flex; align-items: center; gap: 8px; }
  .set-config fieldset.set-mode { margin: 0; padding: 0; border: 0; display: grid; gap: 14px; min-width: 0; }
  .set-config fieldset.set-mode > fieldset { margin: 0; }
  .set-piece { border: 1px solid var(--line); }
  .set-piece > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; font-weight: 600; }
  .set-piece > summary::-webkit-details-marker { display: none; }
  .set-piece[open] > summary { border-bottom: 1px solid var(--line); background: rgba(228, 185, 98, .06); }
  .set-piece > summary output { font: 500 var(--t-xs)/1 var(--f-mono); color: var(--gold); }
  .set-piece .item-thumb { width: 40px; height: 40px; }
  .set-piece-body { padding: 14px 14px 8px; }
  .set-total { margin: 4px 0 0; padding: 14px 16px; border: 1px solid var(--gold-line, var(--gold)); background: rgba(228, 185, 98, .07); }
  .set-total div { display: flex; align-items: baseline; justify-content: space-between; }
  .set-total dt { font: 600 var(--t-xs)/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .set-total dd { margin: 0; font: 700 var(--t-h3)/1 var(--f-display); color: var(--gold-bright); }
  .set-total small { font: 600 var(--t-xs)/1 var(--f-mono); color: var(--gold); }
  .set-config .btn-gold { width: 100%; justify-content: center; }
  @media (max-width: 900px) {
    .set-layout { grid-template-columns: minmax(0, 1fr); }
    .set-stage { position: static; }
    .set-promo { grid-template-columns: minmax(0, 1fr); }
    .set-promo-cta { grid-column: 1; grid-row: auto; }
    .filter-main { grid-template-columns: minmax(0, 1fr); }
  }
}

@layer components {
  /* ---- Contraseña con ojo (MU.revealPasswords): todo input[type=password] ---- */
  .pw-field { position: relative; display: block; }
  label > .pw-field { margin-top: 7px; }
  .pw-field > input { margin: 0; padding-right: 54px; }
  .pw-field > input[type="text"] { font-family: var(--f-mono); letter-spacing: .06em; }
  .pw-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 48px; min-height: 0; padding: 0; clip-path: none;
    --b-bg: transparent; --b-fg: var(--muted); --b-bg-h: rgba(148, 180, 255, .1); }
  .pw-toggle::after { display: none; }
  .pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--gold-bright); }
  .pw-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
  .pw-toggle svg { width: 20px; height: 20px; }

  /* ---- Contraseña recordada en el dispositivo (modal de reset) ---- */
  .saved-secret { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
    border: 1px solid var(--gold-line); background: linear-gradient(90deg, rgba(228, 185, 98, .1), rgba(3, 6, 13, .55) 70%); }
  .saved-secret > svg { width: 22px; height: 22px; flex: none; color: var(--gold); }
  .saved-secret-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .saved-secret-text strong { color: var(--ice); font-size: var(--t-sm); }
  .saved-secret-text small { color: var(--muted); font: 500 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
  .saved-secret .btn-secondary { min-height: 38px; padding: 0 14px; font-size: var(--t-sm); }

  /* ---- Proyección «así quedará» (vista previa del reset) ---- */
  .projection { margin-top: 18px; border: 1px solid var(--line-strong); background: rgba(3, 6, 13, .35); }
  .projection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(91, 135, 255, .12), transparent 70%); }
  .projection-head h4 { margin: 0; font: 600 .78rem/1.2 var(--f-title); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); }
  .projection .facts { margin: 0; }
  .projection .reset-more { padding: 10px 16px 14px; }

  /* ---- Desplegable con iconos (components/nav_menu.html) ---------------------
     <details>: funciona sin JS; el núcleo deja uno abierto y cierra fuera / Escape. */
  .dropdown { position: relative; }
  .dropdown-trigger { list-style: none; cursor: pointer; user-select: none; }
  .dropdown-trigger::-webkit-details-marker { display: none; }
  .dropdown-trigger::marker { content: ""; }
  .dropdown-trigger > svg { flex: none; width: 13px; height: 13px; transition: transform .2s var(--ease); }
  .dropdown[open] > .dropdown-trigger > svg { transform: rotate(180deg); }
  .dropdown-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: grid;
    width: min(340px, calc(100vw - 32px)); padding: 6px; background: var(--deep);
    border: 1px solid rgba(228, 185, 98, .55); box-shadow: var(--shadow-2); animation: pop-in .16s var(--ease); }
  .dropdown-panel a { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 14px;
    min-height: 56px; padding: 9px 12px; color: var(--ice); text-decoration: none; text-transform: none; letter-spacing: normal; }
  .dropdown-panel a + a { border-top: 1px solid var(--line); }
  .dropdown-panel a:hover, .dropdown-panel a:focus-visible { background: rgba(228, 185, 98, .08); text-decoration: none; outline: none; }
  .dropdown-panel a[aria-current="page"] { background: rgba(228, 185, 98, .12); box-shadow: inset 2px 0 var(--gold); }
  .dropdown-panel svg { width: 28px; height: 28px; color: var(--gold); }
  .dropdown-panel strong { display: block; font: 650 .95rem/1.2 var(--f-ui); }
  .dropdown-panel small { font-family: var(--f-ui); }
  .dropdown-panel small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--t-xs); line-height: 1.3; }

  /* «Monedas» en el menú de cuenta: panel más estrecho; en móvil ocupa todo el ancho. */
  .account-dock .dropdown-panel { width: min(300px, calc(100vw - 32px)); }
  @media (max-width: 520px) {
    .account-dock .dropdown { position: static; }
    .account-dock .dropdown-panel { left: 0; right: 0; width: auto; }
  }

  /* ---- Menú de personaje (todas las vistas de Mi cuenta · Personajes) -------
     Mis personajes · Progresión · Automatización (components/character_nav.html). */
  .character-nav { position: sticky; top: var(--header-h); z-index: 20; display: flex; align-items: stretch; gap: 2px;
    margin: 0 0 20px; border-bottom: 1px solid var(--line-strong);
    background: rgba(7, 11, 24, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .character-nav .character-nav-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
    padding: 0 18px; white-space: nowrap; color: var(--text); font: 600 .78rem/1.15 var(--f-title); letter-spacing: .12em; text-transform: uppercase; }
  .character-nav .character-nav-item:hover, .character-nav [open] > .character-nav-item { color: var(--ice); text-decoration: none; background: rgba(148, 180, 255, .07); }
  .character-nav .character-nav-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
  .character-nav .character-nav-item[aria-current="page"], .character-nav .character-nav-item.is-current { color: var(--gold-bright); }
  .character-nav .character-nav-item[aria-current="page"]::after, .character-nav .character-nav-item.is-current::after { content: ""; position: absolute;
    left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); box-shadow: 0 0 14px var(--gold); }
  @media (max-width: 640px) {
    /* Cada entrada con su ancho natural; el desplegable ocupa todo el ancho bajo la barra. */
    .character-nav { justify-content: space-between; gap: 0; }
    .character-nav > * { flex: 0 1 auto; min-width: 0; }
    .character-nav .dropdown { position: static; }
    .character-nav .character-nav-item { height: 100%; padding: 8px 7px; gap: 4px; white-space: normal; text-align: center;
      font-size: .66rem; letter-spacing: .04em; }
    .character-nav .character-nav-item > svg { width: 11px; height: 11px; }
    .character-nav .dropdown-panel { left: 0; right: 0; width: auto; top: calc(100% + 4px); }
  }
  @media (max-width: 359px) {
    .character-nav .character-nav-item { padding: 8px 5px; font-size: .6rem; letter-spacing: .02em; }
  }

  /* ---- Llegada a la zona de interés: destello breve en el panel enfocado ---- */
  [data-focus-target] { scroll-margin-top: calc(var(--header-h) + 72px); }
  .is-arrived { animation: arrive 1.1s var(--ease) 1; }
  @keyframes arrive { 0% { box-shadow: 0 0 0 0 rgba(228, 185, 98, .55); } 100% { box-shadow: 0 0 0 14px rgba(228, 185, 98, 0); } }
  @media (prefers-reduced-motion: reduce) { .is-arrived { animation: none; } }

  /* ---- Skeleton del contenido mientras se cambia de personaje o de pestaña ---- */
  .is-switching .character-directory, .is-switching .progress-layout, .is-switching [data-switch-body] { position: relative; pointer-events: none; }
  .is-switching .character-directory > *, .is-switching .progress-layout > *, .is-switching [data-switch-body] > * { opacity: .28; transition: opacity .2s; }
  .switch-veil { position: absolute; inset: 0; z-index: 5; display: grid; place-items: start center; padding-top: 72px; }
}

/* Spots de entrenamiento: mapa del juego y selección accesible compartida.
   Va en la capa pages porque .destination-grid (pages) fijaba dos columnas estrechas.
   Marcador y tarjeta llevan el mismo número para relacionar mapa y lista. */
@layer pages {
  .spot-terms { margin:0; }
  .spot-filter-bar { margin: 0; }
  .spot-filter-bar .filter-main { grid-template-columns: minmax(0, 1fr) minmax(190px, max-content) auto auto; }
  .spot-filter-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
  .spot-filter-foot .status-row { margin: 0; flex-wrap: wrap; }
  .spot-count { margin: 0; font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .06em; color: var(--muted); }
  @media (max-width: 900px) { .spot-filter-bar .filter-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .spot-filter-bar .filter-search { grid-column: 1 / -1; } }
  @media (max-width: 420px) { .spot-filter-bar .filter-main { grid-template-columns: minmax(0, 1fr); } }
  .spot-option .spot-occupancy, .spot-option .destination-why .status-pill { display:inline-flex; align-items:center; gap:7px; justify-self:start; max-width:100%; white-space:normal; overflow-wrap:anywhere; line-height:1.35; flex:none; }
  .spot-option .status-pill::before { flex:0 0 7px; }
  .spot-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
  .spot-map { width:100%; max-width:520px; aspect-ratio:1; display:block; border:1px solid var(--line-strong); background:var(--plate); }
  fieldset.spot-choices { grid-template-columns:minmax(0,1fr); gap:8px; min-width:0; }
  .spot-choices legend { font:600 .7rem/1 var(--f-title); letter-spacing:.2em; text-transform:uppercase; color:var(--gold); margin-bottom:8px; }
  .spot-option { position:relative; gap:12px; padding:10px 12px; }
  /* El número es el indicador visible; el radio sigue en el orden de teclado. */
  .spot-option > input { position:absolute; width:1px; height:1px; opacity:0; margin:0; }
  .spot-option:has(input:focus-visible) { outline:2px solid var(--gold); outline-offset:2px; }
  .spot-option > .spot-index { flex:0 0 28px; display:grid; place-items:center; width:28px; height:28px; border:1px solid var(--line-strong); border-radius:50%; font:700 .8rem/1 var(--f-mono); color:var(--ice); background:var(--plate); }
  .spot-option:has(input:checked) .spot-index { background:var(--gold); border-color:var(--gold); color:var(--gold-ink); }
  .spot-monster { flex:0 0 auto; width:64px; height:64px; object-fit:contain; border:1px solid var(--line); background:var(--plate); }
  .spot-text { display:grid; gap:4px; min-width:0; }
  .spot-text strong { color:var(--ice); font-size:var(--t-sm); overflow-wrap:anywhere; }
  .spot-text strong b { color:var(--gold-bright); font-weight:600; }
  .spot-text small { overflow-wrap:anywhere; }
  .spot-marker { cursor:pointer; outline:none; }
  .spot-marker circle { fill:var(--azure-bright); stroke:var(--deep); stroke-width:1.6; }
  .spot-marker text { fill:var(--deep); font:700 8.5px/1 var(--f-mono); text-anchor:middle; pointer-events:none; }
  .spot-marker[data-occupancy="free"] circle { fill:var(--ok); }
  .spot-marker[data-occupancy="shared"] circle { fill:var(--warn); }
  .spot-marker[data-occupancy="busy"] circle { fill:var(--bad); }
  .spot-marker[data-occupancy="unknown"] circle { fill:var(--muted); }
  /* El color dice la ocupación; el elegido se agranda con anillo claro (no se confunde
     con el amarillo de «compartido»). Bloqueado se atenúa, distinto de «sin información». */
  .spot-marker { transform-box:fill-box; transform-origin:center; transition:transform .15s ease; }
  .spot-marker[data-selected="true"] { transform:scale(1.35); }
  .spot-marker[data-selected="true"] circle { stroke:var(--ice); stroke-width:2.6; }
  .spot-marker[data-selected="true"] text { fill:var(--deep); }
  .spot-marker[data-available="false"] { cursor:not-allowed; opacity:.4; }
  .spot-marker:focus-visible circle { stroke:var(--ice); stroke-width:2.4; }
  .spot-actions { flex-wrap:wrap; align-items:center; }
  .spot-summary { flex:1 1 260px; margin:0; color:var(--muted); font-size:var(--t-sm); }
  .spot-summary strong { color:var(--ice); }
  @media (min-width:901px) {
    fieldset.spot-choices { max-height:clamp(360px,42vw,520px); overflow-y:auto; padding-right:6px; scrollbar-width:thin; }
  }
  @media (max-width:900px) {
    .spot-layout { grid-template-columns:minmax(0,1fr); gap:14px; }
    .spot-map { max-width:440px; margin-inline:auto; }
  }
  @media (max-width:420px) {
    .spot-option { gap:9px; padding:9px; }
    .spot-option > .spot-index { flex-basis:24px; width:24px; height:24px; font-size:.72rem; }
    .spot-monster { width:44px; height:44px; }
    .spot-actions > .btn-gold, .spot-actions > .btn { flex:1 1 100%; justify-content:center; }
  }
}

/* OffAttack: recogida automática (misma etiqueta de campo que la contraseña + casilla .check). */
@layer pages {
  .af-pickup { display:grid; gap:8px; min-width:0; }
  .af-pickup > .field-label { font-weight:600; font-size:.92rem; color:var(--ice); }
}

/* Trasladar personaje (ciudades y spots): arte propio con el mismo velo que las vistas con fondo. */
@layer pages {
  body.view-move { background-color: var(--night);
    background-image: linear-gradient(180deg, rgba(4, 9, 21, .5), rgba(4, 9, 21, .8) 55%, var(--night)), url("wallpapers/traslado-desktop.webp");
    background-position: center, center 35%; background-repeat: no-repeat; background-size: cover; background-attachment: fixed; }
  body.view-move .main-content::before { display: none; }
  @media (max-width: 760px) {
    body.view-move { background-image: linear-gradient(180deg, rgba(4, 9, 21, .35), rgba(4, 9, 21, .62) 55%, var(--night) 98%), url("wallpapers/traslado-mobile.webp");
      background-size: 100% 178vw, 100% auto; background-position: center top; background-attachment: scroll; }
  }
}

/* OffAttack · historial de recogida: totales a la izquierda, registro filtrable a la derecha. */
@layer pages {
  /* El historial comparte el arte de OffAttack. */
  body.page-autofarm_loot_history { background-color: var(--night);
    background-image: linear-gradient(180deg, rgba(4, 9, 21, .55), rgba(4, 9, 21, .8) 55%, var(--night)), url("wallpapers/offattack-desktop.webp");
    background-position: center; background-repeat: no-repeat; background-size: cover; background-attachment: fixed; }
  body.page-autofarm_loot_history .main-content::before { display: none; }
  @media (max-width: 760px) {
    body.page-autofarm_loot_history { background-image: linear-gradient(180deg, rgba(4, 9, 21, .35), rgba(4, 9, 21, .62) 55%, var(--night) 98%), url("wallpapers/offattack-mobile.webp");
      background-size: 100% 178vw, 100% auto; background-position: center top; background-attachment: scroll; }
  }
  .loot-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .loot-totals { position: sticky; top: calc(var(--header-h) + 16px); }
  .loot-totals h2, .loot-log h2 { margin: 0; font-size: var(--t-h3); }
  .loot-summary { display: grid; gap: 1px; margin: 14px 0 0; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); }
  .loot-summary li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; background: rgba(3, 6, 13, .6); }
  .loot-summary span { font-size: var(--t-sm); color: var(--text); }
  .loot-summary strong { font: 600 1.05rem/1.1 var(--f-display); color: var(--ice); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .loot-summary li.is-zen strong { color: var(--gold-bright); }
  .loot-log { padding: clamp(16px, 2.4vw, 26px); }
  .loot-log .section-head { margin-bottom: 16px; }
  .loot-filter { margin: 0; }
  @media (max-width: 900px) {
    .loot-layout { grid-template-columns: minmax(0, 1fr); }
    .loot-totals { position: static; }
    .loot-filter { width: 100%; }
  }
}

/* ==========================================================================
   Clanes: explorar, perfil, mi clan y fundar clan (componentes guild_*)
   ========================================================================== */
@layer pages {
  body:is(.page-guild_directory, .page-guild_mine, .page-guild_create, .page-public_guild) {
    --wall: url("wallpapers/clanes-desktop.webp"); --wall-m: url("wallpapers/clanes-mobile.webp"); background-color: var(--night);
    background-image: linear-gradient(180deg, rgba(4, 9, 21, .5), rgba(4, 9, 21, .82) 50%, var(--night)), var(--wall);
    background-position: center, center 30%; background-repeat: no-repeat; background-size: cover, cover; background-attachment: fixed, fixed; }
  body:is(.page-guild_directory, .page-guild_mine, .page-guild_create, .page-public_guild) .main-content::before { display: none; }
  @media (max-width: 760px) {
    body:is(.page-guild_directory, .page-guild_mine, .page-guild_create, .page-public_guild) {
      background-image: linear-gradient(180deg, rgba(4, 9, 21, .35), rgba(4, 9, 21, .66) 55%, var(--night) 98%), var(--wall-m);
      background-size: 100% 178vw, 100% auto; background-position: center top, center top; background-attachment: scroll, scroll; }
  }

  /* Emblema: píxeles del juego ampliados sin suavizado sobre un damero discreto. */
  .guild-crest { display: grid; place-items: center; flex: none; width: var(--crest, 64px); aspect-ratio: 1; padding: 4px;
    background: repeating-conic-gradient(rgba(148, 180, 255, .08) 0 25%, transparent 0 50%) 0 0 / 12px 12px, var(--abyss);
    border: 1px solid var(--gold-line); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 6px 20px rgba(0, 0, 0, .45); }
  .guild-crest > img { width: 100%; height: 100%; image-rendering: pixelated; }
  .guild-crest--sm { --crest: 40px; padding: 2px; } .guild-crest--md { --crest: 64px; } .guild-crest--lg { --crest: 112px; padding: 6px; }

  .guild-tabs, .guild-sections { margin-bottom: 22px; }
  .guild-sections { margin-top: 6px; }
  .guild-section .section-head h2 { font-size: var(--t-h3); }

  /* Explorar: tarjetas en rejilla; toda la tarjeta es el enlace. */
  .guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
  .guild-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; align-items: center; height: 100%;
    padding: 18px; color: var(--text); background: var(--plate-grad, var(--plate)); border: 1px solid var(--line);
    transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
  .guild-card:hover { text-decoration: none; border-color: var(--gold-line); transform: translateY(-2px); box-shadow: var(--shadow-2); }
  .guild-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  .guild-card-rank { position: absolute; top: 10px; right: 12px; font: 600 var(--t-xs)/1 var(--f-mono); letter-spacing: .08em; color: var(--muted); }
  .guild-card-body { display: grid; gap: 6px; justify-items: start; min-width: 0; }
  .guild-card-body strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 var(--t-lg)/1.15 var(--f-title); letter-spacing: .04em; color: var(--ice); }
  .guild-card:hover .guild-card-body strong { color: var(--gold-bright); }
  .guild-card-body small { font-size: var(--t-sm); color: var(--muted); }
  .guild-card-stats { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); }
  .guild-card-stats > div { padding: 8px 12px; background: rgba(3, 6, 13, .6); }
  .guild-card-stats dt { font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .guild-card-stats dd { margin: 3px 0 0; font: 600 1.15rem/1.1 var(--f-display); color: var(--ice); font-variant-numeric: tabular-nums; }

  /* Perfil y cabecera con emblema. */
  .guild-heading { align-items: center; justify-content: flex-start; gap: 18px 24px; }
  .guild-heading > .guild-crest { margin-top: 16px; }
  .guild-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .guild-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
  .guild-side h2, .guild-main h2 { margin: 0 0 14px; font-size: var(--t-h3); }
  .guild-notice { margin: 0; padding: 10px 14px; border-left: 2px solid var(--gold); background: rgba(228, 185, 98, .06); color: var(--text);
    font-size: var(--t-sm); line-height: 1.5; overflow-wrap: anywhere; }
  .guild-join .form-stack { gap: 14px; margin-top: 14px; }
  .guild-join .btn-gold { width: 100%; justify-content: center; }

  /* Integrantes: nombre con clase debajo. */
  .guild-roster td:first-child { display: grid; gap: 2px; }
  .guild-roster-name { font-weight: 700; color: var(--ice); }
  .guild-roster td small { font-size: var(--t-xs); color: var(--muted); }

  /* Mi clan. */
  .guild-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 380px); gap: 18px 24px; align-items: center; margin: 0 0 20px; padding: 20px; }
  .guild-banner-main { display: grid; gap: 8px; justify-items: start; min-width: 0; }
  .guild-banner-main h2 { margin: 0; font-size: var(--t-h2); }
  .guild-banner-main h2 a { color: var(--ice); }
  .guild-banner-main h2 a:hover { color: var(--gold-bright); text-decoration: none; }
  .guild-banner-facts { margin: 0; }
  .guild-section { padding: clamp(16px, 2.4vw, 26px); }
  .guild-section h3 { margin: 22px 0 12px; font-size: var(--t-md); }
  .guild-empty { display: grid; gap: 10px; justify-items: start; padding: 8px 0; }
  .guild-empty h2, .guild-empty p { margin: 0; }
  .guild-invite { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); background: rgba(3, 6, 13, .4); }
  .guild-invite .form-field { flex: 1 1 220px; max-width: 320px; }
  .guild-admin { max-width: 560px; }
  .guild-section .cell-action .action-bar { flex-wrap: nowrap; justify-content: flex-end; gap: 8px; margin: 0; }
  .guild-section .cell-action form { margin: 0; }
  @media (max-width: 640px) {
    .guild-section .table-stack td.cell-action { grid-column: 1 / -1; grid-row: auto; padding-top: 6px; }
    .guild-section .cell-action .action-bar { justify-content: flex-start; }
  }
  .guild-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
  .guild-levels li { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(3, 6, 13, .5); }
  .guild-levels li span { font: 500 var(--t-xs)/1.2 var(--f-mono); color: var(--muted); }
  .guild-levels li.is-done { border-color: var(--gold-line); background: rgba(228, 185, 98, .08); }
  .guild-levels li.is-done strong { color: var(--gold-bright); }
  tr.is-muted td { opacity: .6; }
  .guild-vault { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
  .guild-vault li { display: flex; align-items: center; gap: 12px; padding: 10px; }
  .guild-vault li > span:last-child { display: grid; gap: 2px; min-width: 0; }
  .guild-vault small { font-size: var(--t-xs); color: var(--muted); }

  /* Fundar clan: datos y emblema a la izquierda, requisitos fijos a la derecha. */
  .guild-create { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 20px; align-items: start; }
  .guild-create-main { display: grid; gap: 18px; min-width: 0; }
  .guild-create-main fieldset { margin: 0; }
  .guild-create-side { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
  .guild-create-side h2 { margin: 0; font-size: var(--t-h3); }
  .guild-create-side .facts { margin: 0; }
  .guild-create-side :is(.btn-gold, .btn-secondary) { width: 100%; justify-content: center; }
  .guild-confirm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px 22px; align-items: end; margin: 0 0 22px;
    border-color: var(--gold); box-shadow: var(--glow-gold); }
  .guild-confirm-head { display: grid; gap: 8px; justify-items: start; align-self: start; }
  .guild-confirm > .note, .guild-confirm > button { grid-column: 1 / -1; }
  .guild-confirm > button { justify-self: start; min-width: 220px; }
  @media (max-width: 720px) { .guild-confirm { grid-template-columns: minmax(0, 1fr); } .guild-confirm > button { width: 100%; } }
  .guild-confirm h2 { margin: 0; font-size: var(--t-h3); }
  .guild-confirm-fields { display: grid; gap: 12px; }
  .guild-confirm .note { margin: 0; }
  .guild-confirm .btn-gold { justify-self: start; }
  .guild-checklist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: var(--t-sm); color: var(--text); }
  .guild-checklist li { display: flex; align-items: center; gap: 10px; }
  .guild-checklist li::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--gold); transform: rotate(45deg); }
  .guild-errors { margin: 0; padding-left: 18px; }
  .emblem-editor { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
  .emblem-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: min(100%, 288px); padding: 6px; touch-action: none;
    background: var(--abyss); border: 1px solid var(--gold-line); }
  .emblem-tools { display: grid; gap: 14px; flex: 1 1 240px; min-width: 0; }
  .emblem-palette { display: grid; grid-template-columns: repeat(8, minmax(0, 36px)); gap: 6px; }
  :is(.emblem-grid, .emblem-palette) button { aspect-ratio: 1; min-width: 0; min-height: 0; margin: 0; padding: 0; clip-path: none; cursor: pointer;
    border: 1px solid var(--line-strong); box-shadow: none;
    background: linear-gradient(var(--pixel), var(--pixel)), repeating-conic-gradient(rgba(148, 180, 255, .16) 0 25%, rgba(3, 6, 13, .9) 0 50%) 0 0 / 10px 10px; }
  :is(.emblem-grid, .emblem-palette) button::after { content: none; }
  .emblem-grid button:hover { border-color: var(--azure-bright); }
  .emblem-palette button[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }
  :is(.emblem-grid, .emblem-palette) button:focus-visible { outline: 2px solid var(--ice); outline-offset: 1px; z-index: 1; }
  :is(.emblem-palette [data-color="0"], .emblem-grid [data-pixel="0"]) { --pixel: rgba(0, 0, 0, 0); }
  :is(.emblem-palette [data-color="1"], .emblem-grid [data-pixel="1"]) { --pixel: rgba(0, 0, 0, 1); }
  :is(.emblem-palette [data-color="2"], .emblem-grid [data-pixel="2"]) { --pixel: rgba(128, 128, 128, 1); }
  :is(.emblem-palette [data-color="3"], .emblem-grid [data-pixel="3"]) { --pixel: rgba(255, 255, 255, 1); }
  :is(.emblem-palette [data-color="4"], .emblem-grid [data-pixel="4"]) { --pixel: rgba(255, 0, 0, 1); }
  :is(.emblem-palette [data-color="5"], .emblem-grid [data-pixel="5"]) { --pixel: rgba(255, 128, 0, 1); }
  :is(.emblem-palette [data-color="6"], .emblem-grid [data-pixel="6"]) { --pixel: rgba(255, 255, 0, 1); }
  :is(.emblem-palette [data-color="7"], .emblem-grid [data-pixel="7"]) { --pixel: rgba(128, 255, 0, 1); }
  :is(.emblem-palette [data-color="8"], .emblem-grid [data-pixel="8"]) { --pixel: rgba(0, 255, 0, 1); }
  :is(.emblem-palette [data-color="9"], .emblem-grid [data-pixel="9"]) { --pixel: rgba(0, 255, 128, 1); }
  :is(.emblem-palette [data-color="10"], .emblem-grid [data-pixel="10"]) { --pixel: rgba(0, 255, 255, 1); }
  :is(.emblem-palette [data-color="11"], .emblem-grid [data-pixel="11"]) { --pixel: rgba(0, 128, 255, 1); }
  :is(.emblem-palette [data-color="12"], .emblem-grid [data-pixel="12"]) { --pixel: rgba(0, 0, 255, 1); }
  :is(.emblem-palette [data-color="13"], .emblem-grid [data-pixel="13"]) { --pixel: rgba(128, 0, 255, 1); }
  :is(.emblem-palette [data-color="14"], .emblem-grid [data-pixel="14"]) { --pixel: rgba(255, 0, 255, 1); }
  :is(.emblem-palette [data-color="15"], .emblem-grid [data-pixel="15"]) { --pixel: rgba(255, 0, 128, 1); }

  @media (max-width: 980px) {
    .guild-layout, .guild-create { grid-template-columns: minmax(0, 1fr); }
    .guild-side, .guild-create-side { position: static; }
    .guild-banner { grid-template-columns: auto minmax(0, 1fr); }
    .guild-banner-facts { grid-column: 1 / -1; }
  }
  @media (max-width: 640px) {
    /* Ficha compacta: nombre arriba y los datos en dos columnas. */
    .guild-roster tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; }
    .guild-roster td:not(:first-child) { grid-column: auto; }
    .guild-roster td:first-child { grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; }
  }
  @media (max-width: 560px) {
    .guild-heading > .guild-crest { --crest: 80px; }
    .guild-banner { padding: 16px; }
    .guild-banner .guild-crest { --crest: 72px; }
    .guild-banner-main h2 { font-size: var(--t-h3); }
    .guild-invite .form-field { max-width: none; }
    .guild-invite .btn-secondary { width: 100%; justify-content: center; }
    .emblem-grid { width: 100%; }
    .emblem-palette { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  }
}

/* ==========================================================================
   MU PASS: boleto animado, distintivo, casillas de recompensa, vitrina y
   recordatorio (components) y vistas del pase y de función bloqueada (pages).
   Paleta del sitio: el oro es el MU PASS; el PLUS suma un iris frío (hielo y
   amatista). Todo movimiento se apaga con prefers-reduced-motion.
   ========================================================================== */
@layer components {
  .note[data-tone="gold"] { border-left-color: var(--gold); background: rgba(228, 185, 98, .08); color: var(--gold-bright); }
  .note > svg { width: 18px; height: 18px; flex: none; }
  .pass-upcoming a { margin-left: auto; font-weight: 650; white-space: nowrap; }

  /* ---- Colores de cada pase ---- */
  [data-tier="pass"] { --t-1: #fff1b8; --t-2: #f6c453; --t-3: #e0841f; --t-glow: rgba(246, 196, 83, .55); --t-ink: #2a1703; --t-accent: var(--gold-bright); }
  [data-tier="plus"] { --t-1: #ffffff; --t-2: #b9ecff; --t-3: #e7a8ff; --t-4: #9b7bff; --t-glow: rgba(186, 150, 255, .6); --t-ink: #1c1036; --t-accent: #e2c8ff; }
  [data-tier="free"] { --t-1: #8f9bc2; --t-2: #59648c; --t-3: #333c5e; --t-glow: rgba(120, 140, 200, .25); --t-ink: #0d1226; --t-accent: var(--muted); }

  /* ---- Boleto animado (components/pass_ticket.html) ---- */
  .pass-art { --w: 210px; position: relative; display: inline-grid; place-items: center; width: var(--w); aspect-ratio: 1.25; isolation: isolate; }
  .pass-art--sm { --w: 92px; }
  .pass-art--md { --w: 200px; }
  .pass-art--lg { --w: min(260px, 64vw); }
  .pass-art-rays { position: absolute; inset: -14%; z-index: -1; border-radius: 50%; opacity: .85;
    background: radial-gradient(closest-side, var(--t-glow), transparent 72%),
      repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .13) 0 6deg, transparent 6deg 22deg);
    -webkit-mask: radial-gradient(closest-side, #000 35%, transparent 100%); mask: radial-gradient(closest-side, #000 35%, transparent 100%); }
  .pass-art--sm .pass-art-rays { inset: -6%; opacity: .6; }
  .pass-ticket { position: relative; width: 86%; aspect-ratio: 1.72; transform: rotate(-11deg);
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)) drop-shadow(0 0 22px var(--t-glow)); }
  .pass-ticket-face { position: absolute; inset: 0; overflow: hidden; border-radius: 9% / 15%;
    background: linear-gradient(135deg, var(--t-1) 0%, var(--t-2) 42%, var(--t-3) 100%);
    -webkit-mask: radial-gradient(circle at 0 50%, transparent 10.5%, #000 11%) left / 50.5% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 10.5%, #000 11%) right / 50.5% 100% no-repeat;
    mask: radial-gradient(circle at 0 50%, transparent 10.5%, #000 11%) left / 50.5% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 10.5%, #000 11%) right / 50.5% 100% no-repeat; }
  [data-tier="plus"] .pass-ticket-face { background: linear-gradient(125deg, var(--t-1) 0%, var(--t-2) 30%, var(--t-3) 62%, var(--t-4) 100%); background-size: 220% 220%; }
  .pass-ticket-face::before { content: ""; position: absolute; inset: 5%; border: 2px solid rgba(255, 255, 255, .55); border-radius: 7% / 12%; }
  .pass-ticket-face::after { content: ""; position: absolute; inset: -20% -60%; transform: translateX(-70%) skewX(-18deg);
    background: linear-gradient(90deg, transparent 38%, rgba(255, 255, 255, .78) 50%, transparent 62%); }
  .pass-ticket-emblem { position: absolute; left: 14%; top: 22%; width: 38%; height: 56%; color: var(--t-ink); opacity: .9; }
  .pass-ticket-holes { position: absolute; left: 55%; top: 26%; display: grid; gap: 10%; width: 11%; height: 48%; }
  .pass-ticket-holes i { border-radius: 50%; border: 3px solid var(--t-ink); opacity: .75; }
  .pass-ticket-code { position: absolute; right: 9%; top: 16%; width: 19%; height: 68%; opacity: .85;
    background: repeating-linear-gradient(180deg, var(--t-ink) 0 9%, transparent 9% 15%, var(--t-ink) 15% 19%, transparent 19% 25%); }
  .pass-ticket-word { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; font: 800 clamp(.5rem, calc(var(--w) * .055), .95rem)/1 var(--f-title);
    letter-spacing: .18em; color: var(--t-ink); opacity: .82; }
  .pass-art--sm .pass-ticket-word, .pass-art--sm .pass-ticket-holes { display: none; }
  .pass-art-gem { position: absolute; width: 27%; height: auto; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .55)); pointer-events: none; }
  .pass-art-gem--a { left: 2%; bottom: 2%; }
  .pass-art-gem--b { right: 4%; top: 2%; width: 24%; }
  .pass-art-gem--c { right: 0; bottom: 6%; width: 25%; }
  .pass-art-gem--d { left: 6%; top: 4%; width: 20%; }
  .pass-art-spark { position: absolute; width: 12px; height: 12px; opacity: 0;
    background: radial-gradient(circle, #fff 0 18%, transparent 20%), conic-gradient(from 45deg, transparent 0 22%, #fff8d8 25%, transparent 28% 47%, #fff8d8 50%, transparent 53% 72%, #fff8d8 75%, transparent 78% 97%, #fff8d8 100%);
    -webkit-mask: radial-gradient(circle, #000 0 45%, transparent 70%); mask: radial-gradient(circle, #000 0 45%, transparent 70%); }
  .pass-art-spark--a { left: 24%; top: 20%; }
  .pass-art-spark--b { right: 22%; bottom: 26%; width: 16px; height: 16px; }
  .pass-art-spark--c { right: 36%; top: 8%; width: 9px; height: 9px; }
  [data-tier="free"] .pass-ticket { filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)) grayscale(.35); }
  [data-tier="free"] .pass-art-gem, [data-tier="free"] .pass-art-spark { display: none; }

  /* ---- Distintivo del pase (components/pass_badge.html) ---- */
  .pass-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; vertical-align: middle; white-space: nowrap;
    font: 800 .62rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--t-ink);
    background: linear-gradient(135deg, var(--t-1), var(--t-2) 55%, var(--t-3)); background-size: 200% 200%;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); box-shadow: 0 0 16px -4px var(--t-glow); }
  .pass-badge svg { width: 13px; height: 13px; flex: none; }
  .pass-badge--md { padding: 5px 12px 5px 9px; font-size: .72rem; }
  .pass-badge--md svg { width: 16px; height: 16px; }
  a.pass-badge-link { display: inline-flex; text-decoration: none; }
  a.pass-badge-link:hover .pass-badge { filter: brightness(1.12); }
  .account-dock .dock-item--pass { gap: 6px; color: var(--gold-bright); font-weight: 650; }
  .account-dock .dock-item--pass svg { width: 17px; height: 17px; flex: none; color: var(--gold); }
  .account-dock .dock-item--vip { gap: 6px; }
  .account-dock .dock-item--vip > svg { width: 16px; height: 16px; flex: none; color: var(--gold); }
  /* Pase activo: marca en el dock, el avatar y el menú de la cuenta. */
  .dock-tier { margin-left: 2px; padding: 2px 6px; font: 800 .58rem/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold-grad); }
  .dock-tier[data-tier="plus"] { color: #1c1036; background: linear-gradient(90deg, #b9ecff, #e7a8ff, #9b7bff); }
  .account-avatar[data-pass] { position: relative; box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--pass-ring); }
  .account-avatar[data-pass="pass"] { --pass-ring: var(--gold); }
  .account-avatar[data-pass="plus"] { --pass-ring: #b48cff; }
  .account-avatar-pass { position: absolute; right: -7px; bottom: -6px; width: 15px; height: 15px; padding: 1px; color: var(--gold-ink); background: var(--pass-ring); border-radius: 50%; }

  /* ---- Casilla de recompensa (components/pass_slot.html) ---- */
  .pass-slot { --edge: var(--line-strong); position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-content: center;
    gap: 6px; width: 100%; min-height: var(--slot-h, 128px); padding: 16px 8px 12px; isolation: isolate;
    background: linear-gradient(180deg, rgba(27, 40, 80, .75), rgba(7, 11, 24, .9)); border: 1px solid var(--edge);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
  .pass-slot[data-track="pass"] { --edge: rgba(228, 185, 98, .35);
    background: radial-gradient(120% 80% at 50% 0, rgba(246, 196, 83, .2), transparent 60%), linear-gradient(180deg, #2a2050, #120d29); }
  .pass-slot[data-track="plus"] { --edge: rgba(200, 160, 255, .5);
    background: radial-gradient(120% 80% at 50% 0, rgba(185, 120, 255, .26), transparent 62%), linear-gradient(180deg, #2b1c55, #140c2d); }
  .pass-slot[data-track="free"] { min-height: var(--slot-h, 128px); }
  .pass-reward-art { position: relative; display: grid; place-items: center; width: 64px; height: 64px; }
  .pass-reward-img { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); }
  .pass-reward-img--minor { position: absolute; right: -10px; bottom: -6px; width: 34px; height: 34px; }
  .pass-reward-zen { width: 44px; height: 44px; color: var(--gold-bright); filter: drop-shadow(0 0 10px rgba(228, 185, 98, .5)); }
  .pass-slot-amount { font: 700 .74rem/1.2 var(--f-ui); color: var(--ice); text-align: center; text-shadow: 0 1px 3px var(--abyss); }
  .pass-slot-ribbon { position: absolute; top: 0; left: 50%; transform: translateX(-50%); padding: 2px 10px 3px; z-index: 2;
    font: 800 .56rem/1 var(--f-mono); letter-spacing: .16em; color: #1c1036;
    background: linear-gradient(90deg, #b9ecff, #e7a8ff, #9b7bff); clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%); }
  .pass-slot-check { position: absolute; top: 6px; left: 6px; z-index: 3; display: none; place-items: center; width: 30px; height: 30px;
    color: #fff; background: linear-gradient(180deg, #6ff0a3, #23b864); border: 2px solid #0b3b22; transform: rotate(-8deg);
    clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
  .pass-slot-check svg { width: 18px; height: 18px; }
  .pass-slot-lock { position: absolute; inset: auto 0 8px; z-index: 2; display: none; justify-content: center; align-items: center; gap: 4px;
    font: 800 .56rem/1 var(--f-mono); letter-spacing: .12em; color: var(--ice); }
  .pass-slot-lock svg { width: 15px; height: 15px; }
  .pass-slot-claim { position: absolute; inset: 0; z-index: 4; display: none; align-items: flex-end; justify-content: center; padding: 0 0 9px;
    border: 0; background: transparent; cursor: pointer; font: 800 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); clip-path: none; }
  .pass-slot-claim::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 6px; height: 22px; z-index: -1; background: var(--gold-grad);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); box-shadow: 0 0 14px rgba(228, 185, 98, .6); }
  .pass-slot-claim:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: -4px; }
  .pass-slot-claim.is-busy { color: transparent; }
  .pass-slot-claim .seal { position: absolute; bottom: 8px; }
  .pass-slot[data-state="ready"] { --edge: var(--gold); box-shadow: 0 0 0 1px rgba(228, 185, 98, .5) inset, 0 0 26px -6px rgba(228, 185, 98, .8); }
  .pass-slot[data-state="ready"] .pass-slot-claim { display: flex; }
  .pass-slot[data-state="ready"] .pass-slot-amount { visibility: hidden; }
  .pass-slot[data-state="ready"]:hover { transform: translateY(-3px) scale(1.02); }
  .pass-slot[data-state="claimed"] .pass-slot-check { display: grid; }
  .pass-slot[data-state="claimed"] :is(.pass-reward-art, .pass-slot-amount) { opacity: .45; filter: saturate(.4); }
  .pass-slot:is([data-state="locked"], [data-state="pass"], [data-state="plus"]) .pass-reward-art { filter: saturate(.55) brightness(.7); }
  .pass-slot:is([data-state="pass"], [data-state="plus"]) .pass-slot-lock { display: flex; }
  .pass-slot:is([data-state="pass"], [data-state="plus"]) .pass-slot-amount { visibility: hidden; }
  .pass-slot[data-state="locked"] { opacity: .78; }

  /* ---- Vitrina: tarjeta de compra (components/pass_offer.html) ---- */
  .pass-offer { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
  .pass-offer-bonus { position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
    margin: 0 10px -12px 0; padding: 8px 14px 18px 10px; color: var(--ice); background: linear-gradient(180deg, #232c52, #141a36);
    border: 1px solid var(--line-strong); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); transform: rotate(-1.2deg); }
  .pass-offer-plus { display: grid; place-items: center; width: 42px; height: 42px; margin: -14px 0 -6px -18px;
    font: 900 2rem/1 var(--f-ui); color: #fff; background: linear-gradient(180deg, #ffd98a, #f39b2c); text-shadow: 0 2px 0 #9a4f06;
    clip-path: polygon(33% 0, 67% 0, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0 67%, 0 33%, 33% 33%); filter: drop-shadow(0 3px 2px #000); }
  .pass-offer-bonus-text small { display: block; font: 800 .6rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .pass-offer-bonus-text strong { font: 700 1.05rem/1.2 var(--f-ui); color: #fff; }
  .pass-offer-bolt { width: 26px; height: 26px; color: var(--t-accent); filter: drop-shadow(0 0 8px var(--t-glow)); }
  .pass-offer-card { position: relative; display: grid; justify-items: center; gap: 12px; padding: 30px 18px 20px; overflow: hidden; isolation: isolate;
    background: radial-gradient(90% 60% at 50% 30%, var(--t-glow), transparent 70%), linear-gradient(170deg, color-mix(in srgb, var(--t-3) 26%, #120d29), #0b0a1f 82%);
    border: 2px solid color-mix(in srgb, var(--t-2) 70%, transparent); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    transform: rotate(.6deg); transition: transform .3s var(--ease), box-shadow .3s; }
  .pass-offer-card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
    background: repeating-linear-gradient(115deg, transparent 0 18px, rgba(255, 255, 255, .025) 18px 36px); }
  .pass-offer:hover .pass-offer-card, .pass-offer.is-focus .pass-offer-card { transform: rotate(0) translateY(-4px); box-shadow: 0 0 40px -8px var(--t-glow); }
  .pass-offer.is-focus .pass-offer-card { border-color: var(--t-1); }
  .pass-offer-title { margin: 0; font: 800 clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem)/1 var(--f-title); letter-spacing: .04em; text-transform: uppercase; text-align: center;
    color: #fff; -webkit-text-stroke: 1px rgba(0, 0, 0, .55); text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 22px var(--t-glow); }
  .pass-offer-points { display: inline-flex; align-items: center; gap: 6px; margin-top: -14px; padding: 5px 12px; z-index: 2;
    font: 800 .82rem/1 var(--f-ui); color: #10142a; background: #f4f6ff; border: 2px solid #0b0f22; transform: rotate(-3deg);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); box-shadow: 0 6px 12px rgba(0, 0, 0, .45); }
  .pass-offer-points svg { width: 16px; height: 16px; color: #4a3a8c; }
  .pass-offer-perks { display: grid; gap: 6px; width: 100%; margin: 2px 0 0; padding: 0; list-style: none; }
  .pass-offer-perks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: center; font-size: var(--t-sm); color: var(--text); }
  .pass-offer-perks svg { width: 18px; height: 18px; color: var(--t-accent); }
  .pass-offer-perks .pass-offer-all { color: var(--ice); font-weight: 650; }
  .pass-offer-form { width: 100%; margin: 4px 0 0; }
  .pass-buy { width: 100%; justify-content: center; min-height: 54px; font-size: 1.15rem; letter-spacing: .02em; }
  .pass-buy svg { width: 20px; height: 20px; }
  .pass-offer-note { margin: 0; font-size: var(--t-xs); color: var(--muted); text-align: center; }
  .pass-offer.is-mine .pass-offer-title::after { content: " ✓"; color: var(--ok); -webkit-text-stroke: 0; }

  /* ---- Listas de beneficios (vitrina, recordatorio, bienvenida, bloqueo) ---- */
  .pass-perk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
  .pass-perk-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 12px;
    background: rgba(3, 6, 13, .5); border: 1px solid var(--line); border-left: 3px solid var(--t-2, var(--gold)); }
  .pass-perk-list li > svg { width: 24px; height: 24px; justify-self: center; color: var(--t-2, var(--gold)); }
  .pass-perk-list strong { display: block; font-size: var(--t-sm); color: var(--ice); }
  .pass-perk-list small { display: block; font-size: var(--t-xs); color: var(--muted); }
  .pass-perk-list li.is-focus { background: rgba(228, 185, 98, .1); box-shadow: 0 0 0 1px var(--gold-line) inset; }
  .pass-perk-list--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
  .pass-perk-list--compact li { padding: 7px 10px; }

  /* ---- Recordatorio (components/pass_nudge.html) ---- */
  dialog.modal--pass { --tone: var(--gold); }
  .pass-nudge-body { display: grid; gap: 18px; }
  .pass-nudge-stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pass-nudge-offer { display: grid; justify-items: center; gap: 4px; padding: 12px; color: var(--text); text-decoration: none;
    background: radial-gradient(80% 70% at 50% 30%, var(--t-glow), transparent 70%), rgba(3, 6, 13, .55); border: 1px solid color-mix(in srgb, var(--t-2) 50%, transparent);
    transition: transform .25s var(--ease); }
  .pass-nudge-offer:hover { text-decoration: none; transform: translateY(-3px); }
  .pass-nudge-offer strong { font: 800 1rem/1.1 var(--f-title); letter-spacing: .06em; color: #fff; }
  .pass-nudge-offer > span:last-child { font: 700 var(--t-sm)/1 var(--f-ui); color: var(--t-accent); }

  /* ---- Revelado de recompensas ---- */
  .pass-reveal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
  .pass-reveal-item { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; text-align: center;
    background: radial-gradient(80% 70% at 50% 30%, rgba(228, 185, 98, .22), transparent 70%), rgba(3, 6, 13, .55); border: 1px solid var(--gold-line); }
  .pass-reveal-art { display: grid; place-items: center; width: 64px; height: 64px; color: var(--gold-bright); }
  .pass-reveal-art img { width: 60px; height: 60px; object-fit: contain; }
  .pass-reveal-art svg { width: 44px; height: 44px; }
  .pass-reveal-label { font-size: var(--t-xs); font-weight: 650; color: var(--ice); }

  /* ---- Chips y medidores del pase ---- */
  .pass-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font: 700 .72rem/1 var(--f-mono); letter-spacing: .06em;
    color: var(--ice); background: rgba(3, 6, 13, .6); border: 1px solid var(--line-strong); white-space: nowrap; }
  .pass-chip svg { width: 15px; height: 15px; color: var(--gold); }
  .pass-chip--gold { color: var(--gold-ink); background: var(--gold-grad); border-color: var(--gold); }
  .pass-chip--gold svg { color: var(--gold-ink); }
  .pass-meter, .pass-xp-bar { --p: 0; position: relative; height: 12px; overflow: hidden; background: rgba(3, 6, 13, .75); border: 1px solid var(--line-strong); }
  .pass-meter > i, .pass-xp-bar > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 1%); transition: width 1.1s var(--ease);
    background: linear-gradient(180deg, #a8ffcf, #2fd17d 55%, #1a9a5a); box-shadow: 0 0 12px rgba(79, 220, 159, .55); }
  .pass-xp-bar { height: 18px; }
  .pass-xp-bar > i { background: linear-gradient(180deg, #fff3c2, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 0 16px rgba(228, 185, 98, .7); }
  .pass-meter > i::after, .pass-xp-bar > i::after { content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .22) 0 8px, transparent 8px 16px); background-size: 32px 100%; }

  @media (prefers-reduced-motion: no-preference) {
    .pass-ticket { animation: pass-float 4.6s ease-in-out infinite; }
    .pass-ticket-face::after { animation: pass-shine 3.6s ease-in-out infinite 1s; }
    [data-tier="plus"] .pass-ticket-face { animation: pass-iris 6s ease-in-out infinite alternate; }
    .pass-art-rays { animation: pass-rays 26s linear infinite; }
    .pass-art-gem { animation: pass-bob 3.2s ease-in-out infinite; }
    .pass-art-gem--b { animation-delay: -1.1s; }
    .pass-art-gem--c { animation-delay: -2s; }
    .pass-art-gem--d { animation-delay: -.6s; animation-duration: 3.8s; }
    .pass-art-spark { animation: pass-twinkle 2.4s ease-in-out infinite; }
    .pass-art-spark--b { animation-delay: -.8s; }
    .pass-art-spark--c { animation-delay: -1.6s; }
    .pass-badge[data-tier="plus"] { animation: pass-iris 5s ease-in-out infinite alternate; }
    .pass-slot[data-state="ready"] { animation: pass-glow 1.8s ease-in-out infinite; }
    .pass-slot[data-state="ready"] .pass-reward-art { animation: pass-bob 2.2s ease-in-out infinite; }
    .pass-slot.is-claimed-now .pass-slot-check { animation: pass-pop .55s var(--ease) both; }
    .pass-slot.is-claiming { animation: none; transform: scale(.97); }
    .pass-meter > i::after, .pass-xp-bar > i::after { animation: pass-stripes 1.2s linear infinite; }
    .pass-reveal-item { animation: pass-pop .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
    .pass-offer-plus { animation: pass-pulse 2.2s ease-in-out infinite; }
    .account-dock .dock-item--pass svg { animation: pass-wiggle 5s ease-in-out infinite; }
  }
  @keyframes pass-float { 0%, 100% { transform: translateY(0) rotate(-11deg); } 50% { transform: translateY(-9px) rotate(-8deg); } }
  @keyframes pass-shine { 0%, 55% { transform: translateX(-70%) skewX(-18deg); } 85%, 100% { transform: translateX(70%) skewX(-18deg); } }
  @keyframes pass-iris { from { background-position: 0 0; } to { background-position: 100% 100%; } }
  @keyframes pass-rays { to { transform: rotate(360deg); } }
  @keyframes pass-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
  @keyframes pass-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; } }
  @keyframes pass-glow { 0%, 100% { box-shadow: 0 0 0 1px rgba(228, 185, 98, .5) inset, 0 0 18px -8px rgba(228, 185, 98, .7); } 50% { box-shadow: 0 0 0 1px rgba(255, 230, 160, .9) inset, 0 0 32px -2px rgba(228, 185, 98, .95); } }
  @keyframes pass-pop { 0% { opacity: 0; transform: scale(.2) rotate(-30deg); } 70% { opacity: 1; transform: scale(1.18) rotate(-4deg); } 100% { transform: scale(1) rotate(-8deg); } }
  @keyframes pass-stripes { to { background-position: 32px 0; } }
  @keyframes pass-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.1; } }
  @keyframes pass-wiggle { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-14deg); } 96% { transform: rotate(10deg); } }
}

@layer pages {
  body:is(.page-pass_page, .page-pass_return) { background-color: var(--night);
    background-image: radial-gradient(70% 50% at 50% 8%, rgba(124, 77, 255, .16), transparent 70%), linear-gradient(180deg, rgba(4, 9, 21, .4), rgba(4, 9, 21, .86) 46%, var(--night)), var(--wall);
    background-position: center, center, center 22%; background-repeat: no-repeat; background-size: cover, cover, cover; background-attachment: fixed, fixed, fixed; }
  body.page-pass_page { --wall: url("wallpapers/pase-desktop.webp"); --wall-m: url("wallpapers/pase-mobile.webp"); }
  body.page-pass_return { --wall: url("wallpapers/pase-desktop.webp"); --wall-m: url("wallpapers/pase-mobile.webp"); }
  body:is(.page-pass_page, .page-pass_return) .main-content::before { display: none; }
  @media (max-width: 760px) {
    body:is(.page-pass_page, .page-pass_return) {
      background-image: linear-gradient(180deg, rgba(4, 9, 21, .3), rgba(4, 9, 21, .72) 55%, var(--night) 98%), var(--wall-m);
      background-size: 100% 178vw, 100% auto; background-position: center top, center top; background-attachment: scroll, scroll; }
  }

  /* ---- Próximamente y pago en curso ---- */
  .pass-soon { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 32px; align-items: center; }
  .pass-payment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 18px; border-color: var(--gold-line); }
  .pass-payment[data-payment-status="ACTIVATED"] { border-color: rgba(79, 220, 159, .5); }
  .pass-payment[data-payment-status="DECLINED"], .pass-payment[data-payment-status="VOIDED"], .pass-payment[data-payment-status="ERROR"] { border-color: rgba(255, 123, 144, .45); }
  .pass-payment-seal { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
  .pass-payment-body { display: grid; gap: 4px; }
  .pass-payment-body strong { font: 700 1.2rem/1.2 var(--f-ui); color: var(--ice); min-width: 12ch; }
  .pass-payment-body small { color: var(--muted); }

  /* ---- Cabecera del pase ---- */
  .pass-hero { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 30px; align-items: center; margin: 0 0 18px;
    padding: clamp(16px, 2.6vw, 26px) clamp(16px, 3vw, 32px); overflow: hidden; isolation: isolate;
    background: radial-gradient(60% 120% at 12% 50%, var(--t-glow, rgba(124, 77, 255, .2)), transparent 70%), linear-gradient(120deg, #1c1442 0%, #10173a 55%, #0a0f26 100%);
    border: 1px solid color-mix(in srgb, var(--t-2, var(--azure)) 45%, transparent);
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); box-shadow: var(--shadow-2); }
  .pass-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .45;
    background: repeating-linear-gradient(120deg, transparent 0 22px, rgba(255, 255, 255, .025) 22px 44px); }
  .pass-hero-art { position: relative; display: grid; justify-items: center; }
  .pass-stamp { display: inline-flex; align-items: center; gap: 6px; margin-top: -12px; padding: 6px 12px; z-index: 2;
    font: 800 .7rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; transform: rotate(-4deg);
    background: linear-gradient(180deg, #4a3aa8, #2b1f72); border: 2px solid #0e0a26; box-shadow: 0 6px 14px rgba(0, 0, 0, .5); }
  .pass-stamp svg { width: 15px; height: 15px; color: var(--ok); }
  .pass-stamp[data-tier="free"] { background: linear-gradient(180deg, #2a3358, #171d38); color: var(--text); }
  .pass-stamp[data-tier="free"] svg { color: var(--muted); }
  .pass-hero-body { display: grid; gap: 14px; min-width: 0; }
  .pass-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .pass-level-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
  .pass-level-gem { display: grid; place-content: center; justify-items: center; width: 86px; aspect-ratio: 1; color: var(--gold-ink);
    background: var(--gold-grad); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    filter: drop-shadow(0 0 16px rgba(228, 185, 98, .6)); }
  .pass-level-gem small { font: 800 .56rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
  .pass-level-gem strong { font: 800 2.2rem/1 var(--f-title); color: var(--gold-ink); font-variant-numeric: tabular-nums; }
  .pass-xp { display: grid; gap: 8px; min-width: 0; }
  .pass-xp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font: 700 1.05rem/1 var(--f-ui); color: var(--ice); font-variant-numeric: tabular-nums; }
  .pass-xp-head small { margin-left: auto; font: 600 var(--t-xs)/1 var(--f-mono); color: var(--muted); }
  .pass-xp-tag { padding: 3px 6px; margin-right: 4px; font: 900 .78rem/1 var(--f-title); color: #111; background: #fff; transform: rotate(-6deg); }
  .pass-xp-total { margin: 0; font-size: var(--t-xs); color: var(--muted); }
  .pass-xp-total b { color: var(--ice); }
  .pass-xp-bonus { color: var(--gold-bright); }
  .pass-hero-cta { display: grid; gap: 8px; justify-items: stretch; min-width: 220px; text-align: center; }
  .pass-hero-cta small { color: var(--muted); font-size: var(--t-xs); }
  .pass-cta { min-height: 52px; justify-content: center; font-size: 1.02rem; }
  .pass-cta svg, .pass-claim-all svg { width: 19px; height: 19px; }
  .pass-claim-all { justify-content: center; gap: 8px; }
  .pass-level-gem.is-up { animation: pass-pop .6s var(--ease); }
  @media (prefers-reduced-motion: no-preference) {
    .pass-hero[data-tier="free"] .pass-cta { animation: pass-pulse 2.4s ease-in-out infinite; }
    .pass-claim-all:not([hidden]) { animation: pass-glow 1.8s ease-in-out infinite; }
  }

  /* ---- Pista de recompensas ---- */
  .pass-tabs { margin-bottom: 14px; }
  .pass-tabs .count-badge { margin-left: 8px; }
  /* Tres carriles de la misma altura: PLUS (morado), MU PASS (oro) y GRATIS; el riel izquierdo los nombra siempre. */
  .pass-board { --slot-h: 128px; --node-h: 46px; display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 0 12px; padding: 16px 12px 10px 16px; margin-bottom: 18px;
    background: linear-gradient(180deg, rgba(28, 20, 66, .9), rgba(10, 13, 34, .92)); }
  .pass-board[hidden] { display: none; }
  .pass-board-rail { display: grid; grid-template-rows: var(--slot-h) var(--slot-h) var(--node-h) var(--slot-h); gap: 8px 0; padding-top: 6px; align-items: stretch; }
  .pass-board-rail .pass-rail-label:last-child { grid-row: 4; }
  .pass-rail-label { align-content: center; border-left: 3px solid var(--lane, var(--line-strong)); background: linear-gradient(90deg, var(--lane-bg, transparent), transparent); }
  .pass-rail-label[data-tier="plus"] { --lane: #b48cff; --lane-bg: rgba(155, 110, 255, .16); }
  .pass-rail-label[data-tier="pass"] { --lane: var(--gold); --lane-bg: rgba(228, 185, 98, .12); }
  .pass-rail-label[data-tier="free"] { --lane: var(--line-strong); --lane-bg: rgba(148, 180, 255, .06); }
  .pass-rail-label b { display: block; }
  .pass-rail-label { display: grid; justify-items: center; gap: 4px; font: 800 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ice); }
  .pass-rail-label[data-tier="plus"] b { padding: 4px 10px; color: #1c1036; background: linear-gradient(90deg, #b9ecff, #e7a8ff, #9b7bff); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
  .pass-rail-label[data-tier="free"] b { padding: 6px 10px; color: var(--text); background: rgba(3, 6, 13, .6); border: 1px solid var(--line-strong); }
  .pass-track { --step: 150px; display: flex; gap: 12px; margin: 0; padding: 6px 4px 14px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity;
    scrollbar-width: thin; scrollbar-color: var(--gold-deep) rgba(3, 6, 13, .6); }
  .pass-track:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
  .pass-step { position: relative; display: grid; grid-template-rows: var(--slot-h) var(--slot-h) var(--node-h) var(--slot-h); gap: 8px 0; flex: 0 0 var(--step); scroll-snap-align: center; }
  .pass-step-plus { display: grid; }
  .pass-step-plus:empty { border: 1px dashed rgba(200, 160, 255, .18); background: repeating-linear-gradient(135deg, rgba(155, 123, 255, .05) 0 8px, transparent 8px 16px); }
  .pass-step-top { display: grid; }
  .pass-step-node { margin: -8px 0; }
  .pass-step-bottom { align-self: start; }
  .pass-step-node { position: relative; display: grid; place-items: center; }
  .pass-step-node::before { content: ""; position: absolute; left: -12px; right: 0; top: 50%; height: 6px; transform: translateY(-50%);
    background: rgba(3, 6, 13, .85); border-block: 1px solid var(--line-strong); }
  .pass-step.is-reached .pass-step-node::before { background: linear-gradient(180deg, #ffe7a3, var(--gold) 55%, var(--gold-deep)); border-color: var(--gold-deep); box-shadow: 0 0 12px rgba(228, 185, 98, .55); }
  .pass-step-node span { position: relative; display: grid; place-items: center; width: 34px; height: 34px; font: 800 .9rem/1 var(--f-title); font-variant-numeric: tabular-nums;
    color: var(--muted); background: #0b1026; border: 2px solid var(--line-strong); border-radius: 50%; }
  .pass-step.is-reached .pass-step-node span { color: var(--gold-ink); background: var(--gold-grad); border-color: #fff2c4; }
  .pass-step.is-next .pass-step-node span { color: var(--gold-bright); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(228, 185, 98, .18), 0 0 18px rgba(228, 185, 98, .7); }
  @media (prefers-reduced-motion: no-preference) { .pass-step.is-next .pass-step-node span { animation: pass-pulse 1.6s ease-in-out infinite; } }

  /* ---- Misiones ---- */
  .pass-missions[hidden], .pass-achievements[hidden] { display: none; }
  .pass-missions-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
  .pass-missions-head h2 { margin: 0; font-size: var(--t-h3); }
  .pass-mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; margin: 0 0 22px; padding: 0; list-style: none; }
  .pass-mission { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 10px 14px; align-items: center; padding: 14px;
    background: linear-gradient(180deg, rgba(27, 40, 80, .6), rgba(7, 11, 24, .85)); border: 1px solid var(--line);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: border-color .25s, transform .25s var(--ease); }
  .pass-mission-icon { display: grid; place-items: center; width: 52px; aspect-ratio: 1; color: var(--gold-bright);
    background: radial-gradient(circle at 50% 35%, rgba(228, 185, 98, .25), transparent 70%), #0b1026; border: 1px solid var(--gold-line); transform: rotate(45deg) scale(.82); }
  .pass-mission-icon svg { width: 24px; height: 24px; transform: rotate(-45deg); }
  .pass-mission-body { display: grid; gap: 6px; min-width: 0; }
  .pass-mission-body strong { color: var(--ice); font-size: var(--t-sm); }
  .pass-mission-body small { font: 600 var(--t-xs)/1 var(--f-mono); color: var(--muted); }
  .pass-mission-body small b { color: var(--ice); }
  .pass-mission-points { display: grid; justify-items: center; gap: 2px; min-width: 56px; color: var(--gold-bright); }
  .pass-mission-points b { font: 800 1.3rem/1 var(--f-title); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(228, 185, 98, .5); }
  .pass-mission-points small { display: inline-flex; align-items: center; gap: 2px; font: 700 .62rem/1 var(--f-mono); color: var(--muted); }
  .pass-mission-points small svg { width: 11px; height: 11px; color: var(--gold); }
  .pass-mission-claim, .pass-mission-done { grid-column: 1 / -1; display: none; }
  .pass-mission-claim { justify-content: center; }
  .pass-mission[data-state="ready"] { border-color: var(--gold); box-shadow: 0 0 24px -8px rgba(228, 185, 98, .8); }
  .pass-mission[data-state="ready"] .pass-mission-claim { display: inline-flex; }
  .pass-mission[data-state="claimed"] .pass-mission-done { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px;
    color: #fff; background: linear-gradient(180deg, #6ff0a3, #23b864); border: 2px solid #0b3b22; transform: rotate(-8deg); }
  .pass-mission-done svg { width: 16px; height: 16px; }
  .pass-mission[data-state="claimed"] { opacity: .66; }
  .pass-mission[data-state="claimed"] .pass-mission-points { visibility: hidden; }
  .pass-mission.is-claimed-now .pass-mission-done { animation: pass-pop .55s var(--ease) both; }
  @media (prefers-reduced-motion: no-preference) { .pass-mission[data-state="ready"] .pass-mission-icon { animation: pass-pulse 1.8s ease-in-out infinite; } }

  /* ---- Logros ---- */
  .pass-medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
  .pass-medal { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px 14px; padding: 14px;
    background: linear-gradient(180deg, rgba(27, 40, 80, .55), rgba(7, 11, 24, .85)); border: 1px solid var(--line); }
  .pass-medal-ring { --p: 0; display: grid; place-items: center; width: 70px; aspect-ratio: 1; border-radius: 50%; color: var(--muted);
    background: radial-gradient(closest-side, #0b1026 76%, transparent 78% 100%), conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(148, 180, 255, .14) 0); }
  .pass-medal-ring svg { width: 26px; height: 26px; }
  .pass-medal-body { display: grid; gap: 3px; align-content: center; min-width: 0; }
  .pass-medal-body strong { color: var(--ice); }
  .pass-medal-body small { color: var(--muted); font-size: var(--t-xs); }
  .pass-medal-count { font: 700 var(--t-xs)/1 var(--f-mono); color: var(--text); }
  .pass-medal-reward { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  .pass-medal-reward .pass-reward-art { width: 44px; height: 44px; }
  .pass-medal-reward .pass-reward-img { width: 40px; height: 40px; }
  .pass-medal-reward > span:not(.pass-reward-art) { flex: 1; font-size: var(--t-sm); color: var(--text); }
  .pass-medal-claim { display: none; }
  .pass-medal[data-state="ready"] { border-color: var(--gold); box-shadow: 0 0 24px -8px rgba(228, 185, 98, .8); }
  .pass-medal[data-state="ready"] .pass-medal-ring { color: var(--gold-bright); }
  .pass-medal[data-state="ready"] .pass-medal-claim { display: inline-flex; }
  .pass-medal[data-state="claimed"] { opacity: .66; }
  .pass-medal[data-state="claimed"] .pass-medal-ring { color: var(--ok); }

  /* ---- Modo de pruebas e historial ---- */
  .pass-test { margin-bottom: 18px; border: 1px dashed rgba(148, 180, 255, .45); background: rgba(3, 6, 13, .6); }
  .pass-test h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: var(--t-h3); }
  .pass-test h2 > svg { width: 20px; height: 20px; color: var(--azure-bright); }
  .pass-test-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .pass-test-actions form { margin: 0; }
  .pass-history { margin-bottom: 18px; }
  .pass-history h2 { margin: 0 0 12px; font-size: var(--t-h3); }

  /* ---- Vitrina, bienvenida y revelado ---- */
  dialog.modal.modal--pass-store { width: min(900px, calc(100vw - 20px)); }
  dialog.modal--pass-store .modal-shell { background: radial-gradient(80% 50% at 50% 0, rgba(124, 77, 255, .22), transparent 70%), var(--deep); }
  .pass-store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 8px 4px 4px; }
  .pass-store-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; font-size: var(--t-xs); color: var(--muted); text-align: center; }
  .pass-store-foot svg { width: 16px; height: 16px; flex: none; color: var(--ok); }
  dialog.modal--pass-welcome .modal-body, dialog.modal--pass-reveal .modal-body { display: grid; justify-items: center; gap: 10px; text-align: center; }
  dialog.modal--pass-welcome h2, dialog.modal--pass-reveal h2 { margin: 0; }
  dialog.modal--pass-welcome .pass-perk-list { width: 100%; text-align: left; }
  dialog.modal.modal--pass-welcome { width: min(660px, calc(100vw - 20px)); }
  .pass-welcome-stage { margin: 8px 0 0; }
  @media (prefers-reduced-motion: no-preference) {
    dialog.modal--pass-welcome[open] .pass-welcome-stage { animation: pass-welcome-in 1s var(--ease) both; }
    dialog.modal--pass-store[open] .pass-offer { animation: pass-deal .6s var(--ease) both; }
    dialog.modal--pass-store[open] .pass-offer + .pass-offer { animation-delay: .12s; }
  }
  @keyframes pass-welcome-in { 0% { opacity: 0; transform: scale(.3) rotate(-40deg); } 65% { opacity: 1; transform: scale(1.12) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
  @keyframes pass-deal { from { opacity: 0; transform: translateY(26px) rotate(3deg); } }

  /* ---- Función bloqueada (pass_locked.html) ---- */
  .pass-lock { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 36px; align-items: center; padding: clamp(20px, 4vw, 40px);
    background: radial-gradient(60% 100% at 18% 50%, var(--t-glow), transparent 70%), linear-gradient(120deg, #1c1442, #0b1026);
    border: 1px solid color-mix(in srgb, var(--t-2) 45%, transparent); clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
  .pass-lock-stage { position: relative; display: grid; place-items: center; }
  .pass-lock-feature { position: absolute; right: 2%; bottom: 4%; display: grid; place-items: center; width: 66px; aspect-ratio: 1; color: var(--ice); z-index: 2;
    background: #0b1026; border: 2px solid var(--t-2); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
  .pass-lock-feature > svg { width: 30px; height: 30px; }
  .pass-lock-padlock { position: absolute; right: 14px; bottom: 10px; width: 18px; height: 18px; color: var(--t-accent); }
  .pass-lock-body { display: grid; gap: 14px; justify-items: start; }
  .pass-lock-body h2 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 2.1rem); }
  .pass-lock-body .pass-perk-list { width: 100%; }
  .pass-lock-current { margin: 0; color: var(--muted); font-size: var(--t-sm); }

  @media (max-width: 980px) {
    .pass-hero { grid-template-columns: auto minmax(0, 1fr); }
    .pass-hero-cta { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: center; }
    .pass-hero-cta small { grid-row: 2; }
  }
  @media (max-width: 720px) {
    .pass-hero { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
    .pass-hero-art { justify-self: center; }
    .pass-art--md { --w: 170px; }
    .pass-store-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .pass-board { --slot-h: 116px; grid-template-columns: 40px minmax(0, 1fr); gap: 0 6px; padding: 12px 6px 8px; }
    .pass-rail-label { padding: 0; }
    .pass-rail-label b { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .16em; font-size: .6rem; }
    .pass-rail-label .pass-art { display: none; }
    .pass-track { --step: 120px; gap: 8px; }
    .pass-lock { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .pass-lock-body { justify-items: center; }
    .pass-lock .action-bar { justify-content: center; }
    .pass-soon { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .pass-level-gem { width: 72px; }
    .pass-level-gem strong { font-size: 1.8rem; }
  }
  @media (max-width: 420px) {
    .pass-nudge-stage { grid-template-columns: minmax(0, 1fr); }
    .pass-mission { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 12px; }
    .pass-mission-icon { width: 44px; }
    .pass-xp-head small { margin-left: 0; flex-basis: 100%; }
  }
}

@layer components {
  /* ---- Noticias: portada destacada, tarjetas, detalle con lectura ----
     Categoría → tono con data-category; todo color sale de los tokens. */
  :is(.news-lead, .news-card, .news-row, .news-hero) { --tone: var(--azure-bright); }
  :is(.news-lead, .news-card, .news-row, .news-hero):is([data-category="anuncios"], [data-category="promociones"]) { --tone: var(--gold-bright); }
  :is(.news-lead, .news-card, .news-row, .news-hero)[data-category="guias"] { --tone: var(--ok); }
  :is(.news-lead, .news-card, .news-row, .news-hero)[data-category="eventos"] { --tone: var(--warn); }
  :is(.news-lead, .news-card, .news-row, .news-hero)[data-category="mantenimiento"] { --tone: var(--bad); }
  :is(.news-lead, .news-card, .news-row, .news-hero)[data-category="balance"] { --tone: var(--frost); }

  .news-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 5px; font: 700 .66rem/1 var(--f-title); letter-spacing: .16em;
    text-transform: uppercase; color: var(--tone, var(--azure-bright)); background: rgba(3, 6, 13, .78); border: 1px solid currentColor;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); backdrop-filter: blur(6px); }
  .news-chip::before { content: ""; width: 5px; height: 5px; background: currentColor; transform: rotate(45deg); box-shadow: 0 0 8px currentColor; }
  .news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font: 500 var(--t-xs)/1.2 var(--f-mono); color: var(--muted); }
  .news-meta > span { display: inline-flex; align-items: center; gap: 6px; }
  .news-meta svg { width: 14px; height: 14px; flex: none; color: var(--tone, var(--azure-bright)); }
  .news-new { padding: 4px 8px; color: var(--gold-ink); background: var(--gold-grad); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    animation: news-new 2.4s var(--ease) infinite; }
  @keyframes news-new { 0%, 100% { box-shadow: 0 0 0 0 rgba(228, 185, 98, .5); } 50% { box-shadow: 0 0 0 6px rgba(228, 185, 98, 0); } }
  .news-pinned { color: var(--gold-bright); }
  .news-pinned svg { color: var(--gold); }
  /* Enlace que cubre toda la tarjeta (un solo destino accesible). */
  .news-hit { color: inherit; text-decoration: none; }
  .news-hit::after { content: ""; position: absolute; inset: 0; z-index: 2; }
  .news-hit:focus-visible { outline: none; }
  :is(.news-lead, .news-card, .news-row):has(.news-hit:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }

  .news-tabs { margin-bottom: 22px; }

  /* Portada destacada */
  .news-lead { position: relative; display: grid; min-height: clamp(380px, 46vw, 540px); margin: 0 0 26px; overflow: hidden; isolation: isolate;
    border: 1px solid var(--line-strong); background: var(--abyss); box-shadow: var(--shadow-2); animation: news-rise .7s var(--ease) both; }
  .news-lead::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, rgba(3, 6, 13, .94) 0%, rgba(3, 6, 13, .7) 38%, rgba(3, 6, 13, .05) 72%), linear-gradient(0deg, rgba(3, 6, 13, .85), transparent 45%); }
  .news-lead::after { content: ""; position: absolute; inset: 10px; z-index: 1; pointer-events: none; border: 1px solid rgba(228, 185, 98, .22);
    clip-path: polygon(0 0, 28px 0, 28px 1px, 1px 1px, 1px 28px, 0 28px, 0 100%, 28px 100%, 28px calc(100% - 1px), 1px calc(100% - 1px), 1px calc(100% - 28px), 0 calc(100% - 28px),
      100% 0, calc(100% - 28px) 0, calc(100% - 28px) 1px, calc(100% - 1px) 1px, calc(100% - 1px) 28px, 100% 28px, 100% 100%, calc(100% - 28px) 100%, calc(100% - 28px) calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) calc(100% - 28px), 100% calc(100% - 28px)); }
  .news-lead-media { position: absolute; inset: 0; }
  .news-lead-media > img { width: 100%; height: 100%; object-fit: cover; animation: news-drift 24s ease-in-out infinite alternate; transition: transform .8s var(--ease); }
  .news-lead-body { position: relative; z-index: 3; align-self: end; display: grid; justify-items: start; gap: 14px; max-width: 640px; padding: clamp(22px, 4vw, 52px); pointer-events: none; }
  .news-lead-title { margin: 0; font: 700 clamp(1.7rem, 1.1rem + 2.4vw, 3.1rem)/1.06 var(--f-title); color: var(--ice); text-shadow: 0 2px 24px rgba(0, 0, 0, .8); }
  .news-lead-title a { pointer-events: auto; }
  .news-lead-summary { margin: 0; max-width: 52ch; font-size: var(--t-lg); line-height: 1.55; color: var(--text); }
  .news-lead-cta { margin-top: 6px; }
  .news-lead:hover .news-lead-media > img { transform: scale(1.04); }
  .news-lead:hover .news-lead-cta { box-shadow: var(--glow-gold); }
  .news-lead:hover .news-lead-cta svg.arrow { transform: translateX(4px); }
  @keyframes news-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
  @keyframes news-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  /* Rejilla de tarjetas */
  .news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
  .news-grid > li { display: flex; animation: news-rise .6s var(--ease) both; }
  .news-grid > li:nth-child(2) { animation-delay: .07s; } .news-grid > li:nth-child(3) { animation-delay: .14s; }
  .news-grid > li:nth-child(4) { animation-delay: .21s; } .news-grid > li:nth-child(n+5) { animation-delay: .28s; }
  .news-card { position: relative; display: flex; flex-direction: column; width: 100%; overflow: hidden; background: var(--plate-grad); border: 1px solid var(--line);
    box-shadow: var(--shadow-1); transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
  .news-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 3; background: var(--tone); opacity: .7; transform: scaleX(.18); transform-origin: left;
    transition: transform .45s var(--ease), opacity .3s; }
  .news-card:hover { transform: translateY(-6px); border-color: var(--gold-line); box-shadow: var(--shadow-2), var(--glow-gold); }
  .news-card:hover::before { transform: scaleX(1); opacity: 1; }
  .news-card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(60% 70% at 50% 40%, rgba(91, 135, 255, .22), transparent 70%), var(--abyss);
    border-bottom: 1px solid var(--line); display: grid; place-items: center; }
  .news-card-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), filter .5s; filter: saturate(.92); }
  .news-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7, 11, 24, .85), transparent 55%); pointer-events: none; }
  .news-card-media::before { content: ""; position: absolute; z-index: 1; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 246, 216, .22), transparent); transform: skewX(-18deg); }
  .news-card:hover .news-card-media > img { transform: scale(1.07); filter: saturate(1.08); }
  .news-card:hover .news-card-media::before { animation: news-sheen .9s var(--ease); }
  @keyframes news-sheen { to { left: 130%; } }
  .news-card-media .news-chip { position: absolute; z-index: 2; left: 14px; bottom: 12px; }
  .news-card-glyph { width: 46px; height: 46px; color: var(--tone); opacity: .6; }
  .news-card-body { display: grid; gap: 10px; flex: 1; align-content: start; padding: 16px 18px 18px; }
  .news-card-title { margin: 0; font: 700 clamp(1.05rem, .95rem + .45vw, 1.28rem)/1.25 var(--f-title); color: var(--ice); overflow-wrap: anywhere; transition: color .25s; }
  .news-card:hover .news-card-title { color: var(--gold-bright); }
  .news-card-summary { margin: 0; color: var(--muted); font-size: var(--t-sm); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .news-card-more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font: 700 .74rem/1 var(--f-title); letter-spacing: .16em;
    text-transform: uppercase; color: var(--gold-bright); }
  .news-card-more svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
  .news-card:hover .news-card-more svg { transform: translateX(5px); }
  .news-pager { margin-top: 30px; }
  .arrow--back { transform: scaleX(-1); }

  /* Detalle */
  .news-progress { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; background: var(--gold-grad);
    transform: scaleX(var(--read, 0)); transform-origin: left; box-shadow: 0 0 12px rgba(228, 185, 98, .6); }
  .news-hero { position: relative; display: grid; min-height: clamp(300px, 40vw, 520px); margin: clamp(10px, 2vw, 22px) 0 0; overflow: hidden; isolation: isolate;
    border: 1px solid var(--line-strong); background: radial-gradient(70% 90% at 75% 30%, rgba(91, 135, 255, .25), transparent 70%), var(--abyss); }
  .news-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(0deg, var(--night) 0%, rgba(7, 11, 24, .78) 32%, rgba(7, 11, 24, .1) 70%), linear-gradient(90deg, rgba(3, 6, 13, .6), transparent 60%); }
  .news-hero-media { position: absolute; inset: 0; }
  .news-hero-media > img { width: 100%; height: 100%; object-fit: cover; animation: news-drift 30s ease-in-out infinite alternate; }
  .news-hero-copy { position: relative; z-index: 2; align-self: end; display: grid; gap: 14px; max-width: 900px; padding: clamp(20px, 4vw, 48px); animation: news-rise .7s var(--ease) both; }
  .news-hero-copy .eyebrow { gap: 12px; flex-wrap: wrap; }
  .news-hero-copy .eyebrow a { color: var(--gold); }
  .news-hero-copy .eyebrow .news-chip { letter-spacing: .16em; }
  .news-hero-copy h1 { margin: 0; font-size: clamp(1.9rem, 1.2rem + 3vw, 3.6rem); line-height: 1.05; color: var(--ice); text-shadow: 0 2px 30px rgba(0, 0, 0, .8); overflow-wrap: anywhere; }
  .news-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 24px; align-items: start; margin-top: -1px; }
  .news-article { position: relative; padding: clamp(20px, 3.6vw, 44px); overflow-wrap: anywhere; animation: news-rise .7s .08s var(--ease) both; }
  .news-standfirst { margin: 0 0 22px; padding-left: 16px; border-left: 2px solid var(--gold); font: 600 clamp(1.12rem, 1rem + .5vw, 1.35rem)/1.45 var(--f-display); color: var(--ice); }
  .news-body { max-width: 72ch; font-size: 1.04rem; line-height: 1.8; color: var(--text); }
  .news-body > * { margin: 0 0 1.05em; }
  .news-body > p:first-child::first-letter { float: left; margin: .08em .12em 0 0; font: 700 3.4em/.82 var(--f-title); background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .news-body h2, .news-body h3, .news-body h4 { display: flex; align-items: center; gap: 12px; margin: 1.6em 0 .7em; font-family: var(--f-title); color: var(--ice); line-height: 1.2; }
  .news-body h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); }
  .news-body h3 { font-size: 1.18rem; } .news-body h4 { font-size: 1.05rem; color: var(--gold-bright); }
  .news-body h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-line), transparent); }
  .news-body strong { color: var(--ice); }
  .news-body a { color: var(--gold-bright); text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 3px; }
  .news-body a:hover { text-decoration-color: var(--gold); }
  .news-body ul, .news-body ol { padding: 0; list-style: none; display: grid; gap: 10px; }
  .news-body ul > li { position: relative; padding-left: 24px; }
  .news-body ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 8px rgba(228, 185, 98, .6); }
  .news-body ol { counter-reset: news-step; }
  .news-body ol > li { position: relative; counter-increment: news-step; padding: 12px 14px 12px 58px; background: rgba(14, 22, 48, .55); border: 1px solid var(--line); }
  .news-body ol > li::before { content: counter(news-step); position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 32px; height: 32px;
    font: 700 .95rem/1 var(--f-title); color: var(--gold-ink); background: var(--gold-grad); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
  .news-body blockquote { position: relative; margin-inline: 0; padding: 14px 16px 14px 48px; color: var(--ice); background: var(--warn-soft); border: 1px solid rgba(243, 197, 82, .3); }
  .news-body blockquote::before { content: "!"; position: absolute; left: 14px; top: 13px; display: grid; place-items: center; width: 22px; height: 22px;
    font: 800 .9rem/1 var(--f-ui); color: var(--gold-ink); background: var(--warn); border-radius: 50%; }
  .news-article-foot { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
  .news-article-foot .btn svg:not(.arrow) { width: 16px; height: 16px; }
  .news-aside { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 12px; padding: 18px; background: var(--plate-grad); border: 1px solid var(--line);
    animation: news-rise .7s .16s var(--ease) both; }
  .news-aside > .eyebrow { margin: 0 0 4px; }
  .news-row { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; margin: 0 -8px;
    transition: background-color .25s; }
  .news-row:hover { background: rgba(91, 135, 255, .08); }
  .news-row-media { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: var(--abyss); display: grid; place-items: center; color: var(--tone); }
  .news-row-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
  .news-row-media > svg { width: 26px; height: 26px; }
  .news-row:hover .news-row-media > img { transform: scale(1.08); }
  .news-row .news-chip { padding: 3px 0; background: none; border: 0; clip-path: none; backdrop-filter: none; font-size: .58rem; }
  .news-row h3 { margin: 4px 0; font: 700 .92rem/1.25 var(--f-title); color: var(--ice); overflow-wrap: anywhere; }
  .news-row:hover h3 { color: var(--gold-bright); }
  .news-row time { font: 500 .7rem/1 var(--f-mono); color: var(--muted); }

  @media (max-width: 980px) {
    .news-layout { grid-template-columns: minmax(0, 1fr); }
    .news-aside { position: static; }
  }
  @media (max-width: 640px) {
    .news-lead { min-height: 0; grid-template-rows: auto auto; }
    .news-lead-media { position: relative; aspect-ratio: 16 / 10; }
    .news-lead::before { display: none; }
    .news-lead-media::after, .news-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--abyss), transparent 50%); }
    .news-lead-body { margin-top: -26px; padding: 0 18px 22px; }
    .news-lead-summary { font-size: var(--t-md); }
    .news-hero { min-height: 0; grid-template-rows: auto auto; }
    .news-hero-media { position: relative; aspect-ratio: 16 / 10; }
    .news-hero::before { display: none; }
    .news-hero-copy { margin-top: -30px; padding: 0 16px 20px; }
    .news-body ol > li { padding-left: 52px; }
    .news-body > p:first-child::first-letter { font-size: 3em; }
  }
  @media (prefers-reduced-motion: reduce) {
    .news-lead, .news-grid > li, .news-hero-copy, .news-article, .news-aside, .news-new, .news-lead-media > img, .news-hero-media > img { animation: none; }
  }
}

/* Tienda: distinguir las ilustraciones de moneda y adaptar sus saldos. */
@layer pages {
#wcoin-root > nav.actions { margin: 1.25rem 0; display:flex; flex-wrap:wrap; gap:.6rem; }
#wcoin-root > .grid { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
}

/* Progresión: una columna ordenada. Franja del personaje y secciones con filas
   (título · datos · acción); en móvil cada fila se apila. */
@layer pages {
  .progress-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .progress-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px 24px; margin: 0; padding: 16px 22px; border-color: var(--gold-line); }
  .progress-strip .portrait { margin: 0; }
  .progress-strip-name h2 { margin: 0; font-size: 1.5rem; overflow-wrap: anywhere; }
  .progress-strip-name .character-class { margin: 2px 0 0; }
  .progress-strip-facts { display: grid; grid-template-columns: repeat(4, minmax(72px, auto)); gap: 0; margin: 0; border: 1px solid var(--line); }
  .progress-strip-facts > div { padding: 8px 14px; border-left: 1px solid var(--line); }
  .progress-strip-facts > div:first-child { border-left: 0; }
  .progress-strip-facts dt, .progress-row-facts dt { font: 500 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .progress-strip-facts dd, .progress-row-facts dd { margin: 5px 0 0; font: 600 1.2rem/1 var(--f-display); color: var(--ice); font-variant-numeric: tabular-nums; }

  .progress-section { margin: 0; padding: clamp(16px, 2.4vw, 26px); scroll-margin-top: calc(var(--header-h) + 18px); }
  .progress-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 16px; }
  .progress-section-head h2 { margin: 0; font-size: 1.3rem; }
  .progress-rows { display: grid; border: 1px solid var(--line); }
  .progress-row.progress-card, .progress-row, .evolution-mode { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(150px, .8fr) minmax(300px, 1.7fr); align-items: center; gap: 12px 24px;
    margin: 0; padding: 16px 18px; border: 0; border-top: 1px solid var(--line); background: rgba(3, 6, 13, .42); box-shadow: none; }
  .progress-row:first-child, .evolution-mode:first-child { border-top: 0; }
  .progress-row:hover, .evolution-mode:hover { background: rgba(148, 180, 255, .045); }
  .progress-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .progress-row-title h3 { margin: 0; font: 600 1.02rem/1.25 var(--f-title); letter-spacing: .05em; color: var(--ice); }
  .progress-row-facts { display: flex; gap: 22px; margin: 0; }
  .progress-row-action { display: flex; justify-content: flex-end; min-width: 0; }
  .progress-row-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: var(--t-sm); }
  .progress-row .progress-form { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: end; gap: 12px; width: 100%; margin: 0; }
  .progress-row .progress-form .form-field { margin: 0; }
  .progress-row .progress-form .form-field > span:first-child { font: 500 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .progress-row .progress-input input { min-width: 0; }
  .progress-row .progress-total { display: grid; gap: 4px; margin: 0; min-width: 120px; }
  .progress-row .progress-total span { font: 500 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .progress-row .progress-total strong { font: 600 1.3rem/1.1 var(--f-display); white-space: nowrap; }
  .progress-row .tip-host .btn-gold { width: auto; min-width: 128px; }

  .evolution-path { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 18px; margin: 0 0 14px;
    border: 1px solid var(--gold-line); background: var(--plate-2); }
  .evolution-path > div > span, .evolution-payment > span { display: block; font: 500 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
  .evolution-path strong { display: block; font: 650 1.2rem/1.25 var(--f-display); color: var(--ice); overflow-wrap: anywhere; }
  .evolution-path > div:nth-child(3) strong { color: var(--gold-bright); }
  .evolution-path small { color: var(--muted); font-size: .85rem; }
  .evolution-arrow { width: 24px; height: 24px; color: var(--gold); }
  .evolution-level { padding-left: 18px; border-left: 1px solid var(--line); }
  .evolution-context { color: var(--muted); font-size: var(--t-sm); margin: 0 0 12px; }
  .evolution-card > .note { margin: 0 0 12px; }
  .evolution-modes > .evolution-mode { grid-template-columns: minmax(0, 2.2fr) minmax(140px, .7fr) minmax(170px, .7fr); align-items: start; }
  .evolution-mode-info { display: grid; gap: 8px; min-width: 0; }
  .evolution-mode-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
  .evolution-mode h3 { font: 600 1.02rem/1.25 var(--f-title); letter-spacing: .05em; color: var(--ice); margin: 0; }
  .evolution-description { font-size: var(--t-sm); color: var(--text); margin: 0; }
  .evolution-mode .note { margin: 0; }
  .evolution-details ul { margin: 0; padding-left: 18px; font-size: var(--t-sm); color: var(--muted); }
  .evolution-details p { margin: 6px 0 0; color: var(--ok); font-size: var(--t-sm); }
  .evolution-payment strong { display: block; font: 650 1.25rem/1.2 var(--f-display); color: var(--gold-bright); white-space: nowrap; }
  .evolution-payment small { display: block; margin-top: 5px; color: var(--muted); font-size: .8rem; }
  .evolution-payment .evolution-missing { color: var(--warn); }
  .evolution-mode .progress-row-action { margin: 0; }
  .evolution-mode .progress-row-action button { width: 100%; min-height: 46px; white-space: normal; line-height: 1.25; }
  .evolution-missions-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; }
  .evolution-missions-link svg { width: 14px; height: 14px; }

  @media (max-width: 980px) {
    .progress-strip { grid-template-columns: auto minmax(0, 1fr); }
    .progress-strip-facts { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .progress-strip > .text-link { grid-column: 1 / -1; justify-self: start; }
    .progress-row.progress-card, .progress-row { grid-template-columns: minmax(0, 1fr) auto; }
    .progress-row-action { grid-column: 1 / -1; justify-content: stretch; }
    .evolution-modes > .evolution-mode { grid-template-columns: minmax(0, 1fr) auto; }
    .evolution-mode-info { grid-column: 1 / -1; }
    .evolution-mode .progress-row-action { grid-column: auto; align-self: end; }
  }
  @media (max-width: 560px) {
    .progress-strip { padding: 14px; gap: 12px; }
    .progress-strip-facts > div { padding: 8px 10px; }
    .progress-row .progress-form { grid-template-columns: minmax(0, 1fr) auto; }
    .progress-row .progress-form .form-field { grid-column: 1 / -1; }
    .progress-row .tip-host, .progress-row .tip-host .btn-gold { width: 100%; }
    .evolution-modes > .evolution-mode { grid-template-columns: minmax(0, 1fr); }
    .evolution-mode .progress-row-action { grid-column: 1; }
    .evolution-path { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); padding: 12px; }
    .evolution-level { grid-column: 1 / -1; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  }
}


/* ------- Comunidad Discord y recompensa de bienvenida ------- */
@layer components {
  .discord-icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; fill: currentColor; }
  .discord-link { color: var(--azure-bright); }
  .discord-link:hover { color: var(--frost); text-decoration: none; }
  .discord-link:focus-visible { outline: 2px solid var(--azure-bright); outline-offset: 4px; }
  .discord-header { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--line-strong); background: var(--plate); color: var(--azure-bright); }
  .discord-header:hover { color: var(--ice); border-color: var(--azure); background: var(--plate-3); }
  .discord-header .discord-icon { width: 22px; height: 22px; }
  .footer-col .discord-footer, .panel-nav .discord-link { display: flex; align-items: center; gap: 9px; color: var(--azure-bright); }
  .account-links .discord-icon { color: var(--azure-bright); }
  .discord-community-wrap { margin-block: clamp(12px, 2vw, 24px); }
  .discord-community { min-height: 265px; display: flex; align-items: center; padding: clamp(18px,4vw,46px); overflow: hidden;
    background: linear-gradient(90deg,var(--abyss),color-mix(in srgb,var(--night) 78%,transparent) 48%,transparent 100%), url("wallpapers/discord-reward.webp") center right/cover no-repeat, var(--plate); }
  .discord-community-copy { position: relative; max-width: min(590px,100%); width: 100%; }
  .discord-community-copy .eyebrow { display: flex; align-items: center; gap: 10px; }
  .discord-community-copy h2 { margin-block: 7px 14px; color: var(--ice); font-size: clamp(1.35rem,2.5vw,2.15rem); }
  .discord-reward-amounts { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; max-width: 660px; margin: 0 0 18px; }
  .discord-reward-amounts img { grid-row: span 2; width: 32px; height: 32px; object-fit: contain; }
  .discord-reward-amounts > div { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 0 10px; border: 1px solid var(--line-strong); padding: 9px 12px; background: color-mix(in srgb,var(--plate) 85%,transparent); }
  .discord-reward-amounts svg { grid-row: span 2; width: 30px; height: 30px; color: var(--gold); }
  .discord-reward-amounts > div:nth-child(2) svg { color: var(--ok); }
  .discord-reward-amounts dt { font: 600 var(--t-xs)/1.25 var(--f-ui); color: var(--text); }
  .discord-reward-amounts dd { margin: 2px 0 0; font: 700 1.45rem/1.1 var(--f-title); color: var(--gold-bright); }
  dialog.modal--discord { width: min(620px,calc(100vw - 24px)); }
  .modal--discord .modal-shell { background: var(--plate-grad); }
  .discord-modal-head { min-height: 150px; align-items: flex-end; background: linear-gradient(90deg,var(--abyss),color-mix(in srgb,var(--night) 72%,transparent) 55%,transparent), url("wallpapers/discord-link.webp") center right/cover no-repeat; border-bottom: 1px solid var(--line); }
  .discord-modal-head h2 { display: flex; align-items: center; gap: 9px; color: var(--ice); }
  .discord-modal-head h2 .discord-icon { width: 25px; height: 25px; color: var(--azure-bright); }
  .discord-modal-body { display: grid; gap: 12px; padding-top: 16px; }
  .discord-modal-body .discord-reward-amounts { max-width: none; margin: 0; }
  .discord-modal-state { display: flex; gap: 9px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); color: var(--text); background: var(--deep); font: 500 var(--t-sm)/1.35 var(--f-ui); }
  .discord-modal-state[data-tone="ok"] { color: var(--ok); border-color: var(--ok); }
  .discord-modal-state[data-tone="warn"] { color: var(--warn); }
  .discord-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .discord-steps li { display: flex; gap: 8px; min-width: 0; align-items: flex-start; border: 1px solid var(--line); padding: 9px; }
  .discord-steps li > span { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 1px solid var(--gold-line); color: var(--gold); font: 700 var(--t-sm)/1 var(--f-mono); }
  .discord-steps li > div { display: grid; gap: 6px; min-width: 0; font-size: var(--t-sm); }
  .discord-steps .btn { min-width: 0; white-space: normal; text-align: center; }
  .modal--discord [hidden] { display: none !important; }

  /* Vista /cuenta/discord: tres pasos con estado real y ventajas de la comunidad */
  .discord-title-icon { width: .9em; height: .9em; margin-right: .3em; color: var(--azure-bright); vertical-align: -.08em; }
  .discord-hub { padding: 0; overflow: hidden; }
  .discord-hub-hero { padding: clamp(20px, 3.6vw, 40px); border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, var(--abyss), color-mix(in srgb, var(--night) 74%, transparent) 55%, transparent), url("wallpapers/discord-link.webp") center right/cover no-repeat, var(--plate); }
  .discord-hub-hero .eyebrow { display: flex; align-items: center; gap: 8px; }
  .discord-hub-hero h2 { margin: 8px 0 16px; color: var(--ice); font-size: clamp(1.3rem, 2.4vw, 2rem); }
  .discord-hub-hero .discord-reward-amounts { margin: 0; }
  .discord-hub-hero .note { max-width: 520px; margin: 16px 0 0; }
  .discord-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .discord-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-content: start; padding: clamp(16px, 2.4vw, 26px); border-right: 1px solid var(--line); }
  .discord-step:last-child { border-right: 0; }
  .discord-step-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font: 700 1rem/1 var(--f-mono); }
  .discord-step-mark svg { width: 20px; height: 20px; }
  .discord-step[data-state="current"] { background: linear-gradient(180deg, rgba(228, 185, 98, .07), transparent 70%); }
  .discord-step[data-state="current"] .discord-step-mark { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 0 4px rgba(228, 185, 98, .12); }
  .discord-step[data-state="done"] .discord-step-mark { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
  .discord-step[data-state="pending"] { opacity: .62; }
  .discord-step-body { display: grid; gap: 10px; align-content: start; min-width: 0; }
  .discord-step-body h3 { margin: 6px 0 0; font: 600 1rem/1.2 var(--f-title); letter-spacing: .05em; color: var(--ice); }
  .discord-step-body p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
  .discord-step-body .action-bar { margin: 0; }
  .discord-code-form { display: grid; gap: 10px; }
  .discord-code-form .btn-gold, .discord-step-body form .btn-gold { width: 100%; }
  .discord-perks { margin-top: clamp(22px, 3vw, 34px); }
  .discord-perks h2 { margin: 0 0 12px; font: 600 .78rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
  .discord-perks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
  .discord-perk { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line); background: rgba(3, 6, 13, .55); }
  .discord-perk svg { width: 30px; height: 30px; color: var(--azure-bright); }
  .discord-perk h3 { margin: 2px 0 4px; font: 600 .92rem/1.2 var(--f-title); letter-spacing: .05em; color: var(--ice); }
  .discord-perk p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
  .discord-unlink { display: flex; justify-content: flex-end; margin-top: 18px; }
  @media (max-width: 860px) {
    .discord-track { grid-template-columns: 1fr; }
    .discord-step { border-right: 0; border-bottom: 1px solid var(--line); }
    .discord-step:last-child { border-bottom: 0; }
    .discord-hub-hero { background-image: linear-gradient(90deg, var(--abyss), color-mix(in srgb, var(--night) 80%, transparent)), url("wallpapers/discord-link.webp"); background-position: 70% center; }
    .discord-unlink { justify-content: stretch; }
    .discord-unlink button { width: 100%; }
  }
  @media (max-width: 620px) {
    dialog.modal--discord { width: 100vw; }
    .discord-community { min-height: 295px; background-position: 70% center; background-image: linear-gradient(90deg,var(--abyss),color-mix(in srgb,var(--night) 76%,transparent)),url("wallpapers/discord-reward.webp"); }
    .discord-community .action-bar > * { flex: 1 1 100%; }
    .discord-modal-head { min-height: 120px; }
    .discord-steps { grid-template-columns: 1fr; }
    .discord-reward-amounts > div { gap: 0 6px; padding: 8px; grid-template-columns: 24px minmax(0,1fr); }
    .discord-reward-amounts svg { width: 23px; height: 23px; }
    .discord-reward-amounts { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .discord-reward-amounts img { width: 24px; height: 24px; }
    .discord-reward-amounts dd { font-size: 1.15rem; }
  }
  @media (max-width: 400px) { .discord-header { width: 36px; height: 36px; } .discord-header .discord-icon { width: 20px; height: 20px; } }
}
@layer layout {
  @media(min-width:1181px) and (max-width:1360px) { .site-header .wrap { gap: 14px; } .primary-nav a { padding-inline: 10px; } }
  @media(max-width:400px) { .header-actions { gap: 6px; } }
}

/* Separador vertical del menú «Mi cuenta» */
@layer components {
  .dock-sep { flex: none; align-self: center; width: 1px; height: 22px; margin: 0 6px; background: linear-gradient(180deg, transparent, var(--gold-line), transparent); }
  @media (max-width: 520px) { .dock-sep { margin: 0 2px; height: 18px; } }
}
@layer components {
  .dropdown-panel .dropdown-coin { width: 32px; height: 32px; object-fit: contain; }
  .discord-reward-amounts img { grid-row: span 2; width: 32px; height: 32px; object-fit: contain; }
}

/* Regalo diario · bonificación de Discord Coins */
@layer pages {
  .daily-shell > .daily-discord-bonus {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
    padding: 8px 12px; margin: 0 0 16px; border: 1px solid var(--line);
    background: var(--night); border-radius: 8px;
  }
  .daily-discord-bonus img { object-fit: contain; }
  .daily-discord-bonus strong { color: var(--ice); }
  .daily-discord-status { flex: 1 1 100%; font-size: .86rem; }
}

/* Discord · pestañas, resumen, cartera de Discord Coins y Mercado */
@layer pages {
  .discord-tabs a { gap: 9px; }
  .discord-tabs svg { width: 18px; height: 18px; }
  .discord-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0; margin: 0 0 20px; border: 1px solid var(--line); background: rgba(3, 6, 13, .5); }
  .discord-summary > div { padding: 14px 18px; border-left: 1px solid var(--line); }
  .discord-summary > div:first-child { border-left: 0; }
  .discord-summary dt { font: 500 .66rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .discord-summary dd { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font: 600 1.05rem/1.2 var(--f-title); letter-spacing: .03em; color: var(--ice); }
  .discord-summary dd img, .discord-summary dd svg { width: 28px; height: 28px; flex: none; object-fit: contain; }
  .discord-summary dd svg { color: var(--azure-bright); }
  .discord-summary [data-tone="ok"] dd { color: var(--ok); }
  .discord-summary [data-tone="gold"] dd { color: var(--gold-bright); }

  .dc-wallet { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; margin: 22px 0; padding: clamp(18px, 3vw, 30px);
    overflow: hidden; border-color: var(--line-strong);
    background: linear-gradient(90deg, var(--abyss) 18%, color-mix(in srgb, var(--night) 70%, transparent) 62%, transparent), url("wallpapers/discord-coins.webp") right center / cover no-repeat, var(--plate); }
  .dc-wallet-art { width: clamp(96px, 12vw, 148px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px rgba(120, 130, 255, .35)); animation: art-float 4s ease-in-out infinite; }
  .dc-wallet-body .eyebrow { display: flex; align-items: center; gap: 8px; }
  .dc-wallet-body h2 { margin: 6px 0 8px; display: flex; align-items: baseline; gap: 10px; }
  .dc-wallet-body h2 strong { font: 600 clamp(2.2rem, 1.6rem + 2.2vw, 3.4rem)/1 var(--f-display); color: var(--ice); font-variant-numeric: lining-nums tabular-nums; }
  .dc-wallet-body h2 span { font: 600 1rem/1 var(--f-mono); letter-spacing: .14em; color: #a9b2ff; }
  .dc-wallet-status { display: flex; align-items: center; gap: 9px; margin: 0; max-width: 46ch; color: var(--text); font-size: var(--t-sm); }
  .dc-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--muted); }
  .dc-wallet-status[data-tone="ok"] .dc-dot { background: var(--ok); }
  .dc-wallet-status[data-tone="gold"] .dc-dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
  .dc-wallet-status[data-tone="info"] .dc-dot { background: var(--azure-bright); }
  .dc-wallet-status[data-tone="warn"] .dc-dot { background: var(--warn); }
  .dc-wallet-actions { display: grid; gap: 10px; min-width: 220px; }
  .dc-wallet-actions form { margin: 0; }
  .dc-wallet-actions .btn, .dc-wallet-actions button { width: 100%; justify-content: center; }
  .dc-wallet-actions .btn-secondary { background: rgba(6, 9, 20, .88); border-color: var(--line-strong); color: var(--ice); backdrop-filter: blur(4px); }
  .dc-wallet-actions .btn-secondary:hover { border-color: #8f98ff; background: rgba(20, 24, 52, .95); }
  .dc-wallet-actions img, .dc-wallet-actions svg { width: 22px; height: 22px; object-fit: contain; }

  .dc-market { margin: 26px 0; scroll-margin-top: calc(var(--header-h) + 18px); }
  .dc-market-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
  .dc-market-head h2 { margin: 0; }
  .dc-market-rules { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .dc-market-rules li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); background: rgba(3, 6, 13, .5); color: var(--muted); font-size: .82rem; }
  .dc-market-rules svg { width: 15px; height: 15px; color: var(--gold); }
  .dc-market > .note { margin: 0 0 14px; }
  .dc-market-sub { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; color: var(--muted); font-size: var(--t-sm); }
  .dc-market-sub svg { width: 15px; height: 15px; flex: none; color: #a9b2ff; }
  .segmented--scroll { grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .segmented--scroll::-webkit-scrollbar { display: none; }
  .segmented--scroll > a { white-space: nowrap; }
  .dc-race-filter { background: rgba(4, 8, 19, .72); }
  .dc-offer-tags { display: flex; align-items: center; justify-content: space-between; gap: 8px; align-self: stretch; }
  .dc-offer-tags .dc-offer-cat { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dc-offer-time { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; font: 600 .64rem/1 var(--f-mono); letter-spacing: .08em; color: var(--gold-bright); border: 1px solid rgba(228, 185, 98, .4); background: rgba(228, 185, 98, .1); }
  .dc-offer-time svg { width: 12px; height: 12px; }
  .dc-offer-race { margin: -4px 0 0; color: #b9c0ff; font: 600 var(--t-xs)/1.3 var(--f-ui); letter-spacing: .02em; }
  .dc-offer-stats { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.4; text-wrap: balance; }
  .dc-offer-pieces { align-self: stretch; text-align: left; border: 1px solid var(--line); background: rgba(3, 6, 13, .45); }
  .dc-offer-pieces summary { cursor: pointer; padding: 7px 10px; font: 600 var(--t-xs)/1.2 var(--f-ui); color: var(--ice); list-style: none; display: flex; justify-content: space-between; }
  .dc-offer-pieces summary::-webkit-details-marker { display: none; }
  .dc-offer-pieces summary::after { content: "+"; color: var(--gold); }
  .dc-offer-pieces[open] summary::after { content: "−"; }
  .dc-offer-pieces ul { margin: 0; padding: 4px 10px 9px 24px; color: var(--text); font-size: .8rem; line-height: 1.55; }
  .dc-rental-expiry { display: grid; gap: 2px; }
  .dc-rental-expiry small { font: 600 var(--t-xs)/1.2 var(--f-mono); color: var(--ok); }
  .dc-rental-expiry small[data-tone="warn"] { color: var(--warn); }
  .dc-rental-expiry small[data-tone="muted"] { color: var(--muted); }
  .dc-market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
  .dc-offer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 16px 16px 18px; text-align: center;
    border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(120, 130, 255, .07), transparent 55%), var(--plate);
    transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
  .dc-offer:hover { transform: translateY(-4px); border-color: #8f98ff; box-shadow: 0 12px 30px rgba(60, 70, 200, .25); }
  .dc-offer-cat { padding: 4px 9px; font: 600 .64rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #b9c0ff; border: 1px solid rgba(143, 152, 255, .4); background: rgba(88, 101, 242, .12); }
  .dc-offer-figure { display: grid; place-items: center; width: 132px; height: 132px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 45%, rgba(120, 130, 255, .18), transparent 70%), var(--abyss); }
  .dc-offer-figure img { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .7)); transition: transform .3s var(--ease); }
  .dc-offer:hover .dc-offer-figure img { transform: scale(1.07); }
  .dc-offer h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-height: 2.5em; margin: 0; font: 600 .98rem/1.25 var(--f-title); letter-spacing: .04em; color: var(--ice); overflow-wrap: anywhere; }
  .dc-offer-form { display: grid; gap: 10px; width: 100%; margin-top: auto; }
  .dc-offer-form .form-field { margin: 0; text-align: left; }
  .dc-offer-price { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--muted); font: 600 .8rem var(--f-mono); letter-spacing: .1em; }
  .dc-offer-price img { width: 28px; height: 28px; object-fit: contain; }
  .dc-offer-price strong { font: 600 1.6rem/1 var(--f-display); letter-spacing: 0; color: #c9ceff; font-variant-numeric: tabular-nums; }
  .dc-offer-form button { width: 100%; }
  .dc-offer-short { color: var(--warn); font-size: .8rem; }
  .dc-offer[data-affordable="0"] .dc-offer-figure img { filter: grayscale(.35) drop-shadow(0 6px 12px rgba(0, 0, 0, .7)); }
  .dc-history { margin: 26px 0; }
  .dc-history-cost { color: #c9ceff; font-variant-numeric: tabular-nums; white-space: nowrap; }

  @media (max-width: 860px) {
    .dc-wallet { grid-template-columns: auto minmax(0, 1fr);
      background-image: linear-gradient(90deg, var(--abyss), color-mix(in srgb, var(--night) 82%, transparent)), url("wallpapers/discord-coins.webp"); background-position: 70% center; }
    .dc-wallet-actions { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); min-width: 0; }
  }
  @media (max-width: 520px) {
    .dc-wallet { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .dc-wallet-art { justify-self: center; }
    .dc-wallet-body .eyebrow, .dc-wallet-body h2, .dc-wallet-status { justify-content: center; margin-inline: auto; }
    .dc-wallet-status { display: block; }
    .dc-dot { display: inline-block; margin-right: 7px; vertical-align: middle; }
    .discord-summary > div { border-left: 0; border-top: 1px solid var(--line); }
    .discord-summary > div:first-child { border-top: 0; }
    .dc-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dc-offer { padding: 12px 10px 14px; }
    .dc-offer-figure { width: 100%; height: 108px; }
    .dc-offer-figure img { width: 92px; height: 92px; }
  }
}

/* OffAttack · iniciar: contraseña | recogida | botón, alineados en una fila y apilados en móvil */
@layer pages {
  .af-action-form.af-start { display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr) auto; align-items: stretch; gap: 14px 22px; }
  .af-start .form-field, .af-start .saved-secret { max-width: none; align-self: stretch; margin: 0; }
  .af-start > .check { grid-column: 1; margin: 0; }
  .af-start .af-pickup { grid-column: 2; grid-row: 1 / span 2; align-content: start; gap: 10px; padding: 12px 16px 14px; border: 1px solid var(--line); background: rgba(3, 6, 13, .42); }
  .af-start .af-pickup > .field-label { margin: 0; }
  .af-start .af-pickup-options { display: flex; flex-wrap: wrap; gap: 10px; }
  .af-start .af-pickup .check { flex: 1 1 180px; min-height: 46px; padding: 0 14px; align-items: center; border: 1px solid var(--line-strong); background: var(--deep); }
  .af-start > button[type="submit"] { grid-column: 3; grid-row: 1 / span 2; align-self: center; min-width: 170px; min-height: 54px; }
  @media (max-width: 980px) {
    .af-action-form.af-start { grid-template-columns: minmax(0, 1fr); }
    .af-start > .check, .af-start .af-pickup, .af-start > button[type="submit"] { grid-column: 1; grid-row: auto; }
    .af-start > button[type="submit"] { width: 100%; }
  }
}

@layer pages {
/* Original MU Libre VIP artwork; responsive, accessible tiers. */
.vip-tier-1{--vip-color:#d7a27a;--vip-bg:url("vip/bg-1.webp")}
.vip-tier-2{--vip-color:#a8d8ff;--vip-bg:url("vip/bg-2.webp")}
.vip-tier-3{--vip-color:#ffda70;--vip-bg:url("vip/bg-3.webp")}
.vip-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1rem 0 1.5rem}
.vip-plan{padding:0!important;overflow:hidden;border:1px solid var(--vip-color);display:flex;flex-direction:column}
.vip-art{min-height:178px;padding:1.15rem;background-image:linear-gradient(90deg,#080a11d9,#080a1166),var(--vip-bg);background-size:cover;background-position:center;color:#fff}
.vip-art img{width:76px;height:76px;object-fit:contain;filter:drop-shadow(0 4px 8px #000)}
.vip-art h2{color:var(--vip-color);margin:.15rem 0;font-size:1.25rem}
.vip-plan-body{display:flex;flex-direction:column;flex:1;padding:1rem;gap:.75rem}
.vip-price{color:var(--vip-color);font-size:1.75rem;font-weight:800;margin:0}.vip-price small{font-size:.9rem}
.vip-benefits{display:grid;gap:.55rem;padding:0;margin:0;list-style:none}
.vip-benefits li{display:flex;align-items:flex-start;gap:.55rem;padding:.35rem 0;border-bottom:1px solid #ffffff18;line-height:1.25}
.vip-benefits svg{width:1.1rem;height:1.1rem;flex:none;color:var(--vip-color)}
.vip-benefits strong{display:block;margin-top:.2rem;color:var(--vip-color)}
.vip-plan form{margin-top:auto;display:grid;gap:.4rem}.vip-plan button{width:100%}
.vip-status{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.8rem;border-color:var(--vip-color,currentColor)}
.vip-notice{color:#ffd47c;font-weight:600}
@media(max-width:1050px){.vip-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.vip-grid{grid-template-columns:minmax(0,1fr)}.vip-art{min-height:150px}.vip-status{align-items:flex-start;flex-direction:column}}

}

@layer pages {
  .vip-badge[hidden], .vip-status [hidden], .vip-art [hidden], .vip-notice[hidden] { display: none !important; }
}

/* Ranking v2: barra de filtros, tu puesto, salón de la fama por semanas, pie y comparador */
@layer components {
  .vip-badge { flex: none; justify-self: start; width: max-content; }
}
@layer pages {
  .rank-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px;
    border: 1px solid var(--line); background: rgba(6, 10, 22, .78); }
  .rank-toolbar label { flex: 1 1 170px; margin: 0; }
  .rank-toolbar .rank-search { flex: 2 1 240px; }
  .rank-toolbar input, .rank-toolbar select { width: 100%; margin: 0; min-height: 44px; }
  .rank-clear { font: 600 var(--t-sm) var(--f-ui); color: var(--azure-bright); white-space: nowrap; }
  .rank-total { margin-left: auto; padding: 0 6px; font: 500 var(--t-sm) var(--f-mono); color: var(--muted); white-space: nowrap; }
  .rank-total b { font: 600 1.2rem/1 var(--f-display); color: var(--gold-bright); margin-right: 4px; }
  .rank-note { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; color: var(--muted); font-size: var(--t-sm); }
  .rank-note svg { width: 16px; height: 16px; flex: none; color: var(--azure-bright); }
  .rank-staff { flex: none; padding: 3px 8px; font: 600 .62rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
    color: var(--azure-bright); border: 1px solid rgba(110, 160, 255, .45); background: rgba(91, 135, 255, .12); }

  .rank-me { display: grid; gap: 8px; margin: 0 0 24px; }
  .rank-me-row { display: grid; grid-template-columns: auto 46px auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 18px;
    border: 1px solid var(--gold-line); border-left: 3px solid var(--gold); background: linear-gradient(90deg, rgba(228, 185, 98, .14), rgba(3, 6, 13, .6) 55%); }
  .rank-me-label { font: 600 .66rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); }
  .rank-me .lb-rank { color: var(--gold-bright); font-size: 1.6rem; }

  .rank-hall { margin: 0 0 8px; }
  .rank-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; }
  .rank-section-head h2 { margin: 0; }
  .rank-section-head .board-count { display: inline-flex; align-items: center; gap: 8px; }
  .hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
  .hall-week { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(228, 185, 98, .07), transparent 60%), var(--plate); }
  .hall-week.is-latest { border-color: var(--gold-line); box-shadow: 0 0 0 1px rgba(228, 185, 98, .15), 0 16px 34px rgba(0, 0, 0, .35); }
  .hall-week > header { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .hall-week > header small { display: block; font: 500 .64rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .hall-week > header strong { display: block; margin-top: 5px; font: 600 1.05rem/1.1 var(--f-title); letter-spacing: .05em; color: var(--ice); }
  .hall-crown { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 1px solid var(--gold-line); color: var(--gold-bright); }
  .hall-crown svg { width: 20px; height: 20px; }
  .hall-winner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }

  .rank-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
  .rank-updated { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 500 var(--t-sm) var(--f-mono); }
  .rank-updated svg { width: 16px; height: 16px; }
  .rank-foot .btn svg { width: 18px; height: 18px; }

  .compare-toolbar label { flex: 1 1 200px; }
  .compare-toolbar .btn-gold { flex: none; min-width: 150px; }
  .compare-vs { flex: none; font: 700 .9rem/1 var(--f-display); letter-spacing: .1em; color: var(--gold); }
  .compare-board { padding: clamp(18px, 3vw, 30px); }
  .compare-heads { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
  .compare-head { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
  .compare-head .sigil { --s: clamp(90px, 14vw, 140px); border: 2px solid var(--gold-line); box-shadow: 0 16px 34px rgba(0, 0, 0, .5); }
  .compare-head h2 { margin: 6px 0 0; max-width: 100%; font-size: clamp(1.1rem, .9rem + 1vw, 1.6rem); overflow-wrap: anywhere; }
  .compare-head p { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: var(--t-sm); }
  .compare-head.is-empty { opacity: .6; }
  .compare-head.is-empty .sigil { border-style: dashed; box-shadow: none; }
  .compare-vs--big { font-size: clamp(1.4rem, 1rem + 2vw, 2.4rem); text-shadow: 0 0 22px rgba(228, 185, 98, .35); }
  .compare-table { width: 100%; margin-top: 22px; border-collapse: collapse; table-layout: fixed; }
  .compare-table thead th { padding: 0 0 8px; font: 600 .7rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .compare-table thead th:first-child { text-align: right; } .compare-table thead th:last-child { text-align: left; }
  .compare-table tbody th { width: 34%; padding: 11px 8px; font: 500 var(--t-sm) var(--f-ui); color: var(--muted); text-align: center; }
  .compare-table td { padding: 11px 14px; font: 600 1.15rem/1 var(--f-display); color: var(--frost); font-variant-numeric: tabular-nums; }
  .compare-table td:first-child { text-align: right; } .compare-table td:last-child { text-align: left; }
  .compare-table tbody tr { border-top: 1px solid var(--line); }
  .compare-table td.is-better { color: var(--gold-bright); }
  .compare-table td.is-better:first-child { background: linear-gradient(270deg, rgba(228, 185, 98, .12), transparent); }
  .compare-table td.is-better:last-child { background: linear-gradient(90deg, rgba(228, 185, 98, .12), transparent); }

  @media (max-width: 760px) {
    .rank-toolbar label, .rank-toolbar .rank-search { flex: 1 1 100%; }
    .rank-toolbar label:not(.rank-search) { flex: 1 1 calc(50% - 5px); }
    .rank-total { margin-left: 0; }
    .rank-me-row { grid-template-columns: 38px auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
    .rank-me-label { grid-column: 1 / -1; }
    .compare-toolbar .compare-vs { display: none; }
    .compare-toolbar label, .compare-toolbar .btn-gold { flex: 1 1 100%; }
    .compare-heads { gap: 8px; }
    .compare-table td { padding: 10px 8px; font-size: 1rem; }
    .compare-table tbody th { font-size: .78rem; padding: 10px 4px; }
  }
  @media (max-width: 640px) {
    .lb-stat--main small { letter-spacing: .06em; font-size: .56rem; }
  }
  @media (max-width: 480px) {
    .rank-toolbar label:not(.rank-search) { flex: 1 1 100%; }
  }
}

@layer pages {
  .community-hero > img.profile-portrait { border-radius: 50%; border: 2px solid var(--gold-line); background: radial-gradient(circle at 50% 35%, #1b2a55, var(--abyss)); object-fit: cover; box-shadow: 0 0 0 6px rgba(228, 185, 98, .12), 0 18px 40px rgba(0, 0, 0, .55); }
  .page-public_character .board .facts small { color: var(--muted); font-size: .8rem; }
}

@layer pages {
  .security-layout { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 380px); gap: 20px; align-items: start; }
  .security-form { margin: 0; }
  .security-tips { margin: 0; }
  .security-tips h2 { margin: 0 0 14px; font-size: 1.15rem; }
  .security-tips ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
  .security-tips li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--muted); font-size: var(--t-sm); line-height: 1.45; }
  .security-tips li svg { width: 20px; height: 20px; margin-top: 1px; color: var(--gold); }
  .security-tips strong { display: block; color: var(--ice); }
  @media (max-width: 860px) { .security-layout { grid-template-columns: minmax(0, 1fr); } }
}

/* Distintivo VIP (components/vip_badge.html): misma silueta que el del MU PASS; metal por nivel. */
@layer components {
  .vip-tier-1 { --vb-1: #f6d2b0; --vb-2: #c78a5c; --vb-3: #8a5432; --vb-ink: #2a1406; --vb-glow: rgba(214, 145, 96, .45); }
  .vip-tier-2 { --vb-1: #ffffff; --vb-2: #c3d1e2; --vb-3: #8597b0; --vb-ink: #111a28; --vb-glow: rgba(176, 205, 240, .45); }
  .vip-tier-3 { --vb-1: #fff3c4; --vb-2: #ecc055; --vb-3: #ae7a1e; --vb-ink: #2b1b02; --vb-glow: rgba(240, 192, 80, .5); }
  .vip-badge { display: inline-flex; flex: none; align-items: center; gap: 5px; width: max-content; padding: 3px 9px 3px 7px; vertical-align: middle; white-space: nowrap;
    font: 800 .62rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--vb-ink, var(--gold-ink));
    background: linear-gradient(135deg, var(--vb-1, var(--gold-bright)), var(--vb-2, var(--gold)) 55%, var(--vb-3, var(--gold))); 
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); box-shadow: 0 0 16px -4px var(--vb-glow, transparent); }
  .vip-badge svg { width: 12px; height: 12px; flex: none; }
  .vip-badge--md { padding: 5px 12px 5px 9px; font-size: .72rem; }
  .vip-badge--md svg { width: 15px; height: 15px; }
  .vip-badge--tier { margin-left: 4px; padding: 2px 6px; gap: 3px; font-size: .58rem; letter-spacing: .08em; clip-path: none; box-shadow: none; }
  .vip-badge--tier svg { width: 10px; height: 10px; }
  .vip-badge[hidden] { display: none !important; }
}
@layer pages {
  .account-perks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
  .account-perk { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; text-decoration: none; }
  .account-perk:hover .pass-badge, .account-perk:hover .vip-badge { filter: brightness(1.12); }
  .account-perk--none, .account-vip-time { font: 600 var(--t-xs)/1 var(--f-ui); color: var(--muted); }
  .account-perk--none svg, .account-vip-none { width: 14px; height: 14px; flex: none; color: var(--muted); }
  .account-perk--none:hover, .account-vip:hover .account-vip-time { color: var(--gold-bright); }
  .account-vip .vip-badge:not([hidden]) ~ .account-vip-none { display: none; }
  .account-vip .vip-badge:not([hidden]) ~ .account-vip-time { font: 650 var(--t-xs)/1 var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums; }
  .account-pop-head .vip-notice { margin: 0; font: 600 var(--t-xs)/1.3 var(--f-ui); }
  .lb-name-line .vip-badge { padding: 2px 6px; font-size: .56rem; }
  @media (max-width: 640px) {
    .lb-name-line .vip-badge { padding: 3px; }
    .lb-name-line .vip-badge > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  }
}
@layer pages {
  .stage-balance--dc strong { color: var(--azure-bright, #9cc2ff); }
  .stage-piece.is-dc-flying img { filter: drop-shadow(0 0 14px rgba(120, 160, 255, .85)); }
}
/* MU Helper online: estado, inicio y sincronización del perfil en un solo bloque. */
@layer pages {
  .mh-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; margin: 18px 0 6px; padding: 14px 16px;
    border: 1px solid var(--line-strong); background: linear-gradient(90deg, rgba(228, 185, 98, .07), transparent 60%), rgba(3, 6, 13, .55); }
  .mh-control-state { display: grid; gap: 8px; min-width: 0; }
  .mh-control-state .status-row { margin: 0; }
  .mh-control-label { font: 600 .66rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
  .mh-control-run { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
  .mh-control-run button { min-width: 150px; }
  .mh-control-run svg { width: 16px; height: 16px; }
  .mh-control-sync { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 12px; border-top: 1px solid var(--line); }
  .mh-control-sync .mh-control-label { margin-right: 4px; }
  .mh-control-gap { flex: 1 1 auto; }
  .mh-setting--compact { max-width: 320px; }
  @media (max-width: 640px) {
    .mh-control { grid-template-columns: minmax(0, 1fr); }
    .mh-control-run { justify-content: stretch; }
    .mh-control-run button { flex: 1 1 140px; min-width: 0; }
    .mh-control-sync button { flex: 1 1 140px; }
    .mh-control-sync .mh-control-label { flex-basis: 100%; }
    .mh-control-gap { display: none; }
    .mh-setting--compact { max-width: none; }
  }
}
/* MU Helper online: estado en cuatro pasos, equipos vinculados y página de vínculo. */
@layer pages {
  .mh-stage-title { font: 600 1.15rem/1.2 var(--f-title); letter-spacing: .04em; color: var(--ice); }
  .mh-stage-hint { margin: 0; color: var(--muted); font-size: var(--t-sm); max-width: 60ch; }
  .mh-stage-hint:empty { display: none; }
  .mh-control[data-key="ready"] .mh-stage-title, .mh-control[data-key="running"] .mh-stage-title, .mh-control[data-key="route"] .mh-stage-title { color: var(--ok); }
  .mh-control[data-key="update"] .mh-stage-title, .mh-control[data-key="offline"] .mh-stage-title { color: var(--warn); }
  .mh-control-pills:has(> :not([hidden])) { margin-top: 2px; }
  .mh-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
  .mh-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: rgba(3, 6, 13, .45); }
  .mh-step-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); font: 700 .8rem/1 var(--f-mono); color: var(--muted); }
  .mh-step-body { display: grid; gap: 3px; min-width: 0; }
  .mh-step-body strong { font: 600 var(--t-sm)/1.2 var(--f-ui); color: var(--text); }
  .mh-step-body small { color: var(--muted); font-size: .78rem; line-height: 1.3; overflow-wrap: anywhere; }
  .mh-step[data-state="ok"] { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
  .mh-step[data-state="ok"] .mh-step-mark { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
  .mh-step[data-state="current"] { border-color: var(--gold); background: linear-gradient(90deg, rgba(228, 185, 98, .12), rgba(3, 6, 13, .45)); }
  .mh-step[data-state="current"] .mh-step-mark { border-color: var(--gold); color: var(--gold-bright); animation: mh-step-pulse 1.8s ease-in-out infinite; }
  .mh-step[data-state="pending"] { opacity: .6; }
  @keyframes mh-step-pulse { 50% { box-shadow: 0 0 0 4px rgba(228, 185, 98, .18); } }
  .mh-control-sync a.btn-sm svg { width: 15px; height: 15px; }
  .mh-step[data-state="current"] small { color: var(--gold-bright); font-weight: 600; }
  /* Todo en orden: los pasos se reducen a una fila de comprobaciones. */
  .mh-control:is([data-key="ready"], [data-key="running"], [data-key="route"]) .mh-steps { gap: 6px; }
  .mh-control:is([data-key="ready"], [data-key="running"], [data-key="route"]) .mh-step { grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 6px 10px; background: transparent; }
  .mh-control:is([data-key="ready"], [data-key="running"], [data-key="route"]) .mh-step-mark { width: 20px; height: 20px; font-size: .7rem; }
  .mh-control:is([data-key="ready"], [data-key="running"], [data-key="route"]) .mh-step-body small { display: none; }
  .mh-control:is([data-key="ready"], [data-key="running"], [data-key="route"]) .mh-step-body strong { font-size: .8rem; color: var(--muted); }
  @media (max-width: 900px) { .mh-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

  .helper-devices { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
  .helper-device { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: rgba(3, 6, 13, .45); }
  .helper-device form { margin: 0; }
  .helper-device-icon { width: 30px; height: 30px; color: var(--muted); }
  .helper-device[data-online="1"] { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
  .helper-device[data-online="1"] .helper-device-icon { color: var(--ok); }
  .helper-device-body { display: grid; gap: 2px; min-width: 0; }
  .helper-device-body strong { color: var(--ice); overflow-wrap: anywhere; }
  .helper-device-body small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
  .helper-device-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
  .helper-device--empty { grid-template-columns: 34px minmax(0, 1fr); border-style: dashed; }

  .helper-link-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 18px; align-items: start; margin: 0 0 24px; }
  .helper-link h2, .helper-link-devices h2 { margin: 6px 0 16px; font-size: clamp(1.2rem, 1rem + .8vw, 1.55rem); line-height: 1.2; }
  .helper-link h2 strong { color: var(--gold-bright); }
  .helper-link-code { margin: 0 0 10px; font: 700 clamp(2rem, 1.4rem + 2.6vw, 3.2rem)/1 var(--f-mono); letter-spacing: .14em; color: var(--ice); }
  .helper-link-help { margin: 0 0 18px; color: var(--muted); font-size: var(--t-sm); }
  .helper-link-form { display: flex; align-items: end; gap: 12px; max-width: 480px; margin: 0 0 22px; }
  .helper-link-form .form-field { flex: 1; margin: 0; }
  .helper-link-form input { font: 600 1.15rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
  .helper-link-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--text); font-size: var(--t-sm); line-height: 1.4; }
  .helper-link-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); background: rgba(3, 6, 13, .45); }
  .helper-link-steps strong { color: var(--gold-bright); }
  .helper-link-num { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--gold); color: var(--gold-bright); font: 700 .78rem/1 var(--f-mono); }
  .helper-link-devices-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
  .helper-link-devices-head h2 { margin: 0; }
  .helper-link-devices > .btn { width: 100%; justify-content: center; }
  .page-mu_helper_link_device { --banner: url("art/guardian-1672.webp"); --banner-pos: 50% 36%; }
  @media (max-width: 900px) { .page-mu_helper_link_device { --banner: url("art/guardian-900.webp"); } }
  @media (max-width: 1000px) { .helper-link-steps { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 860px) { .helper-link-layout { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 480px) {
    .helper-link-form { flex-direction: column; align-items: stretch; }
    .helper-device { grid-template-columns: 30px minmax(0, 1fr); }
    .helper-device form { grid-column: 1 / -1; }
    .helper-device form button { width: 100%; }
  }
}
@layer pages {
  .mh-stage-switch { justify-self: start; margin-top: 2px; }
  .mh-stage-switch svg { width: 15px; height: 15px; }
}
@layer pages {
  .mh-control button:disabled, .mh-control .btn-secondary[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
}
