/* Spawnea
   Fuentes alojadas en la propia web (licencia OFL): DM Sans y Anonymous Pro. */

@font-face { font-family: "DM Sans"; src: url("/fonts/dmsans.woff") format("woff"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Anonymous Pro"; src: url("/fonts/anonymouspro.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Anonymous Pro"; src: url("/fonts/anonymouspro-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0f131c;
  --surface: #161b27;
  --surface-2: #1d2433;
  --line: #2a3346;
  --line-soft: #222a3b;
  --text: #e8ebf2;
  --muted: #8f98ad;
  --amber: #f5b83d;
  --amber-ink: #1d1404;
  --green: #4cc38a;
  --red: #ef5a5a;
  --r-sm: 6px;
  --r: 12px;
  --max: 72rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: #ffd27a; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Cabecera ---------- */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(15,19,28,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand svg { width: 26px; height: 26px; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; font-size: .95rem; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 46px; padding: 0 1.25rem; border-radius: var(--r-sm); font-weight: 700; font-size: 1rem; text-decoration: none; border: 1px solid transparent; transition: background-color .15s, border-color .15s; }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: #ffc85c; color: var(--amber-ink); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }

/* ---------- Portada ---------- */
.hero { padding: 5rem 0 4.5rem; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; margin: 0 0 1.25rem; text-wrap: balance; }
.hero .lead { font-size: 1.2rem; color: #c4cad8; margin: 0 0 2rem; max-width: 34rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero .small { margin-top: 1.25rem; color: var(--muted); font-size: .95rem; }

/* Consola de ejemplo */
.console { background: #0a0d14; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); overflow: hidden; }
.console-bar { display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--line-soft); font-size: .85rem; color: var(--muted); }
.console-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.console-bar span { margin-left: .5rem; }
.console pre { margin: 0; padding: 1.1rem 1.25rem; font-family: "Anonymous Pro", Consolas, monospace; font-size: .95rem; line-height: 1.7; color: #b9c1d3; white-space: pre-wrap; }
.console .ok { color: var(--green); }
.console .join { color: var(--amber); }
.console .dim { color: #5d6780; }
.players { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.25rem; border-top: 1px solid var(--line-soft); background: var(--surface); font-size: .9rem; color: var(--muted); }
.players .avatars { display: flex; }
.players .avatars span { width: 28px; height: 28px; border-radius: 6px; margin-left: -6px; border: 2px solid var(--surface); display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #10131c; }
.players .avatars span:first-child { margin-left: 0; }
.online { display: inline-flex; align-items: center; gap: .45rem; color: var(--text); font-weight: 600; }
.online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(76,195,138,.18); }

/* ---------- Secciones ---------- */
.section { padding: 4.5rem 0; border-top: 1px solid var(--line-soft); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 800; margin: 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 32rem; }

/* Tarjetas de guías */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.game { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
a.game:hover { border-color: var(--amber); color: var(--text); transform: translateY(-2px); }
.game .cover { position: relative; aspect-ratio: 16 / 9; background-size: cover; background-position: center; image-rendering: pixelated; }
.game .cover h3 { position: absolute; left: 1rem; bottom: .8rem; margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.game .body { padding: 1rem 1rem 1.15rem; display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.game .body p { margin: 0; color: #c4cad8; font-size: .98rem; line-height: 1.5; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding: 0; list-style: none; }
.facts li { font-size: .82rem; color: var(--muted); background: var(--surface-2); padding: .2rem .55rem; border-radius: 4px; }
.facts li.ready { color: var(--green); background: rgba(76,195,138,.1); }
.game.soon { opacity: .6; }
.game.soon .facts li:first-child { color: var(--muted); background: var(--surface-2); }

/* Pasos */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: paso; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: paso; border-top: 2px solid var(--line); padding-top: 1.25rem; }
.steps li::before { content: counter(paso); display: block; font-weight: 800; font-size: 1rem; color: var(--amber); margin-bottom: .6rem; }
.steps h3 { margin: 0 0 .4rem; font-size: 1.2rem; letter-spacing: -.01em; }
.steps p { margin: 0; color: #c4cad8; }

/* Preguntas */
.faq { max-width: 48rem; }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2rem 1.1rem 0; font-weight: 700; font-size: 1.1rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: .9rem; font-size: 1.5rem; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 1.2rem; color: #c4cad8; max-width: 42rem; }

/* ---------- Pie ---------- */
.site-foot { border-top: 1px solid var(--line-soft); padding: 2.5rem 0 3rem; color: var(--muted); font-size: .95rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.site-foot p { margin: .3rem 0; max-width: 34rem; }
.site-foot nav { display: flex; gap: 1.5rem; }
.site-foot nav a { color: var(--muted); text-decoration: none; }
.site-foot nav a:hover { color: var(--text); }

/* ---------- Guías ---------- */
.guide-hero { position: relative; padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--line-soft); background-size: cover; background-position: center; image-rendering: pixelated; }
.guide-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,19,28,.96) 35%, rgba(15,19,28,.75)); }
.guide-hero .wrap { position: relative; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }
.guide-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 0 0 1rem; max-width: 46rem; text-wrap: balance; }
.guide-hero .facts { margin-top: 0; }

.guide { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3.5rem; padding: 3rem 0 4rem; }
.toc { position: sticky; top: 88px; align-self: start; font-size: .92rem; }
.toc p { margin: 0 0 .6rem; color: var(--muted); font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: .35rem 0 .35rem 1rem; color: var(--muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--amber); }

.article { max-width: 44rem; }
.article > p:first-child { font-size: 1.15rem; color: #d3d8e4; }
.article h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; margin: 3rem 0 1rem; scroll-margin-top: 88px; }
.article p, .article li { color: #c9cfdc; }
.article strong { color: var(--text); }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin: .45rem 0; }
.article li::marker { color: var(--muted); }

code, pre { font-family: "Anonymous Pro", Consolas, monospace; }
code { font-size: .95em; color: #ffd27a; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.code { position: relative; margin: 1rem 0 1.25rem; }
.code pre, .article pre { margin: 0; background: #0a0d14; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1rem 1.1rem; padding-right: 5.5rem; overflow-x: auto; font-size: 1rem; line-height: 1.55; color: #d7dcea; }
.code pre code, .article pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy { position: absolute; top: .55rem; right: .55rem; height: 30px; padding: 0 .7rem; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 .82rem "DM Sans", sans-serif; cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--muted); }
.copy.done { color: var(--green); border-color: var(--green); }

.note { margin: 1.5rem 0; padding: 1rem 1.15rem; border-radius: var(--r-sm); background: rgba(245,184,61,.07); border: 1px solid rgba(245,184,61,.25); }
.note p { margin: 0; }
.note strong:first-child { color: var(--amber); }
.note.warn { background: rgba(239,90,90,.07); border-color: rgba(239,90,90,.3); }
.note.warn strong:first-child { color: var(--red); }

.related { margin-top: 3rem; padding: 1.25rem; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface); }
.related p { margin: 0; color: #c9cfdc; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding: 3rem 0; }
  .games { grid-template-columns: repeat(2, 1fr); }
  .guide { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 1.1rem; }
  .site-nav { gap: 1rem; }
  .site-nav .hide-sm { display: none; }
  .games, .steps { grid-template-columns: 1fr; }
  .section { padding: 3.25rem 0; }
}

/* Capturas en las guías */
.shot { margin: 1.25rem 0 1.5rem; }
.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.shot figcaption { margin-top: .6rem; font-size: .92rem; color: var(--muted); line-height: 1.5; }
.shot-narrow { max-width: 22rem; }
