/* ════════════════════════════════════════════════════════════════
   BTB MC — Wiki · Grimoire
   Dark, readable knowledge base. Shares the Portal's "Dark Keep"
   palette so the two sites feel like one product.
   ════════════════════════════════════════════════════════════════ */

:root {
  --ink:      #0c0905;
  --ink-2:    #14100a;
  --panel:    #16110a;
  --panel-2:  #1f1810;
  --line:     #352819;
  --line-2:   #4a3823;

  --paper:    #ece0c6;
  --paper-dim:#bdab84;
  --paper-faint:#8a7a5a;

  --gold:     #e0a93e;
  --gold-2:   #f3cd72;
  --gold-deep:#b07d22;
  --crimson:  #d2502a;
  --crimson-2:#f06a40;
  --emerald:  #6fae4e;
  --sky:      #5aa6d0;
  --violet:   #9a6fd0;

  --display: "Cinzel", Georgia, serif;
  --body:    "Inter", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --side: 264px;
  --top: 60px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 20px); overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--paper);
  background: var(--ink);
  background-image: radial-gradient(900px 500px at 80% -120px, rgba(224,169,62,0.07), transparent 70%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── Top bar ─────────────────────────────────────────────────────── */
.wtop {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: rgba(12,9,5,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.wtop-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wtop-brand img { width: 28px; height: 28px; }
.wtop-brand b { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--paper); letter-spacing: 0.03em; }
.wtop-brand b em { color: var(--gold); font-style: normal; }
.wtop-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-deep); padding: 3px 8px; border-radius: 5px; }
.wtop-search { margin-left: 12px; flex: 1; min-width: 0; max-width: 420px; position: relative; }
.wtop-search input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--paper);
  font-family: var(--body);
  font-size: 13px;
  padding: 9px 14px 9px 36px;
  outline: none;
  transition: border-color 0.15s;
}
.wtop-search input:focus { border-color: var(--gold); }
.wtop-search input::placeholder { color: var(--paper-faint); }
.wtop-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--paper-faint); }
.wtop-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wtop-btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  padding: 9px 16px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: transform 0.15s, box-shadow 0.2s;
}
.wtop-btn.ghost { color: var(--paper-dim); border: 1px solid var(--line-2); background: transparent; }
.wtop-btn.ghost:hover { color: var(--gold-2); border-color: var(--gold); text-decoration: none; }
.wtop-btn.gold { color: #2a1c06; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: 1px solid var(--gold-deep); box-shadow: 0 2px 0 var(--gold-deep); }
.wtop-btn.gold:hover { transform: translateY(-1px); text-decoration: none; }
.wmenu-toggle { display: none; }

/* ── Shell ───────────────────────────────────────────────────────── */
.wshell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; padding-top: var(--top); }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.wside {
  border-right: 1px solid var(--line);
  background: var(--ink-2);
  padding: 26px 16px 60px;
  position: sticky;
  top: var(--top);
  align-self: start;
  height: calc(100vh - var(--top));
  overflow-y: auto;
}
.wcat { margin-bottom: 24px; }
.wcat-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700; padding: 0 12px; margin-bottom: 8px;
}
.wside a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  color: var(--paper-dim); font-size: 13.5px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.wside a:hover { background: rgba(224,169,62,0.07); color: var(--paper); text-decoration: none; }
.wside a.active { background: rgba(224,169,62,0.12); color: var(--gold-2); border-left-color: var(--gold); font-weight: 600; }
.wside a .wico { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.wside a .wnav-new {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #fff; background: var(--crimson);
  padding: 2px 7px; border-radius: 999px;
}
.wside a.hidden { display: none; }
.wcat.empty { display: none; }
.wside-empty { padding: 12px; color: var(--paper-faint); font-size: 13px; }

/* ── Content ─────────────────────────────────────────────────────── */
.wmain { padding: 40px clamp(24px, 5vw, 72px) 96px; min-width: 0; }
.warticle { max-width: 800px; margin: 0 auto; }
.wcrumb { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-faint); margin-bottom: 16px; }
.wcrumb b { color: var(--gold); }
.wtitle {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.05; letter-spacing: 0.01em; color: var(--paper); margin: 0 0 12px;
}
.wsub { font-size: clamp(15px, 1.8vw, 18px); color: var(--paper-dim); line-height: 1.6; margin: 0 0 30px; }
.whr { height: 1px; background: linear-gradient(90deg, var(--gold-deep), transparent); border: none; margin: 0 0 30px; }

