:root {
  --bg: #07060d;
  --bg-2: #0d0b18;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f3ff;
  --muted: #a5a3c2;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --pink: #f472b6;
  --gold: #facc15;
  --red: #fb7185;
  --radius: 20px;
  --grad: linear-gradient(120deg, var(--purple), var(--pink) 50%, var(--cyan));
  --font: 'Space Grotesk', system-ui, sans-serif;
  --pixel: 'Press Start 2P', monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-x: hidden;
}
body::before {
  /* neon blobs + voxel grid */
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 10% -5%, rgba(139, 92, 246, 0.28), transparent 70%),
    radial-gradient(500px 400px at 100% 10%, rgba(34, 211, 238, 0.16), transparent 70%),
    radial-gradient(600px 500px at 50% 110%, rgba(244, 114, 182, 0.14), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 40px 40px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, pre { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { padding: 64px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pixel { font-family: var(--pixel); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 6, 13, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.35rem; }
.logo:hover { text-decoration: none; }
.logo img { width: 34px; height: 34px; }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 12px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.btn-primary { color: #fff; background: var(--grad); }
.nav-me { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 12px; width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 12px 16px 20px;
    background: rgba(7, 6, 13, 0.97); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 1rem var(--font);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, background 0.2s; text-decoration: none !important;
  min-height: 46px;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 30px -8px rgba(139, 92, 246, 0.8); }
.btn-primary:hover { background: var(--grad); box-shadow: 0 10px 40px -6px rgba(244, 114, 182, 0.8); }
.btn-lime { background: var(--lime); color: #1a2e05; border: 0; }
.btn-lime:hover { background: #bef264; }
.btn-danger { background: rgba(251, 113, 133, 0.15); border-color: rgba(251, 113, 133, 0.4); color: #fecdd3; }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: 0.875rem; border-radius: 10px; }
.btn-big { padding: 16px 30px; font-size: 1.1rem; border-radius: 18px; }
.btn-google { background: #fff; color: #1f1f1f; border: 0; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35); color: var(--text); font: 1rem var(--font);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3); }
textarea { min-height: 110px; resize: vertical; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; min-height: 220px; }
input[type=color] { width: 56px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: none; padding: 4px; cursor: pointer; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; backdrop-filter: blur(8px);
}
.card-glow { position: relative; }
.card-glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.7; pointer-events: none;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.chip-pending { background: rgba(250, 204, 21, 0.12); border-color: rgba(250, 204, 21, 0.4); color: #fde68a; }
.chip-approved { background: rgba(163, 230, 53, 0.12); border-color: rgba(163, 230, 53, 0.4); color: #d9f99d; }
.chip-revoked { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.4); color: #fecdd3; }

.coin { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.25em; }
.coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gold); }

.avatar {
  border-radius: 30%; object-fit: cover; background: var(--grad); flex-shrink: 0;
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; overflow: hidden;
}

.insignia { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.rank-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9rem; }

.progress { height: 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); border-radius: inherit; box-shadow: 0 0 20px rgba(34, 211, 238, 0.6); transition: width 0.8s; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-art { filter: drop-shadow(0 30px 60px rgba(139, 92, 246, 0.35)); }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 18px; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; margin: 0 auto; }
}

.feature img { width: 96px; height: 96px; margin-bottom: 12px; }
.feature:hover { transform: translateY(-4px); }
.feature { transition: transform 0.2s; }

.steps { counter-reset: step; }
.step { position: relative; padding-left: 76px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 22px; width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; font: 700 1.2rem var(--font); background: var(--grad); color: #fff;
}

.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: scroll 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; flex-wrap: wrap; width: auto; } }

/* ---------- games ---------- */
.game-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--text); transition: transform 0.2s; }
.game-card:hover { transform: translateY(-4px); text-decoration: none; }
.game-thumb { aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 3.4rem; position: relative; }
.game-thumb .chip { position: absolute; top: 10px; left: 10px; z-index: 1; }
.game-thumb img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.game-body h3 { margin: 0; }
.game-meta { margin-top: auto; display: flex; gap: 14px; color: var(--muted); font-size: 0.875rem; align-items: center; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--border); }
.player iframe { display: block; width: 100%; height: min(78vh, 760px); border: 0; background: #000; }
.player:fullscreen iframe { height: 100vh; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { padding: 8px 16px; border-radius: 12px; border: 1px solid var(--border); background: none; color: var(--muted); font: 600 0.95rem var(--font); cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--text); border-color: var(--purple); }

/* ---------- lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

.leader { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text); }
.leader:hover { text-decoration: none; }
.leader .pos { width: 28px; font-weight: 700; color: var(--muted); text-align: center; }
.leader:nth-child(1) .pos { color: var(--gold); }
.leader:nth-child(2) .pos { color: #e2e8f0; }
.leader:nth-child(3) .pos { color: #fb923c; }

.ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ladder-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 0.88rem; }
.ladder-item.current { border-color: var(--lime); box-shadow: 0 0 24px -6px var(--lime); }
.ladder-item.locked { opacity: 0.45; }

/* ---------- misc ---------- */
.callout { border-radius: 16px; padding: 16px 18px; background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.3); }
.callout.warn { background: rgba(250, 204, 21, 0.08); border-color: rgba(250, 204, 21, 0.35); }
.callout.danger { background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.35); }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox input, .copybox textarea { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
@media (max-width: 560px) { .copybox { flex-direction: column; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px);
  padding: 14px 22px; border-radius: 16px; background: #1b1830; border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); z-index: 100; transition: transform 0.3s; max-width: calc(100% - 32px); font-weight: 600;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 3rem; }

.doc h1 { font-size: 2rem; }
.doc h2 { font-size: 1.5rem; margin-top: 1.6em; }
.doc h3 { font-size: 1.1rem; margin-top: 1.4em; }
.doc pre { background: rgba(0, 0, 0, 0.45); border: 1px solid var(--border); border-radius: 14px; padding: 16px; overflow-x: auto; font-size: 0.85rem; }
.doc code { background: rgba(255, 255, 255, 0.08); padding: 2px 6px; border-radius: 6px; font-size: 0.88em; }
.doc pre code { background: none; padding: 0; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.doc ul, .doc ol { padding-left: 1.4em; }

.footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: 0.9rem; margin-top: 40px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

.profile-banner {
  border-radius: var(--radius); padding: 28px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #8b5cf6) 45%, transparent), rgba(255, 255, 255, 0.03));
  border: 1px solid color-mix(in srgb, var(--accent, #8b5cf6) 60%, transparent);
}
.profile-banner .avatar { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15), 0 0 40px var(--accent, #8b5cf6); }
.big-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat { padding: 16px 18px; }
.stat .muted { font-size: 0.85rem; }

.idea-chip { cursor: pointer; }
.idea-chip:hover { border-color: var(--pink); }
