/* D&D Companion — App Styles */
/* ============================================================
   DESIGN TOKENS — Tema "Arcano / Medianoche"
   Base azul medianoche/índigo, violeta arcano como primario,
   esmeralda de acento y oro viejo SOLO para detalles.
   Sofisticado, mágico, oscuro — nada de naranja sobre negro.

   NOTA DE MANTENIMIENTO: por compatibilidad se conservan los
   nombres heredados --stone-* y --amber-*, pero ahora apuntan a
   la nueva paleta:
     --stone-*  = neutrales índigo (antes piedra cálida)
     --amber-*  = VIOLETA primario (antes oro). El oro real vive
                  en --gold-* y se usa con cuentagotas.
   ============================================================ */
:root {
  /* --- Neutrales: azul medianoche / índigo --- */
  --stone-950: #0a0b12;
  --stone-900: #12141f;
  --stone-800: #1b1e2e;
  --stone-700: #2a2e44;
  --stone-600: #3d4263;
  --stone-500: #6b7094;
  --stone-400: #9ea3c4;
  --stone-300: #c4c7e0;
  --stone-200: #e8e6f0;
  --stone-100: #f4f3fa;

  /* --- Primario: violeta arcano (slot heredado "amber") --- */
  --amber-700: #5b21b6;
  --amber-600: #6d28d9;
  --amber-500: #8b5cf6;
  --amber-400: #a78bfa;
  --amber-300: #c4b5fd;

  /* --- Acento arcano (mismo familia violeta, para glows) --- */
  --arcane-700: #5b21b6;
  --arcane-600: #6d28d9;
  --arcane-500: #8b5cf6;
  --arcane-400: #a78bfa;
  --arcane-300: #c4b5fd;

  /* --- Oro real: SOLO detalles (logo, filetes, premium) --- */
  --gold-600: #a07d1f;
  --gold-500: #d4af37;
  --gold-400: #e8c766;

  /* --- Esmeralda: vitalidad / éxito / PV --- */
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --green-500: #10b981;
  --green-400: #34d399;

  /* --- Estados --- */
  --red-500:   #ef4444;
  --red-400:   #fb7185;
  --crimson-600: #be123c;
  --crimson-500: #e11d48;
  --blue-400:  #60a5fa;

  /* --- Tokens semánticos --- */
  --bg:            var(--stone-950);
  --surface:       var(--stone-900);
  --surface-2:     var(--stone-800);
  --border:        var(--stone-700);
  --border-strong: var(--stone-600);
  --text:          var(--stone-200);
  --text-muted:    var(--stone-400);
  --primary:       var(--amber-500);
  --primary-hover: var(--amber-400);
  --accent:        var(--emerald-400);
  --on-primary:    #ffffff;

  /* --- Tipografía --- */
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* --- Radios --- */
  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* --- Sombras y glows --- */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow-md: 0 6px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 14px 50px rgba(0,0,0,.6);
  /* --glow-gold conserva el nombre heredado pero ahora es el glow
     PRIMARIO (violeta). El glow de oro real es --glow-gold-detail. */
  --glow-gold:        0 0 22px rgba(var(--primary-rgb),.40);
  --glow-arcane:      0 0 22px rgba(var(--primary-rgb),.40);
  --glow-emerald:     0 0 20px rgba(52,211,153,.35);
  --glow-gold-detail: 0 0 14px rgba(212,175,55,.45);

  /* --- Easings y duraciones --- */
  --ease-smooth: cubic-bezier(.4, 0, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 150ms;
  --dur-normal: 280ms;
  --dur-slow: 600ms;

  /* --- Escala de espaciado (base 4px) --- */
  --space-1: .25rem;   /* 4px  */
  --space-2: .5rem;    /* 8px  */
  --space-3: .75rem;   /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* --- Capas (z-index) --- */
  --z-base: 1;
  --z-header: 100;
  --z-dice: 200;
  --z-dice-stage: 950;
  --z-modal: 1000;
  --z-toast: 1100;

  /* Tintes primarios (botones activos, focos, selecciones) */
  --primary-rgb: 139, 92, 246;
  --primary-deep-rgb: 91, 33, 182;
  --highlight-bg: color-mix(in srgb, var(--amber-600) 32%, var(--stone-900));

  /* --- Ancho de contenido --- */
  --content-max: 1100px;

  /* --- Ambiente / fondos (sobreescritos por paleta) --- */
  --ambient-top: rgba(var(--primary-rgb),.18);
  --ambient-tr: rgba(var(--primary-deep-rgb),.16);
  --ambient-bl: rgba(16,185,129,.07);
  --ambient-top-light: rgba(var(--primary-rgb),.10);
  --ambient-tr-light: rgba(var(--primary-deep-rgb),.08);
  --header-accent: rgba(var(--primary-rgb),.10);
  --selection-bg: rgba(var(--primary-rgb),.35);
  --selection-bg-light: rgba(var(--primary-rgb),.25);
  --avatar-gradient-a: #6d28d9;
  --avatar-gradient-b: #8b5cf6;

  /* Logo d20 (sigue la paleta de acentos) */
  --logo-body-top: #353a5c;
  --logo-body-bottom: #15131f;
  --logo-face-top: var(--amber-400);
  --logo-face-bottom: var(--amber-600);
  --logo-stroke: var(--amber-500);
  --logo-edge: var(--amber-600);
  --logo-face-stroke: var(--amber-300);
  --logo-number: var(--gold-400);
  --logo-glow-rgb: 139, 92, 246;

  /* Dados 3D */
  --dice-body: var(--amber-500);
  --dice-emissive: var(--amber-700);
  --dice-edge: var(--gold-400);
  --dice-rim: var(--amber-500);
  --dice-ambient: color-mix(in srgb, var(--amber-400) 55%, #ffffff);
  --dice-label-top: var(--amber-300);
  --dice-label-mid: var(--amber-400);
  --dice-label-bottom: var(--amber-600);

  /* Botones secundarios / contornos */
  --btn-secondary-bg: color-mix(in srgb, var(--amber-600) 20%, var(--stone-800));
  --btn-secondary-fg: var(--stone-100);
  --btn-secondary-border: color-mix(in srgb, var(--amber-600) 32%, var(--stone-700));
  --btn-secondary-bg-hover: color-mix(in srgb, var(--amber-500) 28%, var(--stone-800));
}

/* ---- Tema claro ---- */
html.light {
  color-scheme: light;
  --stone-950: #f4f3fa;
  --stone-900: #ffffff;
  --stone-800: #f0eef8;
  --stone-700: #ddd8ee;
  --stone-600: #b8b2d0;
  --stone-500: #7a7499;
  --stone-400: #5c5778;
  --stone-300: #3d3958;
  --stone-200: #2a2740;
  --stone-100: #12101f;

  --bg:            #f4f3fa;
  --surface:       #ffffff;
  --surface-2:     #f0eef8;
  --border:        #ddd8ee;
  --border-strong: #b8b2d0;
  --text:          #2a2740;
  --text-muted:    #5c5778;

  --shadow-sm: 0 1px 3px rgba(42,39,64,.08);
  --shadow-md: 0 6px 24px rgba(42,39,64,.10);
  --shadow-lg: 0 14px 50px rgba(42,39,64,.12);
  --glow-gold:        0 0 18px rgba(var(--primary-rgb),.25);
  --glow-arcane:      0 0 18px rgba(var(--primary-rgb),.25);
  --glow-emerald:     0 0 16px rgba(52,211,153,.20);
  --glow-gold-detail: 0 0 12px rgba(212,175,55,.30);

  --logo-body-top: #eceaf5;
  --logo-body-bottom: #c9c4dc;
  --highlight-bg: color-mix(in srgb, var(--amber-500) 14%, var(--surface));
  --btn-secondary-bg: color-mix(in srgb, var(--amber-500) 12%, var(--surface));
  --btn-secondary-fg: var(--amber-700);
  --btn-secondary-border: color-mix(in srgb, var(--amber-500) 28%, var(--border));
  --btn-secondary-bg-hover: color-mix(in srgb, var(--amber-500) 20%, var(--surface));
}

html.light body {
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, var(--ambient-top-light), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 0%, var(--ambient-tr-light), transparent 55%),
    radial-gradient(ellipse 55% 50% at 0% 100%, var(--ambient-bl), transparent 55%),
    var(--bg);
}

html.light .site-header {
  background: rgba(255,255,255,.92);
  border-bottom-color: var(--border);
}

html.light ::selection {
  background: var(--selection-bg-light);
  color: var(--stone-200);
}

html.light input:disabled,
html.light textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
}

html.light .card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), transparent 40%),
    var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html.light .card-title {
  color: var(--text);
}

html.light input[type=text],
html.light input[type=email],
html.light input[type=password],
html.light input[type=number],
html.light input[type=search],
html.light textarea,
html.light select {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html.light input:focus,
html.light textarea:focus,
html.light select:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber-500) 18%, transparent);
}

