/* ============================================================
   ENIGMA — sistema visual (v3, referencia "enigma-ui-reference-v2")
   ------------------------------------------------------------
   Papel cálido, tinta de alto contraste, un rojo ENIGMA solo para
   acciones principales y lo activo en la navegación. Dentro de los
   tableros la interacción usa --sel (petróleo): el rojo ahí se leería
   como error.

   Tipografía
     --font-display  Source Serif 4 — titulares (editorial).
     --font-ui       Geist — interfaz y texto.
     --font-num      Geist Mono — cronómetros y cifras tabulares.

   Disposición: barra lateral fija en escritorio (se reduce a un riel
   de iconos en las páginas de juego), cajón + pestañas en móvil.
   Alias antiguos (--paper, --ink-soft, --line-strong) para los
   motores de juego.
   ============================================================ */
:root {
  /* papel cálido + tinta, rojo ENIGMA solo para acciones y lo activo */
  --bg:          #FAF6F0;
  --surface:     #FFFFFF;
  --surface-2:   #F4EEE5;
  --surface-3:   #EBE3D6;
  --ink:         #1C1A18;
  --ink-2:       #4B4640;
  --muted:       #6F6860;
  --line:        #EAE2D5;
  --line-2:      #D9CFC0;
  --accent:      #C8302A;
  --accent-ink:  #A62520;
  --accent-weak: #FBE9E5;
  --on-accent:   #FFFFFF;
  /* interacción dentro de los tableros (cursor, palabra activa…):
     petróleo, NO el rojo de marca — el rojo en un tablero se lee como error */
  --sel:         #2A6E74;
  --sel-ink:     #1E5358;
  --sel-weak:    #E0ECEB;
  --success:     #2F7550;
  --success-weak:#E1EEE5;
  --warn:        #7A5A0C;
  --warn-weak:   #F4EAD2;
  --present:     #C39A32;
  --danger:      #B0271F;
  --danger-weak: #F8E1DE;
  --focus:       #C8302A;
  --on-ink:      #FAF6F0;
  /* tableros */
  --block:       #1C1A18;
  --board-lines: #D6CCBD;
  --hl-soft:     color-mix(in srgb, var(--sel) 12%, var(--surface));
  --hl-strong:   color-mix(in srgb, var(--sel) 28%, var(--surface));

  /* alias heredados */
  --paper: var(--bg);
  --paper-2: var(--surface-2);
  --ink-soft: var(--ink-2);
  --line-strong: var(--line-2);

  --font-ui: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-num: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: var(--font-ui);
  --font-serif: var(--font-display);

  --t-xs: .75rem;
  --t-sm: .875rem;
  --t-base: 1rem;
  --t-md: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.55rem, 1.3rem + 1vw, 2rem);
  --t-2xl: clamp(2.1rem, 1.6rem + 2.2vw, 3.1rem);
  --t-hero: clamp(2.8rem, 1.8rem + 4.2vw, 5.2rem);

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --gutter: clamp(16px, 3vw, 40px);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;
  --radius: var(--r-lg); --radius-s: var(--r-sm);
  --shadow-sm: 0 1px 2px rgba(60,40,20,.06);
  --shadow-md: 0 1px 2px rgba(60,40,20,.05), 0 10px 30px -12px rgba(60,40,20,.18);
  --shadow-lg: 0 2px 6px rgba(60,40,20,.06), 0 28px 60px -20px rgba(60,40,20,.28);

  --w-page: 1280px;
  --w-text: 640px;
  --wrap: var(--w-page);
  --header-h: 72px;
  --sidebar-w: 248px;
  --rail-w: 72px;
  --tabbar-h: 64px;

  --ease: cubic-bezier(.2,.8,.2,1);
  --dur: .18s;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:          #141312;
  --surface:     #1C1B19;
  --surface-2:   #24221F;
  --surface-3:   #2E2B27;
  --ink:         #F1ECE4;
  --ink-2:       #C4BDB3;
  --muted:       #9A938A;
  --line:        #2D2A26;
  --line-2:      #3D3934;
  --accent:      #E5534B;
  --accent-ink:  #F07A72;
  --accent-weak: #3A1F1C;
  --sel:         #62B5AD;
  --sel-ink:     #8FD0C9;
  --sel-weak:    #1C3533;
  --success:     #78B68C;
  --success-weak:#1D3125;
  --warn:        #D2B062;
  --warn-weak:   #372D17;
  --present:     #C9A445;
  --danger:      #EB8A7D;
  --danger-weak: #3B221E;
  --focus:       #E5534B;
  --on-ink:      #141312;
  --block:       #050505;
  --board-lines: #000;
  --hl-soft:     color-mix(in srgb, var(--sel) 20%, var(--surface));
  --hl-strong:   color-mix(in srgb, var(--sel) 38%, var(--surface));
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.3), 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
::selection { background: var(--accent-weak); color: var(--ink); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh; min-height: 100dvh;
}