.warticle h2 {
  font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--gold-2);
  letter-spacing: 0.02em; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.warticle h2 .wnew {
  display: inline-block; vertical-align: middle; position: relative; top: -2px; margin-left: 11px;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #fff; background: var(--crimson);
  padding: 3px 9px; border-radius: 999px;
}
.warticle h3 { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--paper); margin: 26px 0 10px; }
.warticle p { font-size: 15px; line-height: 1.75; color: var(--paper); margin: 0 0 16px; }
.warticle p.lead { font-size: 16.5px; color: var(--paper-dim); }
.warticle ul, .warticle ol { margin: 0 0 18px; padding-left: 4px; list-style: none; }
.warticle li { position: relative; padding-left: 24px; margin-bottom: 9px; font-size: 15px; line-height: 1.6; color: var(--paper); }
.warticle ul li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold); }
.warticle ol { counter-reset: w; }
.warticle ol li { counter-increment: w; }
.warticle ol li::before { content: counter(w); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--gold-deep); color: var(--gold-2); font-family: var(--mono); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.warticle strong { color: var(--gold-2); font-weight: 700; }
.warticle code { font-family: var(--mono); font-size: 0.88em; background: var(--ink); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; color: var(--gold-2); }

/* callout */
.wnote {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(180deg, rgba(224,169,62,0.08), transparent);
  border: 1px solid var(--line-2); border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 0 0 22px;
}
.wnote.crimson { border-left-color: var(--crimson); background: linear-gradient(180deg, rgba(210,80,42,0.1), transparent); }
.wnote.emerald { border-left-color: var(--emerald); background: linear-gradient(180deg, rgba(111,174,78,0.1), transparent); }
.wnote-ic { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.wnote.crimson .wnote-ic { color: var(--crimson-2); }
.wnote.emerald .wnote-ic { color: var(--emerald); }
.wnote-ic svg { width: 20px; height: 20px; }
.wnote p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--paper-dim); }
.wnote p strong { color: var(--paper); }

/* chips */
.wchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.wchip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-dim); border: 1px solid var(--line-2); background: var(--panel); padding: 7px 13px; border-radius: 999px; font-weight: 500; }

/* changelog (Updates page): tagged list, "Fixed"/"New" pills */
.wlog { list-style: none; margin: 0 0 10px; padding: 0; }
.wlog li { display: flex; gap: 11px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid rgba(53,40,25,0.5); color: var(--paper-dim); line-height: 1.55; }
.wlog li:last-child { border-bottom: none; }
.wlog-tag { flex: none; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; }
.wlog-tag.fixed { color: var(--emerald); background: rgba(111,174,78,0.14); border: 1px solid rgba(111,174,78,0.42); }
.wlog-tag.new { color: var(--sky); background: rgba(90,166,208,0.14); border: 1px solid rgba(90,166,208,0.42); }

/* tables */
.wtable-wrap { margin: 0 0 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wtable-wrap .wtable { margin: 0; }
.wtable { width: 100%; border-collapse: collapse; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wtable th { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); text-align: left; padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-weight: 700; }
.wtable td { padding: 12px 16px; font-size: 14px; color: var(--paper); border-bottom: 1px solid rgba(53,40,25,0.6); vertical-align: top; }
.wtable tr:last-child td { border-bottom: none; }
.wtable tr:hover td { background: rgba(224,169,62,0.04); }
.wtable td b { font-family: var(--display); color: var(--paper); }
.wtable .num { font-family: var(--mono); color: var(--gold-2); font-weight: 700; white-space: nowrap; }

/* definition cards grid */
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 24px; }
@media (max-width: 620px) { .wgrid { grid-template-columns: 1fr; } }
.wcard { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 18px 20px; }
.wcard h4 { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--paper); margin: 0 0 6px; }
.wcard p { font-size: 13.5px; color: var(--paper-dim); line-height: 1.55; margin: 0; }
.wcard .wtagk { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin-bottom: 8px; }
.wcard-list { margin: 10px 0 0 !important; padding-left: 2px !important; }
.wcard-list li { padding-left: 18px; margin-bottom: 6px; font-size: 13px; color: var(--paper-dim); line-height: 1.45; }
.wcard-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; transform: rotate(45deg); background: var(--gold); }

/* command chips */
.wcmd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.wcmd code { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--gold-2); background: var(--ink); border: 1px solid var(--line-2); padding: 10px 15px; border-radius: 7px; }
.wcmd span { font-family: var(--mono); font-size: 12.5px; color: var(--paper-faint); }