html.light .file-input-trigger {
  background: var(--surface);
  border-color: var(--border-strong);
}

html.light .file-input-trigger:hover {
  background: var(--surface-2);
}

html.light code {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

html.light .admin-tabs {
  border-bottom-color: var(--border);
}

html.light .admin-tab {
  color: var(--text-muted);
}

html.light .admin-tab:hover,
html.light .admin-tab-active {
  color: var(--amber-600);
  background: var(--surface-2);
}

html.light .admin-help .help-block {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

html.light .pricing-card,
html.light .ref-card {
  background: var(--surface);
  border-color: var(--border);
}

html.light .pricing-card.featured {
  background: color-mix(in srgb, var(--amber-500) 6%, var(--surface));
}

html.light .user-dropdown {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

html.light .dropdown-item {
  color: var(--text);
}

html.light .dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

html.light .theme-btn {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}

html.light .theme-btn.active {
  background: color-mix(in srgb, var(--amber-500) 12%, var(--surface));
  border-color: var(--amber-500);
  color: var(--amber-600);
}

html.light .btn-ghost {
  color: var(--text-muted);
  border-color: var(--border-strong);
}

html.light .btn-ghost:hover:not(:disabled) {
  color: var(--amber-700);
  border-color: var(--amber-500);
  background: color-mix(in srgb, var(--amber-500) 8%, var(--surface));
}

html.light .badge-amber {
  color: var(--amber-700);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Scrollbar temático (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: var(--stone-600) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--stone-600); border-radius: var(--radius-full);
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--stone-500); background-clip: padding-box; }

/* Selección de texto en violeta arcano */
::selection { background: var(--selection-bg); color: #fff; }

img, svg, video { max-width: 100%; }

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, var(--ambient-top), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 0%, var(--ambient-tr), transparent 55%),
    radial-gradient(ellipse 55% 50% at 0% 100%, var(--ambient-bl), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100svh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Targets táctiles cómodos en pantallas chicas */
@media (max-width: 760px) and (pointer: coarse) {
  .btn:not(.btn-sm), .nav-btn, .dice-btn { min-height: 44px; }
}

/* ---- Accesibilidad: respetar preferencia de movimiento ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- Foco visible accesible ---- */
:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 2px;
}

/* ---- Typography ---- */
h1 {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 700; letter-spacing: .01em;
  margin-bottom: 1.25rem; line-height: 1.2;
}
h2 {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 600; letter-spacing: .01em;
  margin-bottom: 1rem;
}
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .75rem; }
p  { margin-bottom: .75rem; }
a  { color: var(--amber-400); text-decoration: none; transition: color var(--dur-fast) ease; }
a:hover { text-decoration: underline; }
small { font-size: .8rem; color: var(--stone-400); }

/* Filete decorativo bajo títulos de página */
.page-header h1 {
  position: relative; padding-bottom: .55rem; margin-bottom: 0;
}
.page-header h1::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 64px; height: 2px;
  background: linear-gradient(90deg, var(--amber-500), transparent);
}

/* ---- Header / Nav ---- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(13, 15, 24, .82);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--stone-700);
  box-shadow: 0 1px 0 var(--header-accent), var(--shadow-sm);
  overflow: visible;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: .75rem 1rem;
  display: flex; align-items: center; gap: 1rem;
  position: relative;
  overflow: visible;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; letter-spacing: .02em;
  color: var(--amber-400); text-decoration: none; white-space: nowrap;
  transition: color var(--dur-fast) ease;
}
.nav-brand:hover { text-decoration: none; color: var(--amber-300); }

/* Logo dado d20 */
.logo-d20 {
  width: 30px; height: 30px; flex-shrink: 0;
  transform-origin: 50% 50%;
  transition: transform var(--dur-slow) var(--ease-bounce), filter var(--dur-normal) ease;
  animation: d20-glow 4.5s ease-in-out infinite;
}
.nav-brand:hover .logo-d20 {
  animation: none;
  transform: rotate(360deg) scale(1.06);
  filter: drop-shadow(0 0 14px rgba(var(--logo-glow-rgb), .65));
}
@keyframes d20-glow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(var(--logo-glow-rgb), .22)); }
  50%      { filter: drop-shadow(0 0 13px rgba(var(--logo-glow-rgb), .48)); }
}

.nav-links {
  display: flex; align-items: center; gap: .75rem; margin-left: auto;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-primary-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
  min-width: 0;
}
.nav-link {
  position: relative;
  font-size: .9rem; color: var(--stone-400);
  padding: .3rem .5rem; border-radius: var(--radius);
  text-decoration: none; transition: color var(--dur-fast) ease;
}
.nav-link::after {
  content: ''; position: absolute; left: .5rem; right: .5rem; bottom: 1px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--amber-500), var(--amber-300));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-normal) var(--ease-smooth);
}
.nav-link:hover::after, .nav-active::after { transform: scaleX(1); }
.nav-link:hover, .nav-active { color: var(--stone-100) !important; text-decoration: none; }
.nav-active { font-weight: 600; color: var(--amber-400) !important; }
.nav-username { font-size: .85rem; color: var(--stone-500); padding: 0 .25rem; }
.nav-btn { font-size: .85rem; padding: .35rem .85rem; border-radius: var(--radius); font-weight: 500; text-decoration: none; }
.nav-btn-outline { border: 1px solid var(--stone-600); color: var(--stone-300); }
.nav-btn-outline:hover { border-color: var(--stone-400); color: var(--stone-100); text-decoration: none; }
.nav-btn-primary { background: var(--amber-500); color: var(--on-primary); transition: background var(--dur-fast) ease, box-shadow var(--dur-normal) ease, transform var(--dur-fast) var(--ease-bounce); }
.nav-btn-primary:hover { background: var(--amber-400); text-decoration: none; transform: translateY(-1px); box-shadow: var(--glow-gold); }

/* Hamburguesa animada (3 barras → ✕) */
.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; flex-shrink: 0;
  background: none; border: 1px solid var(--stone-700); border-radius: var(--radius);
  cursor: pointer; padding: 0; place-items: center;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.nav-toggle:hover { border-color: var(--stone-500); background: var(--stone-800); }
.nav-toggle-box { position: relative; display: block; width: 20px; height: 14px; }
.nav-toggle-inner,
.nav-toggle-inner::before,
.nav-toggle-inner::after {
  position: absolute; left: 0; width: 20px; height: 2px; border-radius: 2px;
  background: var(--stone-200);
  transition: transform var(--dur-normal) var(--ease-bounce), opacity var(--dur-fast) ease;
}
.nav-toggle-inner { top: 50%; transform: translateY(-50%); }
.nav-toggle-inner::before { content: ''; top: -6px; }
.nav-toggle-inner::after  { content: ''; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-inner { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-inner::before { transform: translateY(6px) rotate(45deg); background: var(--amber-400); }
.nav-toggle[aria-expanded="true"] .nav-toggle-inner::after  { transform: translateY(-6px) rotate(-45deg); background: var(--amber-400); }

@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    flex-wrap: nowrap;
    background: rgba(13, 15, 24, .96);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border-bottom: 1px solid var(--stone-700);
    box-shadow: var(--shadow-lg);
    padding: .6rem .9rem 1rem;
    margin-left: 0;
    clip-path: inset(0 0 100% 0);
    opacity: 0; pointer-events: none;
    transition: clip-path var(--dur-normal) var(--ease-out-expo), opacity var(--dur-fast) ease;
  }
  .nav-links.open { clip-path: inset(0 0 0 0); opacity: 1; pointer-events: auto; }
  .nav-primary-links {
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    width: 100%;
  }
  .nav-link { padding: .7rem .6rem; font-size: 1rem; border-radius: var(--radius); }
  .nav-link::after { display: none; }
  .nav-link:active { background: var(--stone-800); }
  .nav-username { padding: .5rem .6rem; border-bottom: 1px solid var(--stone-800); margin-bottom: .25rem; }
  .nav-btn { display: block; text-align: center; padding: .7rem .85rem; margin-top: .35rem; font-size: .95rem; }
  .user-menu {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--stone-800);
    padding-top: .35rem;
  }
  .user-menu-btn { width: 100%; justify-content: flex-start; margin-top: .15rem; }
  .user-dropdown {
    position: static;
    margin-top: .35rem;
    box-shadow: none;
    border: 1px solid var(--stone-700);
    width: 100%;
  }
  .user-dropdown.show,
  .user-dropdown:not([hidden]) { display: block; }
}

