/* ===================== Worldvale — docs / guide pages ===================== */
:root {
  --ink: #0c0916;
  --ink-2: #14101f;
  --panel: rgba(24, 18, 40, 0.72);
  --panel-solid: #1b1530;
  --panel-line: #392e58;
  --gold: #e8c24b;
  --gold-dk: #b8912f;
  --text: #eee9ff;
  --text-dim: #b0a6cf;
  --text-dim2: #8b83a8;
  --green: #7ee787;
  --blue: #7fb0ef;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -12%, #241a47, transparent 62%),
    linear-gradient(180deg, #150f28, #0b0814 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
img, canvas { max-width: 100%; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px;
  background: rgba(12, 9, 22, 0.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-line);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 900; font-size: 1.15rem; letter-spacing: .04em; color: var(--text);
}
.brand .mark { width: 26px; height: 26px; image-rendering: pixelated; }
.brand b {
  background: linear-gradient(180deg, #ffe9a8, var(--gold) 60%, var(--gold-dk));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-dim); font-weight: 700; font-size: .92rem;
  padding: 8px 12px; border-radius: 9px;
}
.site-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.site-nav a.active { color: var(--gold); }
.play-btn {
  color: #2a1c06 !important;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 60%, var(--gold-dk));
  box-shadow: 0 6px 16px rgba(232,194,75,.25);
}
.play-btn:hover { filter: brightness(1.06); background: linear-gradient(180deg, #ffe08a, var(--gold) 60%, var(--gold-dk)) !important; }

/* layout */
.docs-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 30px; max-width: 1180px; margin: 0 auto; padding: 26px 22px 80px; }
.sidebar { position: sticky; top: 74px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 6px; }
.side-group { margin-bottom: 18px; }
.side-title { font-size: .68rem; font-weight: 800; letter-spacing: .12em; color: var(--text-dim2); text-transform: uppercase; margin: 0 0 6px 10px; }
.sidebar a { display: block; color: var(--text-dim); font-size: .9rem; padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.sidebar a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.sidebar a.current { color: var(--gold); border-left-color: var(--gold); background: rgba(232,194,75,.07); }

.doc-main { min-width: 0; }
.eyebrow { color: var(--gold-dk); font-weight: 800; letter-spacing: .16em; font-size: .74rem; text-transform: uppercase; }
h1.page-title {
  margin: 6px 0 10px; font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.04;
  background: linear-gradient(180deg, #fff4d6, var(--gold) 70%, var(--gold-dk));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--text-dim); font-size: 1.08rem; max-width: 60ch; margin: 0 0 22px; }

.doc-main section { padding: 26px 0; border-top: 1px solid rgba(120,100,170,.14); }
.doc-main section:first-of-type { border-top: 0; }
.doc-main h2 { font-size: 1.5rem; font-weight: 900; margin: 0 0 10px; letter-spacing: -.01em; }
.doc-main h3 { font-size: 1.05rem; font-weight: 800; margin: 20px 0 6px; color: #f0e9ff; }
.doc-main p { color: var(--text-dim); margin: 8px 0; }
.doc-main strong { color: var(--text); font-weight: 700; }
.doc-main ul { color: var(--text-dim); margin: 10px 0; padding-left: 20px; }
.doc-main li { margin: 5px 0; }
.doc-main li::marker { color: var(--gold-dk); }
kbd {
  font: 600 .82em ui-monospace, Menlo, monospace; color: #fff;
  background: #2a2340; border: 1px solid var(--panel-line); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; white-space: nowrap;
}

/* hero canvas */
.doc-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--panel-line); margin: 6px 0 24px;
  box-shadow: 0 18px 46px rgba(0,0,0,.45);
}
.doc-hero canvas { display: block; width: 100%; height: 240px; image-rendering: pixelated; }
.doc-hero .hero-cap {
  position: absolute; left: 16px; bottom: 12px; right: 16px;
  font-size: .86rem; color: #dfe6ff; text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

/* feature icon strip */
.feature-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 14px;
}
.feature-strip .feat { text-align: center; }
.feature-strip canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.feature-strip .flabel { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .06em; color: var(--text-dim2); text-transform: uppercase; margin-top: 4px; }

/* cards */
.card {
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 14px; padding: 16px 18px; margin: 12px 0;
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.card canvas.ic { width: 26px; height: 26px; image-rendering: pixelated; }

/* monster / entity gallery */
.bestiary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mob {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px;
  padding: 12px; text-align: center;
}
.mob canvas { width: 56px; height: 56px; image-rendering: pixelated; }
.mob .mname { font-weight: 800; font-size: .92rem; margin-top: 4px; }
.mob .mdesc { font-size: .78rem; color: var(--text-dim); }

/* tip callout */
.tip {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(126,231,135,.08); border: 1px solid rgba(126,231,135,.28);
  border-radius: 12px; padding: 12px 14px; margin: 14px 0; color: #d7f5db; font-size: .94rem;
}
.tip.warn { background: rgba(224,85,63,.09); border-color: rgba(224,85,63,.3); color: #f4cfc9; }
.tip b { color: #fff; }
.tip .ti { flex: 0 0 auto; font-weight: 900; }

.doc-footer { text-align: center; color: var(--text-dim2); font-size: .85rem; padding: 30px 20px 50px; border-top: 1px solid var(--panel-line); }
.doc-footer a { color: var(--text-dim); }

@media (max-width: 820px) {
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; padding: 12px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