/* in-game access card */
.waccess {
  border: 1px solid var(--gold-deep);
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(224,169,62,0.1), transparent 60%),
    var(--panel);
  overflow: hidden;
  margin: 0 0 30px;
  box-shadow: 0 0 0 1px rgba(224,169,62,0.1), 0 10px 26px rgba(0,0,0,0.35);
}
.waccess-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  background: linear-gradient(180deg, var(--panel-2), #14100a);
  border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-2);
}
.waccess-head svg { width: 18px; height: 18px; color: var(--gold); }
.waccess-body { padding: 6px 20px 10px; }
.wacc-row { display: grid; grid-template-columns: 116px 1fr; gap: 16px; align-items: start; padding: 13px 0; border-bottom: 1px solid rgba(53,40,25,0.55); }
.wacc-row:last-child { border-bottom: none; }
.wacc-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; padding-top: 4px; }
.wacc-v { font-size: 14px; line-height: 1.6; color: var(--paper); }
.wacc-v code { font-family: var(--mono); font-size: 0.85em; background: var(--ink); border: 1px solid var(--line-2); border-radius: 5px; padding: 1.5px 5px; color: var(--gold-2); }
.wacc-cmds { display: flex; flex-wrap: wrap; gap: 7px; }
.wcmdchip {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  color: var(--gold-2); background: var(--ink);
  border: 1px solid var(--line-2); border-radius: 6px;
  padding: 6px 11px; white-space: nowrap;
}
@media (max-width: 560px) {
  .wacc-row { grid-template-columns: 1fr; gap: 6px; }
  .wacc-k { padding-top: 0; }
}

/* hero banner on article */
.wbanner { position: relative; border-radius: 12px; overflow: hidden; margin: 0 0 28px; min-height: 180px; display: flex; align-items: flex-end; border: 1px solid var(--line); }
.wbanner-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.55; }
.wbanner-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,9,5,0.3), rgba(12,9,5,0.9)); }
.wbanner-tx { position: relative; z-index: 2; padding: 22px 26px; }
.wbanner-tx .ey { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; }

/* related */
.wrelated { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }
.wrelated h3 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-faint); margin: 0 0 14px; }
.wrelated-links { display: flex; flex-wrap: wrap; gap: 10px; }
.wrelated-links a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--paper); border: 1px solid var(--line-2); background: var(--panel); padding: 9px 15px; border-radius: 8px; transition: all 0.15s; }
.wrelated-links a:hover { border-color: var(--gold); color: var(--gold-2); text-decoration: none; }
.wrelated-links a svg { width: 14px; height: 14px; color: var(--gold); }

/* home tiles */
.whome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 10px; }
@media (max-width: 760px) { .whome-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .whome-grid { grid-template-columns: 1fr; } }
.whome-tile { display: block; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); padding: 20px; transition: transform 0.18s, border-color 0.18s; }
.whome-tile:hover { transform: translateY(-3px); border-color: var(--gold); text-decoration: none; }
.whome-tile .wico { width: 26px; height: 26px; color: var(--gold-2); margin-bottom: 12px; }
.whome-tile h4 { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--paper); margin: 0 0 5px; }
.whome-tile p { font-size: 13px; color: var(--paper-dim); line-height: 1.5; margin: 0; }

/* vote site buttons */
.wvote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0 6px; }
@media (max-width: 680px) { .wvote-grid { grid-template-columns: 1fr; } }
.wvote-site {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel);
  padding: 15px 17px; transition: transform 0.16s, border-color 0.16s, background 0.16s;
}
.wvote-site:hover { transform: translateY(-2px); border-color: var(--gold); background: var(--panel-2); text-decoration: none; }
.wvote-site .wvote-nm { flex: 1; min-width: 0; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--paper); overflow-wrap: anywhere; }
.wvote-site .wvote-go { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: #2a1c06; background: linear-gradient(180deg, var(--gold-2), var(--gold)); padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
.wvote-site .wvote-go svg { width: 13px; height: 13px; }

/* store CTA (Premium page → store.html) */
.wstore-cta-wrap { margin: 16px 0 6px; }
.wstore-cta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: #2a1c06; background: linear-gradient(180deg, var(--gold-2), var(--gold)); padding: 12px 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: transform 0.15s, filter 0.15s; }
.wstore-cta:hover { filter: brightness(1.06); text-decoration: none; transform: translateY(-1px); }
.wstore-cta svg { width: 15px; height: 15px; }

/* ── Responsive ──────────────────────────────────────────────────── */
.wscrim { display: none; }
@media (max-width: 880px) {
  .wshell { grid-template-columns: 1fr; }
  .wmenu-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--paper); cursor: pointer; }
  .wtop-search { max-width: none; }
  .wside {
    position: fixed; top: var(--top); bottom: 0; left: 0; width: 280px; z-index: 55;
    transform: translateX(-100%); transition: transform 0.25s ease; height: auto;
  }
  body.wnav-open .wside { transform: translateX(0); }
  body.wnav-open .wscrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(0,0,0,0.55); z-index: 54; }
}
@media (max-width: 560px) {
  .wtop-tag, .wtop-btn.ghost { display: none; }
}