/* ---- User menu ---- */
.user-menu {
  position: relative;
  flex-shrink: 0;
  margin-left: .35rem;
  padding-left: .75rem;
  border-left: 1px solid var(--stone-700);
}
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: 220px;
  padding: .3rem .65rem .3rem .3rem;
  background: var(--stone-800);
  border: 1px solid var(--stone-700);
  border-radius: 999px;
  color: var(--stone-200);
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
  white-space: nowrap;
}
.user-menu-btn:hover,
.user-menu-btn[aria-expanded="true"] {
  border-color: var(--amber-500);
  background: color-mix(in srgb, var(--amber-600) 12%, var(--stone-800));
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), .15);
}
.user-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.user-menu-caret {
  font-size: .75rem;
  color: var(--stone-500);
  line-height: 1;
  flex-shrink: 0;
}
.avatar-container {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--avatar-gradient-a), var(--avatar-gradient-b));
  color: var(--on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar-initials { font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  display: none;
  z-index: 300;
  overflow: hidden;
  padding: .35rem 0;
}
.user-dropdown[hidden] { display: none !important; }
.user-dropdown.show { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: .65rem 1rem;
  color: var(--stone-200);
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.35;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.dropdown-item:hover,
.dropdown-item:focus-visible {
  background: var(--stone-800);
  text-decoration: none;
  color: var(--stone-100);
}
.dropdown-item.nav-active { color: var(--amber-400); font-weight: 600; }
.dropdown-item-logout { color: #f87171; }
.dropdown-item-logout:hover { color: #fca5a5; background: rgba(248, 113, 113, .08); }
.dropdown-divider { height: 1px; background: var(--stone-700); margin: .35rem 0; }

/* ---- Profile page ---- */
.profile-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .profile-grid { grid-template-columns: 2fr 1fr; align-items: start; }
}
.profile-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.profile-avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--amber-500) 35%, var(--border));
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-initials {
  font-size: 2rem;
  font-weight: 700;
  color: var(--amber-400);
}
.profile-avatar-upload { cursor: pointer; }
.profile-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.profile-info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--stone-700);
  font-size: .9rem;
  color: var(--stone-400);
}
.profile-info-list li:last-child { border-bottom: none; }
.profile-info-list strong { color: var(--stone-100); font-weight: 600; }

/* ---- Theme selector (user menu) ---- */
.theme-selector {
  padding: .55rem 1rem .65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.theme-selector-label {
  font-size: .82rem;
  color: var(--stone-400);
  font-weight: 500;
}
.theme-buttons { display: flex; gap: .35rem; flex-shrink: 0; }
.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stone-700);
  background: var(--stone-800);
  color: var(--stone-300);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.theme-btn:hover,
.theme-btn.active {
  border-color: var(--amber-500);
  background: rgba(var(--primary-rgb),.15);
  color: var(--amber-400);
  transform: translateY(-1px);
}

/* ---- Passkeys ---- */
.login-passkey-retry { margin: .75rem 0; }
.login-passkey-error {
  color: var(--red-400);
  font-size: .85rem;
  margin-bottom: .75rem;
}
.login-card--biometric-pending {
  opacity: .85;
  pointer-events: none;
}
.passkey-settings-panel { display: flex; flex-direction: column; gap: .75rem; }
.passkey-device-list {
  list-style: none;
  padding: 0;
  margin: .75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.passkey-device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .75rem;
  border: 1px solid var(--stone-700);
  border-radius: var(--radius);
  background: var(--stone-900);
}
.passkey-device-item__meta { font-size: .9rem; color: var(--stone-200); }
.passkey-device-item__meta small {
  display: block;
  font-size: .75rem;
  color: var(--stone-500);
  margin-top: .15rem;
}
.passkey-offer-banner {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  left: 1.25rem;
  max-width: 420px;
  margin-left: auto;
  z-index: var(--z-toast);
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .28s ease, transform .28s ease;
  pointer-events: none;
}
.passkey-offer-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.passkey-offer-banner.is-hidden { opacity: 0; }
.passkey-offer-banner__content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .75rem;
}
.passkey-offer-banner__icon { font-size: 1.5rem; line-height: 1; }
.passkey-offer-banner__text { flex: 1; min-width: 180px; }
.passkey-offer-banner__text strong {
  display: block;
  font-size: .95rem;
  margin-bottom: .25rem;
}
.passkey-offer-banner__text span {
  font-size: .82rem;
  color: var(--stone-400);
  line-height: 1.4;
}
.passkey-offer-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  width: 100%;
}
.passkey-offer-banner__error {
  margin-top: .5rem;
  font-size: .82rem;
  color: var(--red-400);
}

/* ---- Layout ---- */
.main-content { padding: 2rem 1rem; }
.container { max-width: 1100px; margin: 0 auto; }
.page-header { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }

/* ---- Cards ---- */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 40%),
    var(--stone-800);
  border: 1px solid var(--stone-700);
  border-radius: var(--radius); padding: 1.25rem;
  transition: transform var(--dur-normal) var(--ease-smooth),
              border-color var(--dur-normal) ease,
              box-shadow var(--dur-normal) ease;
}
.card-sm { padding: .875rem; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* Tarjetas que son enlaces: elevación + glow dorado al hover */
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover {
  transform: translateY(-3px);
  border-color: var(--amber-600);
  box-shadow: var(--shadow-md), var(--glow-gold);
}
a.card:hover strong { color: var(--amber-300); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .85rem; color: var(--stone-400); margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], textarea, select {
  width: 100%; background: var(--stone-900); color: var(--stone-100);
  border: 1px solid var(--stone-700); border-radius: var(--radius);
  padding: .5rem .75rem; font-size: .95rem; font-family: inherit;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red-500); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ---- File input ---- */
.file-input { margin-top: .15rem; }
.file-input-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.file-input-trigger {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  padding: .65rem .75rem; background: var(--stone-900);
  border: 1px dashed var(--stone-600); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.file-input-trigger:hover {
  border-color: var(--amber-500); background: var(--stone-800);
}
.file-input-btn {
  flex-shrink: 0; display: inline-flex; align-items: center;
  padding: .4rem .85rem;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--radius); font-size: .85rem; font-weight: 600;
}
.file-input-trigger:hover .file-input-btn {
  background: var(--btn-secondary-bg-hover);
  border-color: var(--amber-500);
  color: var(--btn-secondary-fg);
}
.file-input-name {
  flex: 1; min-width: 0; font-size: .875rem; color: var(--stone-400);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-input-native:focus-visible + .file-input-trigger {
  outline: 2px solid var(--amber-500); outline-offset: 2px;
}
.file-input-hint {
  margin: .45rem 0 0; font-size: .75rem; color: var(--stone-500);
}

/* ---- Buttons ---- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; font-family: inherit;
  line-height: 1.25;
  cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: transform var(--dur-fast) var(--ease-bounce),
              background var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              box-shadow var(--dur-normal) ease,
              opacity var(--dur-fast) ease;
}
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }

/* Barrido de luz en el botón primario */
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform var(--dur-slow) var(--ease-smooth);
}
.btn-primary:hover:not(:disabled)::after { transform: translateX(120%); }

.btn-primary   { background: var(--amber-500); color: var(--on-primary); border-color: transparent; }
.btn-primary:hover:not(:disabled) { background: var(--amber-400); transform: translateY(-1px); box-shadow: var(--glow-gold); }
.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 1px solid var(--btn-secondary-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-bg-hover);
  border-color: var(--amber-500);
  color: var(--btn-secondary-fg);
  transform: translateY(-1px);
}
.btn-danger    { background: var(--crimson-500); color: #fff; border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--crimson-600); transform: translateY(-1px); box-shadow: 0 0 18px rgba(220,38,38,.35); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--btn-secondary-border);
  color: var(--stone-300);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--amber-500);
  color: var(--amber-300);
  background: color-mix(in srgb, var(--amber-500) 10%, transparent);
}
.btn-sm {
  padding: .35rem .75rem;
  font-size: .8rem;
  min-height: 2rem;
}
.btn-full { width: 100%; justify-content: center; }

/* Filas de acciones (enlace + formulario) alineadas */
.flex.gap-2 { align-items: center; flex-wrap: wrap; }
.flex.gap-2 > form { display: contents; margin: 0; }

