/* Ludiario · base compartida por todas las páginas.
   Tema oscuro único. Cada juego define su acento con --accent / --accent-ink / --glow
   en su propia hoja (se carga después de esta). */
:root {
  --bg: #0B0E17;
  --surface: #141827;
  --surface-2: #1B2032;
  --tile: #1B2032;
  --tile-hover: #242B40;
  --line: #262D41;
  --line-2: #333B55;
  --ink: #F2F3F8;
  --ink-2: #B9BFD0;
  --muted: #7C839A;
  --brand: #F2F3F8;
  --brand-ink: #0B0E17;
  --g1: #F6D35B; --g1-ink: #3A2E00;
  --g2: #9BD489; --g2-ink: #0F2E0A;
  --g3: #8FBBF0; --g3-ink: #0A2548;
  --g4: #C9A8F2; --g4-ink: #2A0F4E;
  --g5: #F2A4B8; --g5-ink: #4A0F1E;
  --g6: #F5B36E; --g6-ink: #4A2400;
  --danger: #FF7B72;
  --accent: var(--g1); --accent-ink: var(--g1-ink);
  --glow: rgba(246, 211, 91, .14);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 16px 40px -20px rgba(0,0,0,.9);
  --radius: 14px;
  --f: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-num: "Segoe UI", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; padding: 0 16px 80px; min-height: 100vh;
  position: relative;
}
/* resplandor de fondo con el color del juego */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 380px at 85% 8%, var(--glow), transparent 70%),
    radial-gradient(420px 320px at 5% 55%, rgba(143,187,240,.08), transparent 70%);
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 560px; margin: 0 auto; }
.prose { max-width: 62ch; }

/* ---------- cabecera ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 0 22px; padding: 10px 12px 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 11px; background: #F7F7FA;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 7px; flex: none;
}
.brand .mark i { display: block; border-radius: 3px; }
.brand .mark i:nth-child(1) { background: #F3D24B; }
.brand .mark i:nth-child(2) { background: #8FCB74; }
.brand .mark i:nth-child(3) { background: #86B7EA; }
.brand .mark i:nth-child(4) { background: #BC93E4; }
.brand b { font-weight: 800; letter-spacing: -.02em; font-size: 1.15rem; line-height: 1.1; display: block; }
.brand small { display: block; color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: .01em; margin-top: 1px; }
.icons { display: flex; gap: 2px; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--ink-2);
}
.iconbtn:hover { background: var(--tile-hover); color: var(--ink); }
.iconbtn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- título de partida ---------- */
.gamehead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.gamehead h1 { font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 900; letter-spacing: -.045em; line-height: 1; margin: 0; }
.gamehead .n { color: var(--muted); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hint { color: var(--ink-2); font-size: 1rem; margin: 0 0 16px; }

/* chispas decorativas */
.spark { position: relative; }
.spark::before, .spark::after {
  content: ""; position: absolute; width: 3px; height: 16px; border-radius: 2px; background: var(--accent);
  opacity: .9; pointer-events: none;
}
.spark::before { transform: rotate(-30deg); }
.spark::after { transform: rotate(35deg); }

/* ---------- botones ---------- */
.actions { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  border-radius: 999px; padding: 13px 22px; font-weight: 800; font-size: 1rem;
  border: 1.5px solid var(--line-2); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s ease, color .15s ease, opacity .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover:not(:disabled) { background: var(--tile-hover); border-color: var(--ink-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding-left: 26px; padding-right: 26px; }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.06); border-color: var(--accent); }
.btn.icon { width: 48px; height: 48px; padding: 0; }
.btn.icon svg { width: 20px; height: 20px; }
.btn:disabled { opacity: .35; cursor: default; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-10px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 700; font-size: .95rem; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 50;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- modales ---------- */
.modal { position: fixed; inset: 0; background: rgba(4,6,12,.7); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 40; backdrop-filter: blur(3px); }
.modal.open { display: flex; }
.card {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; max-width: 460px; width: 100%;
  padding: 24px 22px 22px; box-shadow: var(--shadow); position: relative; max-height: calc(100vh - 32px); overflow: auto;
  animation: pop .25s ease;
}
@keyframes pop { 0% { transform: scale(.94); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.card h2 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.card .stack { display: flex; flex-direction: column; gap: 12px; }
.card .close { position: absolute; top: 10px; right: 10px; }
.card ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: .95rem; display: flex; flex-direction: column; gap: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 6px 0 4px; }
.stats > div { background: var(--surface-2); border-radius: 12px; padding: 10px 4px; }
.stats b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.result { text-align: center; }
.result .emoji { font-size: 1.3rem; line-height: 1.3; letter-spacing: .04em; margin: 6px 0 2px; white-space: pre; font-family: var(--f-num); }
.result .next { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.result .next b { color: var(--ink); font-variant-numeric: tabular-nums; }
.share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- contenido de apoyo ---------- */
.content { margin-top: 56px; display: flex; flex-direction: column; gap: 32px; }
.content h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.content h3 { font-size: 1rem; font-weight: 700; margin: 14px 0 4px; }
.content p, .content li { color: var(--ink-2); font-size: .95rem; }
.content ul, .content ol { margin: 0; padding-left: 1.2em; }
.archive { display: flex; flex-wrap: wrap; gap: 8px; }
.archive a {
  text-decoration: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 7px 12px; font-size: .88rem; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.archive a:hover { border-color: var(--ink-2); color: var(--ink); }
.archive a.done { border-color: var(--accent); color: var(--ink); }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: .95rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 6px; }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a { color: var(--muted); }
.ad-slot { min-height: 0; }

/* ---------- bloque "Sigue jugando" (seguir.js) ---------- */
.seguir { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; text-align: left; }
.seguir-t { margin: 0 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.seguir-lista { display: grid; gap: 8px; }
.seguir-j { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.seguir-j:hover { border-color: var(--ink-2); }
.seguir-n { grid-column: 1; grid-row: 1; font-weight: 800; font-size: .98rem; color: var(--ink); letter-spacing: -.01em; }
.seguir-p { grid-column: 1; grid-row: 2; font-size: .8rem; color: var(--ink-2); }
.seguir-e { grid-column: 2; grid-row: 1 / span 2; justify-self: end; align-self: center; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 6px 11px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.seguir-j.ya { opacity: .62; }
.seguir-j.ya .seguir-e { background: transparent; color: var(--muted); border: 1px solid var(--line-2); }
.seguir-mas { display: block; text-align: center; margin-top: 10px; font-size: .88rem; font-weight: 700; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.seguir-mas:hover { color: var(--ink); }

/* ---------- páginas de texto (contacto, privacidad, 404) ---------- */
.page { padding: 24px 0 0; display: flex; flex-direction: column; gap: 22px; }
.page h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.05; margin: 0; }
.page h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 0; }
.page p, .page li { color: var(--ink-2); font-size: .97rem; }
.page ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.box, .why div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.box p, .why p { margin: 0; }
.why { display: grid; gap: 12px; }
.why b { display: block; margin-bottom: 2px; }
.mail, .go { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 800; padding: 12px 22px; border-radius: 999px; font-size: 1.02rem; }
.updated { color: var(--muted); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