h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--ink); font-weight: 600; letter-spacing: -.012em; line-height: 1.2; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-2xl); line-height: 1.05; letter-spacing: -.02em; }
h2 { font-size: var(--t-lg); letter-spacing: -.015em; }
h3 { font-size: var(--t-md); }
p { margin: 0 0 1rem; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
strong { font-weight: 600; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

.wrap { width: 100%; max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter); }
/* el contenido aprovecha TODO el ancho junto a la barra lateral (como la
   referencia); solo en pantallas enormes se limita para no estirar líneas */
.page { display: block; width: 100%; max-width: 1760px; margin: 0 auto; padding: 4px clamp(16px, 2vw, 28px) clamp(56px, 6vw, 80px); flex: 1; }
.page:focus { outline: none; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { left: 8px; }
.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;
}

svg.ico { width: 18px; height: 18px; flex: none; }
svg.chev { width: 16px; height: 16px; color: var(--muted); transition: transform var(--dur) var(--ease), color var(--dur); }
a:hover > svg.chev, a:hover .today-item-foot svg.chev { transform: translateX(3px); color: var(--ink); }

@media (max-width: 560px) { .hide-sm { display: none !important; } }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* aparición suave (core.js añade .will-reveal a secciones) */
.will-reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.will-reveal.is-revealed { opacity: 1; transform: none; }

/* ============================================================
   DISPOSICIÓN: barra lateral + columna principal
   ============================================================ */
.app { display: block; }
.app-main { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin-left: var(--sidebar-w); transition: margin-left .25s var(--ease); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 80; width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px 16px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 22px; }
.sidebar .sidebar-close { display: none; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: #0b0a09; object-fit: cover; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: .02em; }
.brand-tag { font-size: .74rem; color: var(--muted); margin-top: 3px; letter-spacing: .01em; }

.side-nav, .side-cats { display: flex; flex-direction: column; gap: 2px; }
.side-link, .side-cat > summary {
  display: flex; align-items: center; gap: 13px; min-height: 42px; padding: 0 12px;
  border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500;
  cursor: pointer; transition: background var(--dur), color var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.side-link svg.ico, .side-cat > summary svg.ico { width: 20px; height: 20px; color: var(--ink-2); }
.side-link:hover, .side-cat > summary:hover { background: var(--surface-2); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--accent-weak); color: var(--accent-ink); font-weight: 600; }
.side-link[aria-current="page"] svg.ico { color: var(--accent); }
.side-label { margin: 22px 12px 8px; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.side-nav { padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.side-cat > summary { list-style: none; }
.side-cat > summary::-webkit-details-marker { display: none; }
.side-cat .side-chev { margin-left: auto; width: 15px; height: 15px; color: var(--muted); transition: transform .2s var(--ease); }
.side-cat[open] > summary { color: var(--ink); }
.side-cat[open] .side-chev { transform: rotate(90deg); }
.side-cat ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 45px; }
.side-cat[open] ul { animation: side-open .2s var(--ease); }
@keyframes side-open { from { opacity: 0; transform: translateY(-4px); } }
.side-cat li a {
  display: block; padding: 7px 10px; border-radius: 8px; font-size: .9rem; color: var(--ink-2); text-decoration: none;
  transition: background var(--dur), color var(--dur);
}
.side-cat li a:hover { background: var(--surface-2); color: var(--ink); }
.side-cat li a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }
.side-cat li a.side-all { color: var(--muted); font-size: .84rem; }
.side-count { margin-left: auto; font-size: .75rem; color: var(--muted); font-family: var(--font-num); }
.side-link-all { margin-top: 2px; }

.sidebar-foot { margin-top: auto; padding: 18px 8px 0; }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
.theme-switch button {
  display: grid; place-items: center; width: 38px; height: 32px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--muted); cursor: pointer; transition: all var(--dur);
}
.theme-switch button svg { width: 17px; height: 17px; }
:root[data-theme="light"] .theme-switch [data-theme-set="light"],
:root[data-theme="dark"] .theme-switch [data-theme-set="dark"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: var(--s-4);
  height: var(--header-h); padding: 0 clamp(16px, 2vw, 28px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar .menu-btn, .topbar .brand-compact, .topbar .search-open { display: none; }
.topbar-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-pill); border: 0; background: transparent; color: var(--ink-2);
  cursor: pointer; text-decoration: none; transition: background var(--dur), color var(--dur);
}
.icon-btn:hover, .icon-btn[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font-size: .82rem; font-weight: 600;
  text-transform: uppercase; text-decoration: none; transition: box-shadow var(--dur);
}
.avatar:hover, .avatar[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line-2); }