/* ---- Flash messages ---- */
.flash {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem;
  animation: flash-in .45s var(--ease-bounce); transition: opacity .4s ease;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: #06352a; border: 1px solid #065f46; color: var(--emerald-400); }
.flash-error   { background: #450a0a; border: 1px solid #7f1d1d; color: var(--red-400); }
.flash-info    { background: #1e3a5f; border: 1px solid #1e40af; color: var(--blue-400); }
.flash-list { margin: .45rem 0 0 1.1rem; }
.flash-list li { margin-bottom: .2rem; }

/* ---- Error / helper text ---- */
.field-error { color: var(--red-400); font-size: .8rem; margin-top: .25rem; }
.text-muted  { color: var(--stone-400); font-size: .85rem; }
.text-amber  { color: var(--amber-400); }
.text-green  { color: var(--green-400); }
.text-red    { color: var(--red-400); }

/* ---- Auth pages ---- */
.auth-wrap { max-width: 400px; margin: 2rem auto; }
.auth-wrap h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.auth-links  { margin-top: 1rem; font-size: .85rem; color: var(--stone-400); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--stone-700); color: var(--stone-300); font-weight: 600; padding: .6rem .75rem; text-align: left; }
td { padding: .55rem .75rem; border-bottom: 1px solid var(--stone-700); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--stone-800); }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.25;
}
.badge-amber {
  background: color-mix(in srgb, var(--amber-500) 14%, var(--surface));
  color: var(--amber-400);
  border: 1px solid color-mix(in srgb, var(--amber-500) 35%, var(--border));
}
.badge-green { background: #06352a; color: var(--emerald-400); border: 1px solid #065f46; }
.badge-red   { background: #450a0a; color: var(--red-400);   border: 1px solid #7f1d1d; }
.badge-gray  {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ---- Character sheet specifics ---- */
.character-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.character-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.character-card-portrait {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--stone-600); background: var(--stone-900); flex-shrink: 0;
}
.character-card-portrait-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--amber-400); font-weight: 800; font-size: .8rem;
}
.character-profile { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.character-profile-media { display: flex; justify-content: center; }
.character-portrait-lg {
  width: 180px; height: 220px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--stone-600); background: var(--stone-900);
}
.character-portrait-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--amber-400); font-size: 2rem; font-weight: 900;
}
.character-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.recommendation-box {
  background: var(--highlight-bg); border: 1px solid var(--amber-700); border-radius: var(--radius);
  padding: .85rem 1rem;
}
.recommendation-box h3 { color: var(--amber-400); margin-bottom: .5rem; }
.recommendation-box ul { padding-left: 1.1rem; color: var(--stone-300); font-size: .9rem; }
.recommendation-box li { margin-bottom: .35rem; }
.recommendation-box li:last-child { margin-bottom: 0; }
.ability-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (min-width: 600px) { .ability-grid { grid-template-columns: repeat(6, 1fr); } }
.ability-box { text-align: center; background: var(--stone-900); border: 1px solid var(--stone-700); border-radius: var(--radius); padding: .75rem .5rem; }
.ability-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--stone-400); }
.ability-score { font-size: 1.6rem; font-weight: 700; color: var(--amber-400); line-height: 1; margin: .2rem 0; }
.ability-mod { font-size: .85rem; color: var(--stone-300); }
.wizard-ability-grid input[type=number] {
  text-align: center; border: 0; background: transparent; color: var(--amber-400);
  font-size: 1.6rem; font-weight: 700; padding: .15rem 0; appearance: textfield;
}
.wizard-ability-grid input[type=number]::-webkit-outer-spin-button,
.wizard-ability-grid input[type=number]::-webkit-inner-spin-button { appearance: none; margin: 0; }

.wizard-progress { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wizard-step-tab {
  border: 1px solid var(--stone-700); background: var(--stone-900); color: var(--stone-400);
  border-radius: 999px; padding: .35rem .7rem; cursor: pointer; font-size: .8rem;
}
.wizard-step-tab.active { border-color: var(--amber-500); color: var(--amber-400); background: var(--highlight-bg); }
.wizard-step-tab.completed { border-color: #166534; color: var(--green-400); }
.wizard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-preview { position: sticky; top: 1rem; }
.wizard-validation {
  background: #450a0a; border: 1px solid #7f1d1d; color: var(--red-400);
  border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem;
}
.wizard-validation ul { margin: .45rem 0 0 1.1rem; }
.wizard-help {
  background: var(--stone-900); border: 1px solid var(--stone-700);
  border-radius: var(--radius); padding: .75rem .85rem; margin-bottom: 1rem;
}
.wizard-help strong { color: var(--amber-400); display: block; margin-bottom: .25rem; }
.wizard-help p { color: var(--stone-400); font-size: .85rem; margin: 0; }
.explanation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.wizard-stat-list { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0; }
.wizard-stat-list span {
  background: var(--stone-900); border: 1px solid var(--stone-700);
  border-radius: var(--radius); padding: .45rem .55rem; font-size: .85rem;
}
.wizard-stat-list strong { color: var(--amber-400); float: right; }
.wizard-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }
.wizard-summary-grid strong { display: block; color: var(--amber-400); font-size: 1.5rem; margin-top: .2rem; }
.skill-picker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .4rem; margin-top: .5rem; }
.skill-choice {
  display: flex; align-items: center; gap: .4rem; border: 1px solid var(--stone-700);
  border-radius: var(--radius); padding: .45rem .55rem; background: var(--stone-900);
}
.skill-choice.recommended { border-color: var(--amber-600); background: var(--highlight-bg); }
.skill-choice.automatic { border-color: #166534; background: #052e16; }
.skill-choice.automatic::after {
  content: 'Auto'; color: var(--green-400); border: 1px solid #166534;
  border-radius: 99px; padding: .05rem .35rem; font-size: .65rem; font-weight: 700;
}
.skill-choice input { width: auto; }
.skill-choice span { flex: 1; font-size: .9rem; }
.skill-choice small { color: var(--stone-500); font-size: .7rem; }
.equipment-choices { display: flex; flex-direction: column; gap: .6rem; }
.equipment-choice {
  display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--stone-700);
  border-radius: var(--radius); padding: .75rem; background: var(--stone-900); cursor: pointer;
}
.equipment-choice:has(input:checked) { border-color: var(--amber-500); background: var(--highlight-bg); }
.equipment-choice input { margin-top: .2rem; flex-shrink: 0; }
.equipment-choice ul { margin: .35rem 0 0 1.1rem; color: var(--stone-400); font-size: .85rem; }
.equipment-choice p { margin: .25rem 0 0; }
.wizard-edition-row { margin-bottom: 1rem; }
.personality-picker { margin-bottom: .35rem; width: 100%; }
.text-error { color: var(--red-400); font-weight: 700; }
#pointBuyPanel { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.calculation-breakdown {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem;
}
.calculation-breakdown > div {
  background: var(--stone-900); border: 1px solid var(--stone-700);
  border-radius: var(--radius); padding: .75rem;
}
.calculation-breakdown strong { color: var(--stone-100); display: block; margin-bottom: .3rem; }
.calculation-breakdown p { color: var(--stone-400); font-size: .85rem; margin: 0; }
.dice-assignment {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem;
  flex-wrap: wrap;
}
.dice-assignment p { margin-bottom: 0; }
.roll-log {
  width: 100%; background: var(--stone-900); border: 1px dashed var(--stone-700);
  border-radius: var(--radius); padding: .55rem .65rem; font-size: .8rem;
}
.ability-roll-btn { margin-top: .45rem; justify-content: center; width: 100%; }
.roll-detail { min-height: 1.1rem; color: var(--stone-400); font-size: .72rem; margin-top: .35rem; }
@media (max-width: 820px) {
  .wizard-layout, .character-profile, .explanation-grid { grid-template-columns: 1fr; }
  .wizard-preview { position: static; }
}

.hp-tracker { display: flex; align-items: center; gap: .5rem; }
.hp-current { font-size: 2rem; font-weight: 700; color: var(--amber-400); min-width: 3rem; text-align: center; }
.hp-max     { color: var(--stone-400); }

.skill-list { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem; font-size: .85rem; }
@media (max-width: 480px) { .skill-list { grid-template-columns: 1fr; } }
.skill-row { display: flex; align-items: center; gap: .4rem; padding: .25rem .4rem; border-radius: 4px; }
.skill-row:hover { background: var(--stone-700); }
.skill-mod  { font-weight: 600; min-width: 2.2rem; text-align: right; color: var(--stone-100); }
.skill-name { color: var(--stone-300); flex: 1; }
.prof-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--stone-500); cursor: pointer; flex-shrink: 0; }
.prof-dot.active   { background: var(--amber-500); border-color: var(--amber-500); }
.prof-dot.expert   { background: var(--amber-300); border-color: var(--amber-300); }

