*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:#0f0f13; --surface:#18181f; --border:#2a2a36;
  --text:#f0f0f5; --muted:#888899;
  --accent1:#7c6dfa; --accent2:#fa6d9a; --accent3:#6df5c8; --accent4:#facd6d;
  --radius:16px;
  --font-head:'Space Grotesk',sans-serif;
  --font-body:'Inter',sans-serif;
}
html { scroll-behavior: smooth; }
body { background:var(--bg); color:var(--text); font-family:var(--font-body); line-height:1.6; overflow-x:hidden; }
a { color:inherit; text-decoration:none; }
a:focus-visible { outline:2px solid var(--accent1); outline-offset:3px; border-radius:6px; }

.grid-bg {
  position:fixed; inset:0;
  background-image:linear-gradient(rgba(255,255,255,0.02) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,0.02) 1px,transparent 1px);
  background-size:60px 60px; pointer-events:none; z-index:0;
}
nav {
  position:fixed; top:0; left:0; right:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 5%;
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  background:rgba(15,15,19,0.7); border-bottom:1px solid var(--border);
}
.nav-logo { font-family:var(--font-head); font-weight:700; font-size:1.2rem; display:flex; align-items:center; gap:10px; }
.nav-logo .dot { width:10px; height:10px; border-radius:50%; background:linear-gradient(135deg,var(--accent1),var(--accent2)); box-shadow:0 0 10px var(--accent1); }
.nav-links { display:flex; gap:28px; font-size:0.9rem; color:var(--muted); }
.nav-links a:hover { color:var(--text); transition:color 0.2s; }

main { position:relative; z-index:1; max-width:1000px; margin:0 auto; padding:130px 5% 40px; }

.crumbs { font-size:0.85rem; color:var(--muted); margin-bottom:28px; }
.crumbs a:hover { color:var(--text); }

.hero { display:flex; gap:28px; align-items:center; margin-bottom:56px; flex-wrap:wrap; }
.hero-icon { width:104px; height:104px; border-radius:24px; overflow:hidden; border:1px solid var(--border); flex-shrink:0; }
.hero-icon img { width:100%; height:100%; object-fit:cover; }
.hero h1 { font-family:var(--font-head); font-size:clamp(2.2rem,6vw,3.6rem); font-weight:800; letter-spacing:-0.03em; line-height:1.05; margin-bottom:10px; }
.hero p { color:var(--muted); font-size:1.08rem; max-width:560px; }
.hero-cta { display:flex; gap:12px; flex-wrap:wrap; margin-top:20px; }
.btn { display:inline-flex; align-items:center; gap:8px; font-weight:600; font-size:0.92rem; padding:12px 22px; border-radius:100px; transition:opacity .2s, transform .2s; }
.btn-primary { background:linear-gradient(135deg,var(--accent1),var(--accent2)); color:#fff; box-shadow:0 4px 24px rgba(124,109,250,.35); }
.btn-ghost { border:1px solid var(--border); color:var(--muted); }
.btn:hover { transform:translateY(-2px); }
.btn-ghost:hover { color:var(--text); border-color:var(--accent1); }

h2 { font-family:var(--font-head); font-size:clamp(1.6rem,3.5vw,2.1rem); font-weight:800; letter-spacing:-0.02em; margin-bottom:12px; }
.lead { color:var(--muted); max-width:620px; margin-bottom:32px; }
section { margin-bottom:72px; }

.rules { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:16px; }
.rule { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
.rule h3 { font-family:var(--font-head); font-size:1rem; margin-bottom:8px; }
.rule p { color:var(--muted); font-size:0.92rem; line-height:1.65; }

.stages { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr)); gap:20px; }
.stage { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.board { padding:18px 12px 6px; background:rgba(255,255,255,0.015); }
.board svg { width:100%; height:auto; display:block; }
.br { stroke:var(--accent1); stroke-width:3; stroke-linecap:round; }
.isl { fill:#1e1e2e; stroke:var(--muted); stroke-width:2; }
.isl.done { stroke:var(--accent3); fill:rgba(109,245,200,0.08); }
.num { fill:var(--text); font:700 18px var(--font-head); text-anchor:middle; }
.lbl { fill:var(--muted); font:600 13px var(--font-body); text-anchor:middle; }
figcaption { padding:16px 20px 20px; display:flex; flex-direction:column; gap:4px; }
figcaption strong { font-family:var(--font-head); }
figcaption span { color:var(--muted); font-size:0.9rem; line-height:1.6; }
.legend { display:flex; gap:20px; flex-wrap:wrap; margin-top:16px; color:var(--muted); font-size:0.85rem; }
.legend i { display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:8px; vertical-align:-1px; border:2px solid var(--muted); }
.legend i.ok { border-color:var(--accent3); background:rgba(109,245,200,0.15); }

.tips { display:grid; gap:12px; list-style:none; }
.tips li { background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--accent4); border-radius:12px; padding:16px 20px; color:var(--muted); font-size:0.95rem; }
.tips li strong { color:var(--text); }

.final { text-align:center; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:44px 24px; }
.final p { color:var(--muted); margin:8px auto 22px; max-width:440px; }
.final .hero-cta { justify-content:center; }

footer { position:relative; z-index:1; text-align:center; padding:36px 5%; border-top:1px solid var(--border); color:var(--muted); font-size:0.82rem; }
footer strong { color:var(--text); }
footer a { color:var(--accent1); }

@media (max-width:600px) { .nav-links { display:none; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } .btn { transition:none; } }

/* Tablero binario (DuoLogic) */
.cell { fill:#18181f; stroke:var(--border); stroke-width:2; }
.cell.given { fill:#262636; stroke:var(--muted); }
.cell.new { fill:rgba(124,109,250,0.16); stroke:var(--accent1); stroke-width:3; }
.d { font:700 26px var(--font-head); text-anchor:middle; }
.d0 { fill:var(--accent3); }
.d1 { fill:var(--accent2); }
.axis { fill:var(--muted); font:500 12px var(--font-body); text-anchor:middle; }
.legend i.sq { border-radius:3px; border-color:var(--muted); background:#262636; }
.legend i.sq.new { border-color:var(--accent1); background:rgba(124,109,250,0.25); }

/* Nonograma (KernelLogic) */
.nc { fill:#18181f; stroke:var(--border); stroke-width:2; }
.nc.on { fill:var(--accent3); stroke:var(--accent3); }
.nc.new { stroke:var(--accent1); stroke-width:3; }
.x { stroke:var(--muted); stroke-width:2.5; stroke-linecap:round; }
.clue { fill:var(--text); font:700 18px var(--font-head); text-anchor:middle; }
.clue.r { text-anchor:end; }
.legend i.sq.on { background:var(--accent3); border-color:var(--accent3); }

/* Nonograma (KernelLogic) */
.nc { fill:#18181f; stroke:var(--border); stroke-width:2; }
.nc.on { fill:var(--accent3); stroke:var(--accent3); }
.nc.new { stroke:var(--accent1); stroke-width:3; }
.x { stroke:var(--muted); stroke-width:2.5; stroke-linecap:round; }
.clue { fill:var(--text); font:700 18px var(--font-head); text-anchor:middle; }
.clue.r { text-anchor:end; }
.legend i.sq.on { background:var(--accent3); border-color:var(--accent3); }