/* ---------- búsqueda global ---------- */
.search { position: relative; flex: 1 1 auto; max-width: 440px; }
.search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 44px 0 44px; border-radius: var(--r-pill);
  font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid transparent;
  transition: background var(--dur), border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search input:hover { border-color: var(--line-2); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--line-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center;
  font-family: var(--font-num); font-size: .72rem; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface);
}
.search input:focus ~ .search-kbd { display: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 90;
  max-height: min(70vh, 460px); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.search-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.search-item[aria-selected="true"], .search-item:hover { background: var(--surface-2); }
.search-item .glyph { width: 36px; height: 36px; border-radius: 9px; }
.search-item .glyph svg { width: 21px; height: 21px; }
.search-item-t { font-weight: 600; font-size: .95rem; }
.search-item-t mark { background: none; color: var(--accent-ink); }
.search-item-k { display: block; font-size: .78rem; color: var(--muted); }
.search-empty { padding: 16px 12px; color: var(--muted); font-size: .9rem; }
.search-group { padding: 8px 10px 4px; font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- pie ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: auto; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6);
  max-width: 1760px; margin: 0 auto; padding: var(--s-6) clamp(16px, 2vw, 28px);
  font-size: var(--t-sm); color: var(--muted);
}
.footer-brand { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.footer-brand strong { color: var(--ink); font-family: var(--font-display); font-size: 1rem; letter-spacing: .02em; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-left: auto; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* ---------- páginas de juego: la barra lateral se reduce a un riel ---------- */
@media (min-width: 1025px) {
  .play-body .sidebar { width: var(--rail-w); padding-left: 10px; padding-right: 10px; }
  .play-body .app-main { margin-left: var(--rail-w); }
  .play-body .side-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .play-body .sidebar .brand-text, .play-body .side-label,
  .play-body .side-cats, .play-body .theme-switch [data-theme-set] + [data-theme-set] { display: none; }
  .play-body .sidebar-head { padding: 0 0 18px; justify-content: center; }
  .play-body .side-link { justify-content: center; padding: 0; }
  .play-body .side-nav { border-bottom: 0; }
  .play-body .sidebar-foot { padding: 0; display: flex; justify-content: center; }
  .play-body .theme-switch { background: transparent; border: 0; padding: 0; }
  .play-body .topbar { height: 60px; }
  .play-body .site-footer { display: none; }
}

/* ---------- tablet: riel de iconos ---------- */
@media (max-width: 1024px) and (min-width: 721px) {
  .sidebar { width: var(--rail-w); padding-left: 10px; padding-right: 10px; }
  .app-main { margin-left: var(--rail-w); }
  .side-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sidebar .brand-text, .side-label, .side-cats, .side-count { display: none; }
  .sidebar-head { padding: 0 0 18px; justify-content: center; }
  .side-link { justify-content: center; padding: 0; }
  .side-nav { border-bottom: 0; }
  .sidebar-foot { padding: 0; display: flex; justify-content: center; }
  .theme-switch { flex-direction: column; }
  .sidebar.is-open { width: var(--sidebar-w); padding-left: 14px; padding-right: 14px; box-shadow: var(--shadow-lg); }
  .sidebar.is-open .brand-text, .sidebar.is-open .side-label { display: revert; }
  .sidebar.is-open .side-link span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .sidebar.is-open .side-cats { display: flex; }
  .sidebar.is-open .side-link { justify-content: flex-start; padding: 0 12px; }
  .sidebar.is-open .sidebar-head { justify-content: space-between; padding: 0 8px 22px; }
  .sidebar.is-open .theme-switch { flex-direction: row; }
  .sidebar.is-open .sidebar-close { display: inline-grid; }
  .topbar .menu-btn { display: inline-grid; }
}

/* ---------- móvil: cajón + pestañas ---------- */
.tabbar { display: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 75; background: rgba(20,15,10,.38); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@media (max-width: 720px) {
  :root { --header-h: 60px; }
  .app-main { margin-left: 0; }
  .sidebar {
    width: min(320px, 86vw); transform: translateX(-102%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .sidebar .sidebar-close { display: inline-grid; }
  .topbar { gap: 4px; padding: 0 8px 0 4px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar .brand-compact { display: inline-flex; }
  .brand-compact .brand-name { font-size: 1.25rem; }
  .brand-compact .brand-mark { width: 28px; height: 28px; border-radius: 7px; }
  .brand-compact { gap: 9px; margin-left: 2px; }
  .topbar .search-open { display: inline-grid; }
  .search { display: none; }
  .topbar.is-searching .search { display: block; position: absolute; left: 8px; right: 8px; max-width: none; }
  .topbar.is-searching > :not(.search) { visibility: hidden; }
  .search-kbd { display: none; }
  .footer-links { margin-left: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--muted); text-decoration: none; font: inherit; font-size: .69rem; font-weight: 500;
    -webkit-tap-highlight-color: transparent; cursor: pointer;
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--accent); }
  body:not(.play-body) { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .play-body .tabbar { display: none; }
  .play-body .site-footer { display: none; }
}

/* ============================================================
   TIPOGRAFÍA DE PÁGINA
   ============================================================ */
.eyebrow, .overline {
  display: block; margin: 0 0 var(--s-3);
  font-size: var(--t-xs); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.page-head { max-width: var(--w-text); margin: clamp(8px, 1.5vw, 16px) 0 clamp(24px, 3.5vw, 40px); }
.page-head h1 { margin-bottom: var(--s-4); }
.lede, .hero-lede { font-size: var(--t-md); color: var(--ink-2); max-width: 58ch; margin: 0 0 var(--s-5); line-height: 1.55; }
.page-head .lede { margin-bottom: 0; }
.muted { color: var(--muted); }
.dot-sep::before { content: "·"; margin: 0 .45em; color: var(--muted); }

.section { margin-top: clamp(30px, 3vw, 44px); }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.section-head h2 { margin: 0; font-size: var(--t-lg); }
.section-head .eyebrow { margin: 0; }
.section-head a { font-size: var(--t-sm); color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
.section-head a:hover { color: var(--ink); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  font: inherit; font-size: .9375rem; font-weight: 500; line-height: 1; letter-spacing: -.005em;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--r-pill);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease,
              transform .08s ease, box-shadow var(--dur) ease;
}
.btn:hover { --btn-bg: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary, .btn-accent {
  --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent);
  font-weight: 600;
}
.btn-primary:hover, .btn-accent:hover { --btn-bg: var(--accent-ink); --btn-bd: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: var(--on-ink); --btn-bd: var(--ink); }
.btn-dark:hover { --btn-bg: color-mix(in srgb, var(--ink) 86%, var(--bg)); --btn-bd: var(--btn-bg); }
.btn-ghost { --btn-bg: transparent; --btn-bd: var(--line-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-quiet { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--ink-2); padding: 0 12px; }
.btn-quiet:hover { --btn-bg: var(--surface-2); --btn-fg: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--t-sm); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; color: var(--ink); text-decoration: none;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--dur) var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }
.link-arrow.quiet { color: var(--ink-2); }
.link-arrow.quiet:hover { color: var(--ink); }

/* ============================================================
   CHIPS / ETIQUETAS / ESTADO
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 500; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
/* niveles: una escala discreta de puntos en vez de colores fuertes */
.chip[data-difficulty] { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.chip[data-difficulty]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
}
.chip[data-difficulty="muy_facil"]::before, .chip[data-difficulty="facil"]::before { background: var(--success); }
.chip[data-difficulty="medio"]::before { background: var(--sel); }
.chip[data-difficulty="dificil"]::before { background: var(--warn); }
.chip[data-difficulty="experto"]::before, .chip[data-difficulty="maestro"]::before { background: var(--danger); }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 500; color: var(--muted); white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.state[data-state="in-progress"] { color: var(--accent-ink); }
.state[data-state="in-progress"]::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.state[data-state="completed"], .state[data-state="perfect"] { color: var(--success); }
.state[data-state="completed"]::before, .state[data-state="perfect"]::before { background: currentColor; }
.state:empty { display: none; }

/* ============================================================
   GLIFOS DE JUEGO (identidad de cada juego, monocromos)
   ============================================================ */
.glyph {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink);
}
.glyph svg { width: 26px; height: 26px; }
.glyph-lg { width: 56px; height: 56px; border-radius: 14px; }
.glyph-lg svg { width: 32px; height: 32px; }
.glyph-sm { width: 34px; height: 34px; border-radius: 9px; }
.glyph-sm svg { width: 20px; height: 20px; }

/* ============================================================
   LISTAS EN FILAS (catálogo, diarios, historial)
   ============================================================ */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: var(--s-4); padding: var(--s-4) var(--s-2); border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background var(--dur) ease;
}
a.row:hover, .row.is-link:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row-main { min-width: 0; }
.row-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: var(--t-md); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.row-title a { text-decoration: none; }
.row-title a::after { content: ""; position: absolute; inset: 0; }
.row-desc { margin: 2px 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.row-meta { margin: 4px 0 0; font-size: var(--t-xs); color: var(--muted); }
.row-end { display: flex; align-items: center; gap: var(--s-3); position: relative; z-index: 1; }
.row-end .chev { width: 18px; height: 18px; color: var(--muted); transition: transform var(--dur) var(--ease), color var(--dur); }
a.row:hover .chev, .row.is-link:hover .chev { transform: translateX(3px); color: var(--ink); }
@media (max-width: 560px) {
  .row { gap: var(--s-3); padding-left: 0; padding-right: 0; }
  .row .hide-sm { display: none; }
}

/* ============================================================
   TARJETAS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 28px);
}
a.card { display: block; text-decoration: none; color: inherit; transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease); }
a.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }

/* tarjeta de contenido del archivo */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s-3); }
.puzzle-card {
  display: flex; flex-direction: column; gap: 6px; min-height: 148px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; text-decoration: none; color: inherit;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.puzzle-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.puzzle-card .pc-type { font-size: var(--t-xs); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.puzzle-card .pc-title { font-size: var(--t-md); font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.puzzle-card .pc-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--t-xs); color: var(--muted); }
.puzzle-card .pc-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.puzzle-card .pc-status { margin-left: auto; font-weight: 500; }
.puzzle-card .pc-status[data-state="completed"], .puzzle-card .pc-status[data-state="perfect"] { color: var(--success); }
.puzzle-card .pc-status[data-state="in-progress"] { color: var(--accent-ink); }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.field { margin-bottom: var(--s-5); }
.field-label { display: block; margin-bottom: var(--s-2); font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.field-label em { font-style: normal; font-weight: 400; color: var(--muted); }
.field-hint { margin: var(--s-2) 0 0; font-size: var(--t-sm); color: var(--muted); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="search"], .field textarea, .select,
.filter-bar select, .filter-bar input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:hover, .field input:hover, .field textarea:hover, .select:hover, .filter-bar select:hover, .filter-bar input:hover { border-color: color-mix(in srgb, var(--line-2) 50%, var(--ink-2)); }
.input:focus, .field input:focus, .field textarea:focus, .select:focus, .filter-bar select:focus, .filter-bar input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.select, .filter-bar select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5l3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type="checkbox"] { accent-color: var(--accent); }

/* selector segmentado (niveles, tamaños…) */
.segmented, .choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.choice {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  font: inherit; font-size: var(--t-sm); font-weight: 500;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2);
  cursor: pointer; touch-action: manipulation; transition: all var(--dur) ease;
}
.choice:hover { color: var(--ink); border-color: color-mix(in srgb, var(--line-2) 40%, var(--ink-2)); }
.choice.is-selected, .choice[aria-pressed="true"], .choice[aria-checked="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.choice-row.is-locked .choice, .is-locked-choice { cursor: default; }

/* ============================================================
   AVISOS / VACÍOS
   ============================================================ */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; margin-bottom: var(--s-5); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink); font-size: var(--t-sm);
}
.notice.is-error { background: var(--danger-weak); color: var(--danger); }
.notice.is-ok { background: var(--success-weak); color: var(--success); }
.empty-note, .empty-state {
  padding: clamp(32px, 6vw, 56px) var(--s-5); text-align: center; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
}
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state p { margin: 0 auto var(--s-4); max-width: 42ch; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--ink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PORTADA
   ============================================================ */
.h-serif { font-family: var(--font-display); font-weight: 600; font-size: var(--t-xl); letter-spacing: -.02em; }
.section-sub { font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 10px; }
.accent-link, .section-head a.accent-link { color: var(--accent-ink); }
.accent-link:hover { color: var(--accent); }

/* ---------- hero (banner editorial ENIGMA) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(450px, 41%) minmax(0, 1fr); align-items: stretch;
  min-height: clamp(300px, 22vw, 400px);
  border-radius: var(--r-xl); border: 1px solid var(--line);
  background:
    radial-gradient(80% 120% at 72% 40%, #FFFDF9 0%, transparent 62%),
    linear-gradient(120deg, #F8F2E8 0%, #F1E6D5 55%, #E9DAC3 100%);
}
:root[data-theme="dark"] .hero { background: radial-gradient(80% 120% at 72% 40%, #2A2621 0%, transparent 60%), linear-gradient(120deg, #1F1C19, #171513); }
.hero-copy { position: relative; z-index: 2; align-self: center; padding: clamp(28px, 3.4vw, 56px) 0 clamp(28px, 3.4vw, 52px) clamp(28px, 3.4vw, 56px); }
.hero-brand { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 1.6rem + 3.8vw, 5.4rem); line-height: .9; letter-spacing: .005em; color: var(--ink); }
.hero-title { margin: 4px 0 14px; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.7rem, 1.1rem + 1.7vw, 2.75rem); line-height: 1.08; letter-spacing: -.015em; }
.hero-sub { margin: 0 0 26px; font-size: clamp(1rem, .92rem + .3vw, 1.15rem); color: var(--ink-2); line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { position: relative; z-index: 1; min-height: 100%; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding: 28px 22px 4px; }
  .hero-visual { min-height: 0; aspect-ratio: 760 / 330; margin: 0 -2px -2px; }
}
@media (max-width: 480px) { .hero-actions .btn { flex: 1 1 auto; } }
.hero-copy > * { animation: rise .6s var(--ease) backwards; }
.hero-copy > :nth-child(2) { animation-delay: .05s; }
.hero-copy > :nth-child(3) { animation-delay: .1s; }
.hero-copy > :nth-child(4) { animation-delay: .15s; }
.hero-visual { animation: rise .8s .1s var(--ease) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.section-tight { margin-top: 16px; }
.btn-soft { --btn-bg: var(--accent-weak); --btn-fg: var(--accent-ink); --btn-bd: transparent; font-weight: 600; min-height: 42px; }
.btn-soft:hover { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }

/* ---------- juego del día ---------- */
.daily-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s-4); }
@media (max-width: 980px) { .daily-grid { grid-template-columns: minmax(0, 1fr); } }
.daily-feature {
  display: grid; grid-template-columns: minmax(0, min(45%, 360px)) minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center;
  padding: clamp(16px, 2.4vw, 24px); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: box-shadow .25s var(--ease), border-color .25s;
}
.daily-feature:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.daily-feature-board { display: grid; place-items: center; aspect-ratio: 1.15 / 1; max-height: 300px; padding: clamp(14px, 2.5vw, 26px); border-radius: var(--r-lg); background: var(--surface-2); color: var(--ink); }
.daily-feature-board svg { width: 100%; height: 100%; max-height: 240px; }
.daily-feature-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.daily-feature h3 { margin: 0; font-family: var(--font-display); font-size: var(--t-xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
.daily-feature-tag { margin: 0; color: var(--ink-2); font-size: var(--t-sm); }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: var(--t-sm); color: var(--muted); }
.feature-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.feature-meta svg.ico { width: 15px; height: 15px; }
.daily-cta { margin-top: 6px; pointer-events: none; }
.daily-feature:hover .daily-cta { --btn-bg: var(--accent-ink); --btn-bd: var(--accent-ink); }
@media (max-width: 560px) { .daily-feature { grid-template-columns: minmax(0, 1fr); } .daily-feature-board { aspect-ratio: 2 / 1; } }

.daily-more { padding: 18px 18px 8px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.daily-more-h { margin: 0 0 6px 4px; font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mini-rows { list-style: none; margin: 0; padding: 0; }
.mini-rows li + li { border-top: 1px solid var(--line); }
.mini-rows a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; text-decoration: none; color: inherit; border-radius: 10px; transition: background var(--dur); }
.mini-rows a:hover { background: var(--surface-2); }
.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-t { font-weight: 600; font-size: .95rem; }
.mini-m { font-size: var(--t-xs); color: var(--muted); }
.mini-rows .state { margin-left: auto; }

/* ---------- continuar ---------- */
.continue-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-3); }
.continue-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: box-shadow var(--dur), border-color var(--dur);
}
.continue-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.continue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.continue-k { font-size: var(--t-xs); color: var(--muted); }
.continue-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-m { font-family: var(--font-num); font-size: var(--t-xs); color: var(--accent-ink); white-space: nowrap; }