/* ---- Combat view ---- */
.combatant-list { display: flex; flex-direction: column; gap: .5rem; }
.combatant-row  { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: var(--radius); background: var(--stone-800); border: 1px solid var(--stone-700); }
.combatant-row.active-turn { border-color: var(--amber-500); background: var(--highlight-bg); }
.combatant-row.defeated { opacity: .45; }
.init-badge { min-width: 2.2rem; text-align: center; font-weight: 700; color: var(--amber-400); }
.combatant-name { flex: 1; font-weight: 500; }
.hp-badge { display: flex; align-items: center; gap: .3rem; }
.conditions { display: flex; gap: .3rem; flex-wrap: wrap; }
.condition-tag { background: #3b1818; color: var(--red-400); font-size: .7rem; padding: .1rem .45rem; border-radius: 99px; border: 1px solid #7f1d1d; }

.combat-log { background: var(--stone-900); border: 1px solid var(--stone-700); border-radius: var(--radius); padding: .75rem; max-height: 220px; overflow-y: auto; font-size: .8rem; color: var(--stone-400); }
.log-entry { padding: .2rem 0; border-bottom: 1px solid var(--stone-800); }
.log-entry:last-child { border-bottom: none; }

/* ---- Dice roller ---- */
.dice-roller { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 200; }
.dice-toggle { width: 54px; height: 54px; border-radius: 50%; background: var(--amber-500); color: var(--on-primary); border: none; font-size: 1.4rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.45), var(--glow-gold); display: flex; align-items: center; justify-content: center; transition: transform var(--dur-normal) var(--ease-bounce), background var(--dur-fast) ease; animation: dice-float 3.5s ease-in-out infinite; }
.dice-toggle:hover { background: var(--amber-400); transform: scale(1.1) rotate(12deg); }
.dice-toggle:active { transform: scale(.94); }
@keyframes dice-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.dice-result.rolling { animation: dice-pop .35s var(--ease-bounce); }
@keyframes dice-pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
.dice-panel { position: absolute; bottom: 64px; right: 0; width: 280px; background: var(--stone-800); border: 1px solid var(--stone-600); border-radius: var(--radius); padding: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.5); display: none; }
.dice-panel.open { display: block; }
.dice-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.dice-btn { background: var(--stone-700); border: 1px solid var(--stone-600); color: var(--stone-200); border-radius: var(--radius); padding: .3rem .6rem; font-size: .8rem; cursor: pointer; }
.dice-btn:hover { background: var(--amber-600); border-color: var(--amber-500); color: var(--on-primary); }
.dice-result { font-size: 1.4rem; font-weight: 700; color: var(--amber-400); text-align: center; min-height: 2rem; }
.dice-history { max-height: 80px; overflow-y: auto; font-size: .75rem; color: var(--stone-400); margin-top: .5rem; }

/* ---- Tavern View (full-screen TV mode) ---- */
.tavern-body { background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(var(--primary-rgb),.14), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(16,185,129,.06), transparent 55%),
    #0a0b12; min-height: 100svh; }
html.light .tavern-body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(var(--primary-rgb),.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(16,185,129,.05), transparent 55%),
    var(--stone-100);
}
.tavern-wrap { min-height: 100svh; display: flex; flex-direction: column; padding: 1.25rem 1.5rem 2rem; max-width: 1600px; margin: 0 auto; }
.tavern-title { display: flex; align-items: center; justify-content: center; gap: .6rem; font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 700; color: var(--amber-300); letter-spacing: .04em; margin-bottom: .25rem; text-shadow: 0 0 30px rgba(var(--primary-rgb),.4); text-align: center; }
.tavern-d20 { width: clamp(40px, 5vw, 64px); height: clamp(40px, 5vw, 64px); filter: drop-shadow(0 0 14px rgba(var(--logo-glow-rgb), .55)); animation: d20-glow 4.5s ease-in-out infinite; }
.tavern-subtitle { text-align: center; color: var(--stone-400); margin-bottom: 1rem; font-size: 1.05rem; }
.tavern-battle-layout { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(200px, 240px); gap: 1rem; align-items: start; width: 100%; flex: 1; }
.tavern-side { min-width: 0; max-height: calc(100vh - 140px); overflow-y: auto; }
.tavern-side-title { color: var(--stone-400); font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin-bottom: .5rem; text-transform: uppercase; }
.tavern-side-enemies .tavern-side-title { text-align: right; }
.tavern-combatant-list { display: flex; flex-direction: column; gap: .65rem; }
.tavern-combatant { background: var(--stone-800); border: 1px solid var(--stone-700); border-radius: var(--radius); padding: .65rem .85rem; }
.tavern-combatant.active-turn { border-color: var(--amber-500); background: var(--highlight-bg); box-shadow: 0 0 12px rgba(var(--primary-rgb),.25); }
.tavern-combatant.defeated { opacity: .45; }
.tavern-combatant-name { font-weight: 700; font-size: .92rem; margin-bottom: .35rem; }
.tavern-combatant-meta { color: var(--stone-400); font-size: .78rem; }
.tavern-hp-bar { background: var(--stone-700); border-radius: 4px; height: 7px; margin-bottom: .35rem; overflow: hidden; }
.tavern-hp-bar > div { border-radius: 4px; height: 100%; }
.tavern-side-enemies .tavern-combatant { text-align: right; }
.tavern-side-enemies .conditions { justify-content: flex-end; }
.tavern-map-center { min-width: 0; display: flex; flex-direction: column; align-items: center; }
@media (max-width: 960px) {
  .tavern-battle-layout { grid-template-columns: 1fr; }
  .tavern-side-enemies .tavern-side-title, .tavern-side-enemies .tavern-combatant { text-align: left; }
  .tavern-side-enemies .conditions { justify-content: flex-start; }
  .tavern-side { max-height: none; }
}