/* ---------- banner de ajedrez ---------- */
.chess-banner {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(470px, .85fr) minmax(0, 1.4fr); align-items: center;
  min-height: clamp(260px, 19vw, 330px); border-radius: var(--r-xl); color: #F6EFE4;
  background:
    radial-gradient(90% 120% at 70% 100%, rgba(196,137,78,.28) 0%, transparent 60%),
    linear-gradient(120deg, #231913 0%, #2E2118 45%, #1A130E 100%);
}
.chess-banner::after { /* tablero en perspectiva, muy tenue */
  content: ""; position: absolute; left: 34%; right: -10%; bottom: -30%; height: 70%; z-index: -1;
  background: repeating-conic-gradient(rgba(255,255,255,.07) 0 25%, transparent 0 50%) 0 0 / 64px 64px;
  transform: perspective(420px) rotateX(58deg); transform-origin: bottom; opacity: .8;
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent 95%); mask-image: linear-gradient(to top, #000 20%, transparent 95%);
}
.chess-banner-copy { padding: clamp(24px, 3.5vw, 44px); }
.chess-kicker { margin: 0 0 8px; font-size: var(--t-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #F07A72; }
.chess-banner h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); color: #FFF9F0; letter-spacing: -.01em; line-height: 1; }
.chess-banner p { color: rgba(246,239,228,.82); margin: 0 0 22px; }
.chess-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-onDark { --btn-bg: transparent; --btn-fg: #F6EFE4; --btn-bd: rgba(246,239,228,.35); }
.btn-onDark:hover { --btn-bg: rgba(246,239,228,.1); }
.chess-banner-pieces { display: flex; align-items: flex-end; justify-content: space-evenly; gap: 0; padding: 14px clamp(12px, 2.4vw, 36px) 22px 0; min-height: 200px; overflow: hidden; }
.deco-piece { display: block; width: clamp(60px, 8.6vw, 160px); margin: 0 -0.6vw; flex: none; filter: drop-shadow(0 12px 14px rgba(0,0,0,.45)); animation: piece-in .7s var(--ease) backwards; animation-delay: calc(var(--i) * 60ms + .1s); }
.deco-piece svg { width: 100%; height: auto; }
.deco-p { width: clamp(50px, 6.6vw, 120px); }
@keyframes piece-in { from { opacity: 0; transform: translateY(14px); } }
/* las piezas se escalan con el ancho REAL del banner (consultas de
   contenedor): siempre caben todas, sin cortes */
.chess-banner-pieces { container-type: inline-size; }
.chess-banner-pieces .deco-piece { width: min(14.4cqw, 164px); margin: 0 -0.4cqw; }
.chess-banner-pieces .deco-p { width: min(11cqw, 122px); }
@container (max-width: 760px) {
  .chess-banner-pieces .deco-piece:nth-child(n+7) { display: none; }
  .chess-banner-pieces .deco-piece { width: 17.4cqw; }
  .chess-banner-pieces .deco-p { width: 13.5cqw; }
}
@media (max-width: 900px) {
  .chess-banner { grid-template-columns: minmax(0, 1fr); }
  .chess-banner-pieces { order: -1; padding: 22px 12px 0; min-height: 0; overflow: hidden; justify-content: flex-start; }
  .deco-piece { width: 58px; } .deco-p { width: 46px; }
  .chess-banner-copy { padding-top: 10px; }
}

/* ---------- categorías ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 1280px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 480px) {
  .cat-card-body { padding: 10px 12px 12px; }
  .cat-card h3 { font-size: 1.05rem; }
  .cat-card p { display: none; }
  .cat-card-foot { padding-top: 6px; font-size: var(--t-xs); }
  .round-arrow { width: 26px; height: 26px; }
}
.cat-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.cat-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); transform: translateY(-2px); }
.cat-card-art { aspect-ratio: 320 / 132; overflow: hidden; background: var(--surface-2); }
.cat-art { width: 100%; height: 100%; display: block; transition: transform .6s var(--ease); }
.cat-card:hover .cat-art { transform: scale(1.04); }
.cat-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 14px 16px 14px; }
.cat-card h3 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.cat-card p { margin: 0; font-size: var(--t-sm); color: var(--muted); line-height: 1.4; }
.cat-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; font-size: var(--t-sm); color: var(--muted); }
.round-arrow { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); transition: background var(--dur), color var(--dur); }
.round-arrow svg { width: 16px; height: 16px; }
.cat-card:hover .round-arrow { background: var(--accent); color: var(--on-accent); }
.cat-pieces { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; padding: 12px 10px 6px; }
.cat-pieces .deco-piece { width: 62px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); }
.cat-pieces .deco-p { width: 70px; }

/* ============================================================
   BIBLIOTECA /juegos, CATEGORÍAS
   ============================================================ */
.section-first { margin-top: 0; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); }
.game-grid-lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.game-card {
  display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  transition: box-shadow .22s var(--ease), border-color .22s;
}
.game-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.game-card-link { display: flex; gap: 14px; padding: 16px 16px 10px; text-decoration: none; color: inherit; flex: 1; }
.game-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.game-card-name { font-weight: 650; font-size: 1.02rem; letter-spacing: -.01em; }
.game-card-link:hover .game-card-name { color: var(--accent-ink); }
.game-card-tag { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.game-card-meta { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.game-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 12px 12px 74px; }
.game-card-foot .state { margin-right: auto; }
.game-card-foot .btn svg { width: 14px; height: 14px; }
.game-card-foot .btn:hover { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent); }

.cat-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; overflow: hidden;
  border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); margin-bottom: var(--s-6);
}
.cat-hero-copy { padding: clamp(22px, 3.5vw, 44px); }
.cat-hero-copy h1 { margin: 10px 0 10px; }
.cat-hero-copy .lede { margin: 0; }
.cat-hero-art { min-height: 180px; }
.cat-hero-art .cat-art { height: 100%; }
@media (max-width: 720px) { .cat-hero { grid-template-columns: minmax(0, 1fr); } .cat-hero-art { order: -1; min-height: 0; aspect-ratio: 320 / 132; } }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row .choice { gap: 8px; text-decoration: none; }
.chip-row .choice svg { width: 17px; height: 17px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5); max-width: none; }

/* ============================================================
   PÁGINA DE UN JUEGO /juegos/<slug>
   ============================================================ */
.hub-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .hub-head { grid-template-columns: minmax(0, 1fr); } }
.hub-title { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-4); }
.hub-title h1 { margin: 0; }
.hub-rules { list-style: none; margin: var(--s-5) 0 0; padding: 0; counter-reset: rule; max-width: 56ch; }
.hub-rules li { counter-increment: rule; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--t-sm); }
.hub-rules li::before { content: counter(rule); font-family: var(--font-num); color: var(--muted); font-size: var(--t-xs); padding-top: 2px; }
.hub-play { display: flex; flex-direction: column; gap: var(--s-4); }
.hub-play .card { display: flex; flex-direction: column; gap: var(--s-4); }
.hub-play h2 { margin: 0; font-size: var(--t-base); }
.hub-play .feature-meta { font-size: var(--t-sm); }
.new-game { display: flex; flex-direction: column; gap: var(--s-3); }
.new-game .segmented .choice { flex: 1 1 auto; white-space: nowrap; padding: 0 12px; }
.new-game-status { min-height: 1.2em; font-size: var(--t-sm); color: var(--muted); margin: 0; }
.new-game-status.is-error { color: var(--danger); }

.crumb { font-size: var(--t-sm); margin-bottom: var(--s-5); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 var(--s-5); font-size: var(--t-sm); color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }
.variant:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.crumb svg { width: 15px; height: 15px; }
.crumb:hover svg { transform: translateX(-3px); }
.hub-intro .lede { margin-bottom: var(--s-2); }
.hub-sub { margin: var(--s-6) 0 0; font-size: var(--t-xs); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hub-intro .hub-rules { margin-top: var(--s-3); }
.hub-today { gap: var(--s-4); }
.hub-preview { display: grid; place-items: center; padding: 18px; border-radius: var(--r-md); background: var(--surface-2); aspect-ratio: 1.5 / 1; }
.hub-preview svg { width: 100%; height: 100%; max-height: 180px; }
.hub-today-title { margin: 0 0 6px; font-size: var(--t-md); }
.hub-today .btn { pointer-events: none; }
a.card.hub-today:hover .btn-primary { --btn-bg: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.new-game h2 { margin: 0; font-size: var(--t-base); }
.row-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--t-base); font-weight: 500; line-height: 1; }
.row-date small { font-size: .62rem; color: var(--muted); margin-top: 3px; }
.discipline .more-link { border-bottom: 0; }
.discipline .more-link .d-desc { color: var(--ink-2); font-weight: 500; }