/* ---- Battle map (tactical grid) — base; combat.css amplía alineación y bloqueos ---- */
.battle-map-wrap { width: 100%; }
.battle-map-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--stone-500); background: var(--stone-900); }
.battle-token { position: relative; z-index: 3; align-self: center; justify-self: center; width: 78%; height: 78%; cursor: grab; display: flex; align-items: center; justify-content: center; transform: perspective(140px) rotateX(28deg); filter: drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
.battle-token:active { cursor: grabbing; }
.battle-token-cap { position: absolute; inset: 8% 12% 28%; border-radius: 50%; background: linear-gradient(160deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 45%), linear-gradient(180deg, #86efac 0%, #15803d 55%, #14532d 100%); border: 2px solid rgba(255,255,255,.25); box-shadow: inset 0 -4px 8px rgba(0,0,0,.35); }
.battle-token.enemy .battle-token-cap { background: linear-gradient(160deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 45%), linear-gradient(180deg, #fca5a5 0%, #b91c1c 55%, #7f1d1d 100%); }
.battle-token-label { position: relative; z-index: 2; font-size: .62rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); letter-spacing: .03em; transform: rotateX(-28deg) translateY(-2px); }
.battle-token.selected .battle-token-cap { outline: 2px solid var(--amber-400); outline-offset: 2px; }
.battle-token.defeated { opacity: .35; filter: grayscale(.8); }

.combat-battle-layout { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(260px, 320px); gap: 1rem; align-items: start; }
.combat-side-panel { display: flex; flex-direction: column; gap: .5rem; max-height: calc(100vh - 160px); overflow-y: auto; }
.combat-side-title { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--stone-400); margin-bottom: .25rem; }
.combat-mini-card { background: var(--stone-900); border: 1px solid var(--stone-700); border-radius: 6px; padding: .55rem .65rem; font-size: .85rem; }
.combat-mini-card.active-turn { border-color: var(--amber-500); background: var(--highlight-bg); }
.combat-mini-card.defeated { opacity: .45; }
.combat-attack-panel { background: var(--stone-900); border: 1px solid var(--stone-700); border-radius: var(--radius); padding: .75rem; margin-top: .75rem; }
.combat-attack-result { font-size: .85rem; color: var(--stone-300); margin-top: .5rem; line-height: 1.45; }
.combat-attack-result .hit { color: var(--green-400); font-weight: 700; }
.combat-attack-result .miss { color: var(--red-400); font-weight: 700; }
@media (max-width: 1100px) { .combat-battle-layout { grid-template-columns: 1fr; } .combat-side-panel { max-height: none; } }


/* ---- Pricing ---- */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 700px; margin: 0 auto; }
@media (max-width: 540px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card { border: 2px solid var(--stone-700); border-radius: var(--radius); padding: 1.5rem; background: var(--stone-800); }
.pricing-card.featured { border-color: var(--amber-500); background: var(--highlight-bg); }
.price-amount { font-size: 2.5rem; font-weight: 900; color: var(--amber-400); line-height: 1; }
.price-period { font-size: .85rem; color: var(--stone-400); }
.feature-list { list-style: none; margin: 1rem 0 1.5rem; }
.feature-list li { padding: .35rem 0; font-size: .9rem; color: var(--stone-300); }
.feature-list li::before { content: '✓ '; color: var(--green-400); }
.feature-list li.no::before { content: '✕ '; color: var(--stone-600); }
.feature-list li.no { color: var(--stone-600); }

/* ---- Reference ---- */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.ref-card { background: var(--stone-800); border: 1px solid var(--stone-700); border-radius: var(--radius); }
.ref-card summary { padding: .75rem 1rem; cursor: pointer; font-weight: 600; color: var(--stone-200); user-select: none; }
.ref-card summary:hover { color: var(--amber-400); }
.ref-card .ref-body { padding: 0 1rem 1rem; font-size: .85rem; color: var(--stone-300); line-height: 1.6; }

/* ---- Grids responsivos ---- */
.grid          { display: grid; gap: var(--space-4); }
.grid-2        { grid-template-columns: 1fr 1fr; }
.grid-2-1      { grid-template-columns: 2fr 1fr; }
.grid-1-2      { grid-template-columns: 1fr 2fr; }
.grid-gap-lg   { gap: var(--space-6); }
@media (max-width: 760px) {
  .grid-2, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

/* ---- Utilities ---- */
.flex          { display: flex; }
.flex-1        { flex: 1; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: .5rem; }
.gap-4         { gap: 1rem; }
.mt-1          { margin-top: .25rem; }
.mt-2          { margin-top: .5rem; }
.mt-4          { margin-top: 1rem; }
.mb-4          { margin-bottom: 1rem; }
.mb-6          { margin-bottom: 1.5rem; }
.w-full        { width: 100%; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.sr-only       { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.hidden        { display: none !important; }

/* ---- Loading spinner ---- */
.spinner { display: inline-block; width: 1.2rem; height: 1.2rem; border: 2px solid var(--stone-600); border-top-color: var(--amber-400); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1.25rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal {
  background: var(--stone-800); border: 1px solid var(--stone-600);
  border-radius: var(--radius); padding: 1.5rem;
  width: 100%; max-width: 480px;
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  margin: auto 0;
  flex-shrink: 0;
}
.modal-wide { max-width: 920px; }
body.modal-open { overflow: hidden; }
body.modal-open .site-header { z-index: 90; }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.modal-footer { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ---- Inventory / Spell slots ---- */
.slot-pips { display: flex; gap: .35rem; flex-wrap: wrap; }
.slot-pip { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--stone-600); cursor: pointer; transition: background .1s; }
.slot-pip.used { background: var(--stone-700); }
.slot-pip.avail { background: var(--amber-500); border-color: var(--amber-400); }

/* ---- Admin ---- */
.admin-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.5rem; border-bottom: 1px solid var(--stone-700); padding-bottom: .75rem; }
.admin-tab { font-size: .9rem; color: var(--stone-400); padding: .4rem .75rem; border-radius: var(--radius); text-decoration: none; }
.admin-tab:hover { color: var(--stone-100); background: var(--stone-800); text-decoration: none; }
.admin-tab-active { color: var(--amber-400) !important; background: var(--stone-800); font-weight: 600; }
.badge-admin { background: var(--amber-600); color: var(--on-primary); }
.badge-pro { background: #064e3b; color: var(--emerald-400); }
.badge-warn { background: #92400e; color: var(--amber-300); }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--stone-300); font-size: .95rem; }
.checkbox-label input { width: auto; accent-color: var(--amber-500); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--stone-700); }
.data-table th { color: var(--stone-400); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:hover td { background: var(--stone-900); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1.25rem; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-help { font-size: .875rem; color: var(--stone-400); line-height: 1.55; }
.admin-help h3 { font-size: .95rem; color: var(--stone-200); margin-bottom: .75rem; }
.admin-help ol { padding-left: 1.15rem; margin-bottom: 1rem; }
.admin-help li { margin-bottom: .65rem; }
.admin-help li strong { color: var(--stone-300); }
.admin-help a { color: var(--amber-400); }
.admin-help .help-block { background: var(--stone-900); border: 1px solid var(--stone-700); border-radius: var(--radius); padding: .75rem; margin-bottom: 1rem; font-size: .8rem; word-break: break-all; }
.admin-help .help-block-label { font-size: .75rem; color: var(--stone-500); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }

/* ============================================================
   ANIMACIONES GLOBALES
   ============================================================ */

/* ---- Reveal al hacer scroll (activado por JS con IntersectionObserver) ---- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity var(--dur-slow) var(--ease-smooth),
              transform var(--dur-slow) var(--ease-smooth);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
/* Escalonado opcional para grupos */
.reveal-1 { transition-delay: .08s; }
.reveal-2 { transition-delay: .16s; }
.reveal-3 { transition-delay: .24s; }
.reveal-4 { transition-delay: .32s; }

/* ---- Pulso dorado del turno activo en combate ---- */
.combatant-row.active-turn,
.combat-mini-card.active-turn,
.tavern-combatant.active-turn {
  animation: turn-pulse 2.2s var(--ease-smooth) infinite;
}
@keyframes turn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb),.25); }
  50%      { box-shadow: 0 0 18px 2px rgba(var(--primary-rgb),.45); }
}

/* ---- Punto de competencia con transición suave ---- */
.prof-dot { transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-bounce); }
.prof-dot:hover { transform: scale(1.25); }
.slot-pip { transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-bounce); }
.slot-pip:hover { transform: scale(1.15); }

/* ---- Filas de tabla / skill con transición ---- */
tr:hover td, .skill-row, .ref-card summary { transition: background var(--dur-fast) ease, color var(--dur-fast) ease; }

/* ---- Badges con leve realce ---- */
.badge { transition: transform var(--dur-fast) var(--ease-bounce); }

/* ---- Entrada suave del contenido principal ---- */
.main-content > .container { animation: page-enter var(--dur-slow) var(--ease-smooth) both; }
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Divisor temático arcano ---- */
.rune-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--gold-500); margin: 2rem 0; font-size: 1.1rem;
}
.rune-divider::before, .rune-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--stone-700), transparent);
}

/* ============================================================
   COMBAT — banner de turno, barras de HP, controles
   ============================================================ */
.turn-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(100deg, rgba(var(--primary-rgb),.18), rgba(var(--primary-deep-rgb),.10) 60%, transparent),
              var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber-500);
  border-radius: var(--radius); padding: .75rem 1.1rem; margin-bottom: 1.25rem;
}
.turn-banner-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.turn-banner-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--amber-300); line-height: 1.1; }

.combat-hp-bar { background: var(--stone-700); border-radius: var(--radius-full); height: 7px; overflow: hidden; width: 100%; }
.combat-hp-bar > div { height: 100%; border-radius: var(--radius-full); transition: width var(--dur-normal) var(--ease-smooth), background var(--dur-normal) ease; }

.combatant-row { align-items: center; gap: .75rem; }
.combatant-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.combatant-main .combatant-name { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.combatant-side-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.combatant-side-dot.is-player { background: var(--emerald-400); }
.combatant-side-dot.is-enemy { background: var(--crimson-500); }
.combatant-ac { font-size: .72rem; color: var(--text-muted); font-weight: 500; margin-left: auto; }
.combat-hp { display: flex; align-items: center; gap: .5rem; }
.combat-hp .combat-hp-bar { flex: 1; }
.combat-hp-num { font-size: .78rem; color: var(--stone-300); min-width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.combatant-controls { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.hp-control { display: flex; align-items: center; gap: .25rem; }
.hp-amt { width: 48px; text-align: center; padding: .25rem; font-size: .8rem; }
.cond-select { padding: .25rem .3rem; font-size: .72rem; max-width: 90px; }
@media (max-width: 600px) {
  .combatant-row { flex-wrap: wrap; }
  .combatant-controls { width: 100%; justify-content: flex-start; }
}

/* ============================================================
   CAMPAIGN STATS
   ============================================================ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card { text-align: center; padding: 1.1rem .75rem; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; line-height: 1.1; margin-top: .2rem; }
.stat-sub { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.stat-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.lb-row { margin-bottom: .7rem; }
.lb-row:last-child { margin-bottom: 0; }
.lb-head { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; margin-bottom: .25rem; }
.lb-bar { background: var(--stone-700); border-radius: var(--radius-full); height: 7px; overflow: hidden; }
.lb-bar > div { height: 100%; border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease-smooth); }

/* ============================================================
   STAT BLOCK (detalle de monstruo)
   ============================================================ */
.statblock {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  max-height: 68vh; overflow-y: auto;
}
.sb-name { font-family: var(--font-display); color: var(--gold-400); font-size: 1.4rem; line-height: 1.15; margin: 0; }
.sb-meta { font-style: italic; color: var(--text-muted); font-size: .85rem; margin: .15rem 0 0; }
.sb-rule { height: 2px; background: linear-gradient(90deg, var(--gold-600), transparent); margin: .6rem 0; border-radius: 2px; }
.sb-line { font-size: .9rem; margin: 0 0 .25rem; }
.sb-line strong { color: var(--amber-300); }
.sb-abilities { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; text-align: center; }
.sb-abil { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .4rem .25rem; }
.sb-abil-label { font-size: .65rem; letter-spacing: .06em; color: var(--text-muted); }
.sb-abil-score { font-weight: 700; color: var(--stone-100); }
.sb-abil-mod { font-size: .8rem; color: var(--amber-300); }
.sb-section {
  font-family: var(--font-display); color: var(--gold-400);
  border-bottom: 1px solid var(--gold-600); padding-bottom: .2rem;
  margin: .9rem 0 .45rem; font-size: 1.02rem;
}
.sb-block { font-size: .88rem; line-height: 1.5; margin: 0 0 .5rem; color: var(--stone-300); }
.sb-block strong { color: var(--amber-300); }
@media (max-width: 520px) { .sb-abilities { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   LANDING / HERO
   ============================================================ */
.hero {
  position: relative;
  text-align: center;
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 1rem;
}
.hero-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 520px; height: 520px; max-width: 120vw; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(var(--primary-rgb),.22) 0%, rgba(var(--primary-deep-rgb),.12) 38%, rgba(16,185,129,.05) 60%, transparent 72%);
  filter: blur(12px);
  animation: hero-pulse 6s ease-in-out infinite;
}
@keyframes hero-pulse {
  0%, 100% { opacity: .7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;  transform: translateX(-50%) scale(1.08); }
}
.hero > * { position: relative; z-index: 1; }

.hero-logo { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.hero-d20 {
  width: 110px; height: 110px;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.5)) drop-shadow(0 0 26px rgba(var(--logo-glow-rgb), .45)) drop-shadow(0 0 14px rgba(var(--logo-glow-rgb), .25));
  animation: hero-d20-in .9s var(--ease-bounce) both, d20-spin 22s linear infinite 1s;
  transform-origin: 50% 50%;
}
@keyframes hero-d20-in {
  from { opacity: 0; transform: translateY(-30px) rotate(-40deg) scale(.6); }
  to   { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
@keyframes d20-spin { to { transform: rotate(360deg); } }

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .8rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: .65rem;
  animation: rise-in .7s var(--ease-smooth) .15s both;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem); font-weight: 700; line-height: 1.05;
  letter-spacing: .01em; margin-bottom: 1rem;
  background: linear-gradient(180deg, #f4f3fa 0%, var(--amber-400) 50%, var(--amber-600) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--amber-300);
  text-shadow: 0 0 44px rgba(var(--primary-rgb),.30);
  animation: rise-in .8s var(--ease-smooth) .25s both;
}
.hero-sub {
  font-size: 1.12rem; color: var(--stone-300); max-width: 36rem; margin: 0 auto 2rem;
  animation: rise-in .8s var(--ease-smooth) .38s both;
}
.hero-cta {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  animation: rise-in .8s var(--ease-smooth) .5s both;
}
.btn-lg { font-size: 1.02rem; padding: .8rem 1.9rem; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  text-align: left; margin-top: 1rem;
}
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card { transition: transform var(--dur-normal) var(--ease-smooth), border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease; }
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--amber-600);
  box-shadow: var(--shadow-md), var(--glow-gold);
}
.feature-card strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--stone-100); margin-bottom: .3rem; }
.feature-icon {
  font-size: 1.8rem; margin-bottom: .6rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
  transition: transform var(--dur-normal) var(--ease-bounce);
}
.feature-card:hover .feature-icon { transform: scale(1.15) rotate(-6deg); }