.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); }
.variant { display: flex; flex-direction: column; gap: var(--s-3); padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.variant h3 { margin: 0; font-size: var(--t-md); }
.variant p { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.variant .row-meta { margin: 0; }
.variant-actions { display: flex; gap: var(--s-2); margin-top: auto; padding-top: var(--s-2); }

/* ============================================================
   JUEGO DIARIO /hoy
   ============================================================ */
.daily-progress { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-5); }
.daily-bar { flex: 1; max-width: 280px; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.daily-bar span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .6s var(--ease); }
.daily-count { font-size: var(--t-sm); color: var(--muted); }
.daily-row .row-meta .older { color: var(--warn); }

/* ============================================================
   ARCHIVO / ESTADÍSTICAS
   ============================================================ */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-6); align-items: end; }
.filter-bar .f { display: flex; flex-direction: column; gap: 6px; }
.filter-bar label { font-size: var(--t-xs); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.filter-bar .f-search { grid-column: span 2; }
@media (max-width: 560px) { .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filter-bar .f-search { grid-column: 1 / -1; } }
.result-count { font-size: var(--t-sm); color: var(--muted); margin: 0 0 var(--s-4); }

.stats-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3); margin: 0 0 var(--s-7); }
.stat-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.table-scroll:has(.empty-state:not([hidden])) table { display: none; }
.stat-value { font-family: var(--font-num); font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem); line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-sub, .stat-label { margin-top: 6px; font-size: var(--t-sm); color: var(--muted); }
.stat-breakdown { font-size: var(--t-sm); color: var(--muted); }
.stats-foot { font-size: var(--t-sm); color: var(--muted); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.history-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 560px; }
.history-table th, .history-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.history-table th { font-weight: 500; color: var(--muted); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; }
.history-table td { color: var(--ink-2); }
.history-table a { color: var(--ink); text-decoration: none; font-weight: 500; }
.history-table a:hover { text-decoration: underline; }

/* ============================================================
   OBJETOS (/print) — taller privado
   ============================================================ */
.pack {
  display: grid; grid-template-columns: minmax(260px, 400px) 1fr; gap: clamp(20px, 4vw, 48px);
  background: #121315; color: #EEEADE; border-radius: var(--r-xl);
  padding: clamp(20px, 4vw, 40px); margin-top: var(--s-6);
}
@media (max-width: 760px) { .pack { grid-template-columns: 1fr; } }
.pack-preview { align-self: start; border-radius: var(--r-md); overflow: hidden; }
.pack-preview img { width: 100%; height: auto; }
.pack-kicker { font-size: var(--t-xs); letter-spacing: .2em; text-transform: uppercase; color: rgba(238,234,222,.6); margin: 0 0 8px; }
.pack-name { font-family: var(--font-display); font-weight: 400; font-size: var(--t-xl); color: #EEEADE; margin: 0 0 16px; }
.pack-desc { color: rgba(238,234,222,.72); max-width: 54ch; }
.pack-games { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
@media (max-width: 460px) { .pack-games { grid-template-columns: 1fr; } }
.pack-games li { display: flex; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(238,234,222,.12); font-size: var(--t-sm); }
.pack-games .pg-n { font-family: var(--font-num); color: rgba(238,234,222,.7); }
.pack-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0 0 24px; }
.pack-meta div { display: flex; flex-direction: column; gap: 2px; }
.pack-meta dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(238,234,222,.5); }
.pack-meta dd { margin: 0; font-size: var(--t-sm); }
.pack .btn-accent { --btn-bg: #EEEADE; --btn-fg: #121315; --btn-bd: #EEEADE; }
.pack .btn-ghost { --btn-fg: #EEEADE; --btn-bd: rgba(238,234,222,.28); }
.pack .btn-ghost:hover { --btn-bg: rgba(238,234,222,.08); }
.obj-list { display: flex; flex-direction: column; gap: var(--s-4); margin-top: var(--s-5); }
.obj-card { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(18px, 3vw, 28px); }
@media (max-width: 720px) { .obj-card { grid-template-columns: 1fr; } }
.obj-preview { border-radius: var(--r-md); overflow: hidden; background: #0b0a09; align-self: start; }
.obj-preview img { width: 100%; height: auto; }
.obj-preview-empty { aspect-ratio: 1.414; display: grid; place-items: center; color: var(--muted); letter-spacing: .2em; }
.obj-body { min-width: 0; display: flex; flex-direction: column; }
.obj-code { font-size: var(--t-lg); margin: 0 0 6px; }
.obj-desc { color: var(--ink-2); margin: 0 0 16px; max-width: 52ch; }
.obj-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 20px; }
.obj-meta div { display: flex; flex-direction: column; gap: 2px; }
.obj-meta dt { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.obj-meta dd { margin: 0; font-size: var(--t-sm); }
.obj-file { font-family: var(--font-num); font-size: var(--t-xs); word-break: break-all; }
.obj-status { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--t-xs); font-weight: 500; }
.pack .obj-status { background: rgba(238,234,222,.12); color: #EEEADE; }
.obj-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: auto; }
.obj-card-empty { border-style: dashed; background: transparent; }
.obj-slot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; color: var(--muted); }
.obj-slot-plus { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; place-items: center; }

/* ============================================================
   FORMULARIO EN TARJETA (cuenta, damas…)
   ============================================================ */
.option-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(20px, 4vw, 32px); }
.form-h2 { margin: 0 0 var(--s-5); font-size: var(--t-lg); }
.btn-create { width: 100%; min-height: 52px; font-size: 1rem; }

/* ============================================================
   MERIDIANO
   ============================================================ */