/* ---- Character Creator ---- */
.cc-backdrop {
  padding: .5rem;
  align-items: flex-start;
  justify-content: center;
}
.cc-shell {
  width: min(1180px, 100%);
  height: min(920px, calc(100dvh - 1rem));
  max-height: calc(100dvh - 1rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--stone-900) 0%, var(--stone-950) 55%);
  border: 1px solid var(--stone-600);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(var(--primary-rgb),.12);
  overflow: hidden;
}
.cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--stone-700);
  background: linear-gradient(90deg, rgba(var(--primary-rgb),.08), transparent);
  flex-shrink: 0;
}
.cc-kicker {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold-400);
  margin: 0 0 .2rem;
}
.cc-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
  color: var(--stone-100);
}
.cc-close { flex-shrink: 0; font-size: 1.1rem; padding: .35rem .65rem; }
.cc-progress {
  position: relative;
  height: 2rem;
  background: var(--stone-900);
  border-bottom: 1px solid var(--stone-700);
  flex-shrink: 0;
}
.cc-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8%;
  background: linear-gradient(90deg, var(--amber-700), var(--amber-500));
  transition: width .35s var(--ease-smooth);
}
.cc-progress-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.25rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--stone-100);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.cc-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cc-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 240px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cc-rail {
  border-right: 1px solid var(--stone-700);
  padding: .65rem .45rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: rgba(0,0,0,.18);
  min-height: 0;
}
.cc-rail-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .4rem .45rem;
  background: transparent;
  color: var(--stone-400);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.cc-rail-item:hover { background: var(--stone-800); color: var(--stone-200); }
.cc-rail-item.active {
  border-color: var(--amber-600);
  background: rgba(var(--primary-rgb),.14);
  color: var(--amber-300);
}
.cc-rail-item.completed .cc-rail-num { background: var(--emerald-600); color: #fff; }
.cc-rail-num {
  flex-shrink: 0;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  background: var(--stone-700);
  color: var(--stone-300);
}
.cc-rail-copy { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.cc-rail-copy strong { font-size: .8rem; line-height: 1.2; }
.cc-rail-copy small { font-size: .66rem; color: var(--stone-500); line-height: 1.2; }
.cc-rail-item.active .cc-rail-copy small { color: var(--stone-400); }
.cc-main {
  padding: 1rem 1.15rem 1.15rem;
  overflow-y: auto;
  min-width: 0;
  min-height: 0;
}
.cc-step-intro {
  margin-bottom: .85rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--stone-700);
}
.cc-step-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 .3rem;
  color: var(--stone-100);
}
.cc-step-desc {
  margin: 0;
  color: var(--stone-400);
  font-size: .88rem;
  line-height: 1.5;
}
.cc-edition { margin-bottom: .85rem; }
.cc-field-label {
  display: block;
  font-size: .72rem;
  color: var(--stone-500);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cc-pill-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.cc-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--stone-600);
  border-radius: 999px;
  padding: .35rem .8rem;
  background: var(--stone-900);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cc-pill:has(input:checked) {
  border-color: var(--amber-500);
  background: rgba(var(--primary-rgb),.15);
}
.cc-pill input { margin-right: .35rem; accent-color: var(--amber-500); }
.cc-pill span { font-size: .82rem; color: var(--stone-200); }
.cc-steps .wizard-step h2 { display: none; }
.cc-steps .wizard-step > p.text-muted:first-of-type { display: none; }
.cc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .55rem;
  margin-bottom: .85rem;
}
.cc-card-grid--tall { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cc-pick-card {
  text-align: left;
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  background: var(--stone-900);
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: transform .15s var(--ease-smooth), border-color .15s, box-shadow .15s;
}
.cc-pick-card:hover {
  transform: translateY(-1px);
  border-color: var(--amber-600);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.cc-pick-card.selected {
  border-color: var(--amber-400);
  background: linear-gradient(145deg, var(--highlight-bg), var(--stone-900));
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb),.35), var(--glow-gold);
}
.cc-pick-card strong {
  display: block;
  font-family: var(--font-display);
  color: var(--stone-100);
  font-size: .92rem;
}
.cc-pick-card span {
  display: inline-block;
  margin-top: .2rem;
  font-size: .68rem;
  font-weight: 700;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cc-pick-card p {
  margin: .4rem 0 0;
  font-size: .76rem;
  color: var(--stone-400);
  line-height: 1.35;
}
.cc-chip-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.cc-chip-grid .cc-pick-card { flex: 1 1 130px; padding: .5rem .65rem; }
.cc-info-panel {
  background: rgba(var(--primary-rgb),.08);
  border: 1px solid var(--stone-600);
  border-left: 3px solid var(--amber-500);
  border-radius: var(--radius);
  padding: .7rem .85rem;
  margin-bottom: .85rem;
}
.cc-info-panel strong { color: var(--amber-300); font-size: .88rem; }
.cc-info-panel p { margin: .3rem 0 0; font-size: .82rem; color: var(--stone-300); line-height: 1.45; }
.cc-preview {
  border-left: 1px solid var(--stone-700);
  padding: 1rem .9rem;
  background: rgba(0,0,0,.22);
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cc-preview-badge {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold-400);
  margin-bottom: .65rem;
}
.cc-preview-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  margin-bottom: .65rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: radial-gradient(circle at 30% 30%, var(--amber-500), var(--stone-800));
  border: 2px solid var(--gold-500);
  box-shadow: var(--glow-gold-detail);
  flex-shrink: 0;
}
.cc-preview-name {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 .2rem;
  color: var(--stone-100);
  line-height: 1.25;
  word-break: break-word;
}
.cc-preview-line {
  font-size: .78rem;
  margin-bottom: .65rem;
  line-height: 1.4;
}
.cc-preview-stats { margin-bottom: .65rem; }
.cc-preview .wizard-stat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  margin: 0;
}
.cc-preview .wizard-stat-list span {
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  border-radius: var(--radius-sm);
  padding: .35rem .45rem;
  font-size: .75rem;
}
.cc-preview-abilities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
  margin-top: auto;
}
.cc-ab {
  text-align: center;
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  border-radius: var(--radius-sm);
  padding: .3rem .2rem;
}
.cc-ab span {
  display: block;
  font-size: .58rem;
  color: var(--stone-500);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.cc-ab strong {
  display: block;
  color: var(--amber-400);
  font-size: .95rem;
  line-height: 1.1;
}
.cc-ab small { font-size: .68rem; color: var(--stone-400); }
.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.15rem;
  border-top: 1px solid var(--stone-700);
  background: var(--stone-900);
  flex-shrink: 0;
  margin-top: 0;
}
.cc-footer-nav { display: flex; gap: .45rem; flex-wrap: wrap; }
.cc-submit {
  background: linear-gradient(90deg, var(--amber-600), var(--gold-500));
  color: var(--stone-950);
  font-weight: 700;
}
.cc-alert { margin-bottom: .85rem; }
.cc-empty-hero {
  position: relative;
  text-align: center;
  padding: 3.5rem 2rem;
  overflow: hidden;
}
.cc-empty-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(var(--primary-rgb),.15), transparent 60%);
  pointer-events: none;
}
.cc-empty-hero h2 { font-family: var(--font-display); position: relative; margin-bottom: .5rem; }
.cc-empty-hero p, .cc-empty-hero .btn { position: relative; }
.cc-level-row { max-width: 11rem; }
.cc-skill-counter {
  display: inline-block;
  font-weight: 700;
  color: var(--amber-300);
  background: rgba(var(--primary-rgb),.15);
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .76rem;
}