.meridiano-hero { padding: clamp(24px, 4vw, 48px); border-radius: var(--r-xl); border: 1px solid var(--line);
  background: radial-gradient(90% 120% at 100% 0%, #FFFDF9, transparent 60%), linear-gradient(135deg, #F5ECDD, #EDE1CD); }
:root[data-theme="dark"] .meridiano-hero { background: var(--surface); }
.meridiano-hero h1 { font-size: var(--t-hero); margin: 10px 0 12px; }
.meridiano-hero .lede { max-width: 60ch; }
.meridiano-facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 22px 0 0; }
.meridiano-facts div { display: flex; flex-direction: column-reverse; }
.meridiano-facts dt { font-size: var(--t-sm); color: var(--muted); }
.meridiano-facts dd { margin: 0; font-size: 1.8rem; font-weight: 500; }
.print-strip { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: center; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.print-strip img { width: 100%; border-radius: var(--r-sm); }
.print-strip h3 { margin: 6px 0; font-family: var(--font-display); font-size: 1.3rem; }
@media (max-width: 560px) { .print-strip { grid-template-columns: 1fr; } }

/* ============================================================
   ERROR
   ============================================================ */
.error-page { text-align: center; padding: clamp(40px, 12vw, 120px) 0; max-width: 520px; margin: 0 auto; }
.error-code { font-family: var(--font-num); font-size: var(--t-sm); letter-spacing: .2em; color: var(--muted); margin-bottom: var(--s-4); }
.error-page h1 { margin-bottom: var(--s-4); }
.error-page .lede { margin: 0 auto var(--s-6); }
.error-actions { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

/* ============================================================
   MOVIMIENTO REDUCIDO
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .will-reveal { opacity: 1; transform: none; }
}

/* ============================================================
   IMPRESIÓN DESDE EL NAVEGADOR (Ctrl+P): solo el tablero
   ============================================================ */
@media print {
  .site-header, .site-footer, .tabbar, .play-topbar, .play-toolbar, .pk-toolbar,
  .cw-keyboard, .cw-current, .su-pad, .theme-toggle, .pk-pad, .pk-keyboard,
  .cw-overlay, a.play-back { display: none !important; }
  body { background: #fff !important; }
  .play-shell, .board-host { max-width: 100% !important; }
  .cw-board, .su-board { border-color: #000 !important; }
  .cw-block { background: #000 !important; }
  .cw-cell, .su-cell { background: #fff !important; box-shadow: none !important; }
  .cw-clues { break-inside: avoid; }
}
.play-body .site-footer { display: none; }
@media (max-width: 560px) { .section-head .section-sub { display: none; } }
:root[data-theme="dark"] .hero-art .h-glow { opacity: .06; }
@media (min-width: 901px) { .hero-actions, .chess-banner-actions { flex-wrap: nowrap; } }

/* ============================================================
   APOYAR ENIGMA (/apoyar) — aportes voluntarios, sin interrupciones
   ============================================================ */
.footer-links a.footer-support { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.footer-links a.footer-support svg { width: 14px; height: 14px; color: var(--accent); }
.footer-links a.footer-support:hover { color: var(--ink); }
.side-support {
  display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; padding: 6px 8px;
  font-size: .84rem; color: var(--muted); text-decoration: none; border-radius: 8px;
}
.side-support svg { width: 15px; height: 15px; }
.side-support:hover { color: var(--ink); background: var(--surface-2); }
.side-support[aria-current="page"] { color: var(--accent-ink); }
@media (max-width: 1024px) and (min-width: 721px) { .sidebar:not(.is-open) .side-support { display: none; } }
@media (min-width: 1025px) { .play-body .side-support { display: none; } }

.support { max-width: 1080px; }
.support-head { max-width: 720px; }
.support-title { font-size: var(--t-2xl); line-height: 1.1; }
.support-head .kicker svg { width: 16px; height: 16px; }
.support-promises {
  list-style: none; margin: 0 0 clamp(24px, 3vw, 36px); padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.support-promises li {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px;
  background: var(--surface-2); border-radius: var(--r-md); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.45;
}
.support-promises strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.support-promises svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--success); }

.support-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(16px, 2.5vw, 28px); align-items: start; }
.support-card, .support-uses {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(18px, 2.4vw, 28px);
}
.support-uses { background: transparent; }
.support-card-title { font-size: var(--t-lg); margin: 0 0 var(--s-4); }

.support-form fieldset { border: 0; margin: 0 0 var(--s-5); padding: 0; min-width: 0; }
.support-form legend { padding: 0; margin-bottom: 10px; font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.amount-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.amount-opt { position: relative; display: block; cursor: pointer; }
.amount-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.amount-face {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 72px; padding: 10px 8px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); text-align: center; transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
}
.amount-num { font-family: var(--font-num); font-size: 1.12rem; font-weight: 500; color: var(--ink); letter-spacing: -.01em; }
.amount-num-text { font-family: var(--font-ui); font-size: .95rem; font-weight: 600; }
.amount-cur { font-size: var(--t-xs); color: var(--muted); letter-spacing: .06em; }
.amount-opt:hover .amount-face { border-color: var(--ink-2); }
.amount-opt input:checked + .amount-face { border-color: var(--accent); background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent); }
.amount-opt input:checked + .amount-face .amount-num { color: var(--accent-ink); }
.amount-opt input:focus-visible + .amount-face { outline: 2px solid var(--focus); outline-offset: 2px; }

.other-amount { margin-top: 14px; }
.other-amount > label { display: block; font-size: var(--t-sm); font-weight: 500; margin-bottom: 6px; }
.money-input {
  display: flex; align-items: center; gap: 8px; max-width: 280px; height: 46px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); color: var(--muted);
}
.money-input:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.money-input input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-family: var(--font-num); font-size: 1.05rem; color: var(--ink); }
.money-input input:focus { outline: none; }
.money-input:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.money-cur { font-size: var(--t-xs); letter-spacing: .06em; }
.field-hint { margin: 6px 0 0; font-size: var(--t-xs); color: var(--muted); }

.provider-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.provider { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 14px; }
.provider + .provider { border-top: 1px solid var(--line); }
.provider label { display: contents; }
.provider-name { font-weight: 600; font-size: .95rem; color: var(--ink); }
.provider-note { font-size: var(--t-sm); color: var(--muted); }
.provider.is-soon .provider-name { color: var(--ink-2); }
.provider-chip { margin-left: auto; }

.support-actions { display: grid; gap: 10px; }
.support-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.support-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.support-status {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); font-size: var(--t-sm); line-height: 1.5;
  background: var(--surface-2); color: var(--ink-2); border-left: 3px solid var(--ink-2);
}
.support-status strong { color: var(--ink); }
.support-status[data-kind="invalid"] { border-left-color: var(--danger); color: var(--ink); }
.support-status:focus { outline: none; }
.support-status:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.uses-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.uses-list li { display: flex; gap: 14px; align-items: flex-start; }
.uses-list svg { flex: none; width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
.uses-list h3 { font-size: 1rem; margin: 2px 0 2px; }
.uses-list p { margin: 0; font-size: var(--t-sm); color: var(--muted); line-height: 1.45; }
.uses-foot { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--muted); }
.uses-foot a { color: var(--ink-2); }

@media (max-width: 900px) {
  .support-grid { grid-template-columns: 1fr; }
  .support-promises { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 480px) {
  .amount-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .money-input { max-width: none; }
  .provider { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .provider-note { grid-column: 1 / -1; grid-row: 2; }
}

/* ============================================================
   ESPACIOS PUBLICITARIOS (templates/_ads.html) — solo existen en el
   HTML cuando AdSense está activo. Alto mínimo reservado para evitar
   saltos de layout; formato horizontal y acotado en móvil.
   ============================================================ */
.ad-slot {
  margin: clamp(28px, 3vw, 44px) auto 0; max-width: 970px; min-height: 118px;
  padding-top: 8px; border-top: 1px solid var(--line); text-align: center; contain: layout;
}
.ad-label { margin: 0 0 6px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ad-slot ins.adsbygoogle { min-height: 90px; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-slot-game { max-width: 728px; margin-top: 64px; }
@media (max-width: 720px) {
  .ad-slot { min-height: 128px; max-height: 300px; overflow: hidden; }
  .ad-slot ins.adsbygoogle { min-height: 100px; }
}
@media print { .ad-slot { display: none !important; } }

/* ============================================================
   PÁGINAS LEGALES (/privacidad)
   ============================================================ */
.legal { display: grid; grid-template-columns: minmax(0, 720px) 240px; gap: 12px clamp(28px, 4vw, 64px); align-items: start; }
.legal-head { grid-column: 1 / -1; max-width: 720px; margin-bottom: 8px; }
.legal-head .kicker svg { width: 16px; height: 16px; }
.legal-title { font-size: var(--t-2xl); line-height: 1.1; }
.legal-updated { margin: 12px 0 0; font-size: var(--t-sm); color: var(--muted); }
.legal-toc { grid-column: 2; grid-row: 2; position: sticky; top: calc(var(--header-h) + 12px); font-size: var(--t-sm); }
.legal-toc-title { font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.legal-toc ol { margin: 0; padding: 0 0 0 18px; display: grid; gap: 6px; color: var(--muted); }
.legal-toc a { color: var(--ink-2); text-decoration: none; }
.legal-toc a:hover { color: var(--ink); text-decoration: underline; }
.legal-body { grid-column: 1; grid-row: 2; max-width: 720px; line-height: 1.65; color: var(--ink-2); }
.legal-body section { padding-top: 8px; margin-bottom: 30px; scroll-margin-top: calc(var(--header-h) + 12px); }
.legal-body h2 { font-size: var(--t-lg); color: var(--ink); margin: 0 0 10px; }
.legal-body p, .legal-body ul { margin: 0 0 12px; }
.legal-body ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-body strong { color: var(--ink); }
.legal-body a { color: var(--accent-ink); }
.legal-body code { font-family: var(--font-num); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.legal-list { margin: 0 0 12px; display: grid; gap: 10px; }
.legal-list div { padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); }
.legal-list dt { font-weight: 600; color: var(--ink); }
.legal-list dd { margin: 2px 0 0; font-size: var(--t-sm); }
@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { grid-column: 1; grid-row: auto; position: static; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
  .legal-body { grid-row: auto; }
}