/* Controles internos del creador */
.cc-steps .skill-choice {
  border-radius: var(--radius);
  padding: .4rem .55rem;
  font-size: .85rem;
}
.cc-steps .skill-choice:has(input:checked) {
  border-color: var(--amber-500);
  background: rgba(var(--primary-rgb),.12);
}
.cc-steps .dice-assignment,
.cc-steps #pointBuyPanel.card-sm {
  border: 1px solid var(--stone-700);
  border-radius: var(--radius);
  padding: .8rem .9rem;
  background: var(--stone-900);
  margin-bottom: .85rem;
}
.cc-steps .ability-grid { gap: .45rem; margin-top: .85rem; }
.cc-steps .ability-box {
  padding: .55rem .35rem;
  border-color: var(--stone-600);
}
.cc-steps .ability-box small {
  display: block;
  font-size: .62rem;
  color: var(--stone-500);
  margin: .1rem 0 .2rem;
}
.cc-steps .ability-mod {
  font-size: .8rem;
  font-weight: 600;
  color: var(--emerald-400);
  margin: .15rem 0;
}
.cc-steps .equipment-choice {
  border-color: var(--stone-600);
  transition: border-color .15s, background .15s;
}
.cc-steps .wizard-summary-grid .card-sm {
  text-align: center;
  padding: .65rem .5rem;
}
.cc-steps .calculation-breakdown > div {
  border-color: var(--stone-600);
}
.cc-steps .recommendation-box {
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}
.cc-steps .recommendation-box h3 {
  font-size: .9rem;
  margin-bottom: .45rem;
  color: var(--stone-200);
}
.cc-steps .recommendation-box ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--stone-400);
  font-size: .84rem;
}
.cc-steps .form-group label {
  font-size: .82rem;
  color: var(--stone-300);
}
.cc-steps textarea,
.cc-steps select,
.cc-steps input[type=text],
.cc-steps input[type=number]:not([data-stat-input]) {
  font-size: .9rem;
}

/* Rail visible: no aplicar display:none de tabs legacy */
.cc-rail .wizard-step-tab { display: flex; }

@media (max-width: 960px) {
  .cc-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow-y: auto;
  }
  .cc-rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--stone-700);
    padding: .45rem .5rem;
    flex-shrink: 0;
  }
  .cc-rail-item { flex: 0 0 auto; min-width: 8.5rem; }
  .cc-main { overflow-y: visible; }
  .cc-preview {
    border-left: 0;
    border-top: 1px solid var(--stone-700);
    max-height: none;
    flex-shrink: 0;
  }
  .cc-preview-abilities { margin-top: .5rem; }
}
@media (max-width: 640px) {
  .cc-backdrop { padding: 0; }
  .cc-shell {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .cc-header { padding: .75rem 1rem; }
  .cc-main { padding: .75rem 1rem; }
  .cc-footer {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
  }
  .cc-footer-nav { justify-content: stretch; }
  .cc-footer-nav .btn { flex: 1; }
  .cc-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   DADOS 3D — overlay de escena, chip de resultado y panel
   ============================================================ */
.dice-roller { z-index: var(--z-dice); }

/* Botón flotante para abrir el panel */
.dice-toggle {
  width: 56px; height: 56px; border-radius: var(--radius-full);
  background: radial-gradient(circle at 32% 28%, var(--amber-400), var(--amber-600) 70%);
  color: #fff; border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 6px 18px rgba(0,0,0,.45), var(--glow-gold);
}
.dice-toggle svg { transition: transform var(--dur-slow) var(--ease-bounce); }
.dice-toggle:hover svg { transform: rotate(72deg); }
.dice-toggle[aria-expanded="true"] { background: radial-gradient(circle at 32% 28%, var(--amber-300), var(--amber-500) 70%); }

/* Panel */
.dice-panel {
  width: 300px; padding: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--stone-800), var(--stone-900));
  border: 1px solid var(--stone-600);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(var(--primary-rgb),.12);
  transform-origin: bottom right;
}
.dice-panel.open { animation: dice-panel-in var(--dur-normal) var(--ease-out-expo); }
@keyframes dice-panel-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.dice-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem .9rem; border-bottom: 1px solid var(--stone-700);
  background: linear-gradient(90deg, rgba(var(--primary-rgb),.12), transparent);
}
.dice-panel-title { font-family: var(--font-display); font-size: .95rem; color: var(--amber-300); letter-spacing: .03em; }
.dice-x { background: none; border: none; color: var(--stone-400); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: .15rem .35rem; border-radius: var(--radius-sm); }
.dice-x:hover { color: var(--stone-100); background: var(--stone-700); }

.dice-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; padding: .9rem .9rem .5rem; margin: 0; }
.dice-btn {
  background: var(--stone-700); border: 1px solid var(--stone-600); color: var(--stone-100);
  border-radius: var(--radius); padding: .5rem 0; font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-bounce), background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.dice-btn:hover { background: var(--amber-600); border-color: var(--amber-500); color: #fff; transform: translateY(-2px); }
.dice-btn:active { transform: translateY(0) scale(.95); }

.dice-controls { display: flex; gap: .6rem; padding: .25rem .9rem .5rem; }
.dice-controls label { flex: 1; display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--stone-400); margin: 0; }
.dice-controls input { width: 100%; padding: .3rem .45rem; font-size: .85rem; text-align: center; }

.dice-modes { display: flex; gap: .4rem; padding: 0 .9rem .6rem; }
.dice-mode {
  flex: 1; background: var(--stone-900); border: 1px solid var(--stone-600); color: var(--stone-300);
  border-radius: var(--radius); padding: .4rem 0; font-size: .76rem; font-weight: 600; cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.dice-mode:hover { border-color: var(--stone-400); color: var(--stone-100); }
.dice-mode.active { border-color: var(--amber-500); background: color-mix(in srgb, var(--amber-500) 18%, transparent); color: var(--amber-300); }
#diceDis.active { border-color: var(--red-500); background: rgba(239,68,68,.16); color: var(--red-400); }
.dice-clear { flex: 0 0 auto; padding: .4rem .7rem; color: var(--stone-500); }

.dice-result {
  font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  color: var(--amber-300); text-align: center; padding: .35rem .9rem; min-height: 2.6rem;
  font-variant-numeric: tabular-nums;
}
.dice-history {
  max-height: 110px; overflow-y: auto; font-size: .75rem; color: var(--stone-400);
  margin: 0; padding: 0 .9rem .85rem; line-height: 1.5;
}
.dice-history .log-entry { border-bottom: 1px solid var(--stone-800); padding: .25rem 0; }

/* Escenario 3D a pantalla completa (no intercepta clicks) */
.dice-stage {
  position: fixed; inset: 0; z-index: var(--z-dice-stage);
  pointer-events: none; opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-smooth);
}
.dice-stage.active { opacity: 1; }
.dice-stage canvas { width: 100% !important; height: 100% !important; display: block; }

/* Chip con el total al caer */
.dice-readout {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%) scale(.6);
  font-family: var(--font-display); font-size: clamp(3rem, 12vw, 6rem); font-weight: 700;
  color: var(--amber-300); opacity: 0;
  text-shadow: 0 4px 30px rgba(0,0,0,.7), 0 0 36px rgba(var(--primary-rgb),.55);
  font-variant-numeric: tabular-nums;
}
.dice-readout.show { animation: dice-readout-pop .5s var(--ease-bounce) forwards; }
@keyframes dice-readout-pop {
  0%   { opacity: 0; transform: translateX(-50%) scale(.4); }
  55%  { opacity: 1; transform: translateX(-50%) scale(1.12); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@media (max-width: 480px) {
  .dice-panel { width: calc(100vw - 2rem); }
  .dice-roller { right: 1rem; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dice-panel { animation: none; }
  .dice-readout.show { animation: none; opacity: 1; transform: translateX(-50%) scale(1); }
}
