:root {
  --bg: #10131c; --panel: #171b27; --panel2: #1e2333; --line: #2c3349; --text: #e6e1d6; --soft: #b9b2a3; --muted: #8a8578;
  --gold: #e8c26a; --gold2: #f3d58f; --link: #f0cd7c; --good: #8fd06a; --bad: #e8806a; --side: 250px; --toc: 220px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: rgba(16,19,28,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); font: 700 20px "Cinzel", serif; letter-spacing: .5px; white-space: nowrap; }
.brand img { height: 38px; }
.brand em { font-style: normal; color: var(--soft); font-weight: 600; font-size: 18px; }
.brand:hover { text-decoration: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 16px; }
.search input:focus { outline: none; border-color: var(--gold); }
#results { position: absolute; top: 46px; left: 0; right: 0; max-height: 70vh; overflow-y: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
#results a { display: block; padding: 8px 14px; color: var(--text); border-bottom: 1px solid var(--line); }
#results a small { display: block; color: var(--muted); font-size: 13px; }
#results a:hover, #results a.sel { background: #2a3045; text-decoration: none; }
#results .none { padding: 12px 14px; color: var(--muted); }
.play { margin-left: auto; padding: 8px 16px; border-radius: 8px; background: var(--gold); color: #1a1408; font-weight: 700; white-space: nowrap; }
.play:hover { background: var(--gold2); text-decoration: none; }
.menu { display: none; background: none; border: 0; color: var(--text); font-size: 24px; cursor: pointer; }
.layout { display: flex; align-items: flex-start; }
nav.side { position: sticky; top: 60px; width: var(--side); flex-shrink: 0; height: calc(100vh - 60px); overflow-y: auto; padding: 18px 0 40px; border-right: 1px solid var(--line); background: var(--panel); }
.nav-group { margin-bottom: 14px; }
.nav-group h4 { margin: 0 0 4px; padding: 0 22px; color: var(--muted); font: 600 12px "Cinzel", serif; letter-spacing: 1.5px; text-transform: uppercase; }
nav.side a { display: block; padding: 4px 22px; color: var(--soft); font-size: 16px; }
nav.side a:hover { color: var(--gold2); background: var(--panel2); text-decoration: none; }
nav.side a.active { color: var(--gold); background: var(--panel2); box-shadow: inset 3px 0 var(--gold); }
nav.side details summary { padding: 4px 22px; color: var(--muted); font-size: 14px; cursor: pointer; }
nav.side a.sub { padding-left: 34px; font-size: 14px; }
main { flex: 1; min-width: 0; padding: 10px 44px 40px; overflow-wrap: break-word; }
article { max-width: 860px; }
body.home article, body.mappage article { max-width: 1200px; }
aside.toc { position: sticky; top: 76px; width: var(--toc); flex-shrink: 0; padding: 26px 18px 20px 0; font-size: 14px; max-height: calc(100vh - 80px); overflow-y: auto; }
aside.toc h4 { margin: 0 0 8px; color: var(--muted); font: 600 12px "Cinzel", serif; letter-spacing: 1.5px; text-transform: uppercase; }
aside.toc a { display: block; padding: 3px 0 3px 10px; color: var(--soft); border-left: 2px solid var(--line); }
aside.toc a.on { color: var(--gold); border-left-color: var(--gold); }
.crumbs { margin-top: 18px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
h1, h2, h3 { font-family: "Cinzel", serif; color: var(--gold); line-height: 1.25; }
h1 { font-size: 36px; margin: 6px 0 18px; }
h2 { font-size: 25px; margin: 42px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3 { font-size: 19px; margin: 28px 0 8px; color: var(--gold2); }
p, ul, ol { margin: 0 0 14px; }
li { margin: 3px 0; }
strong, b { color: #fff6e0; }
.muted { color: var(--muted); font-weight: normal; font-size: .92em; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
blockquote { margin: 0 0 14px; padding: 8px 16px; border-left: 3px solid var(--gold); background: var(--panel); color: var(--soft); border-radius: 0 6px 6px 0; }
table { border-collapse: collapse; margin: 12px 0 22px; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--gold); background: var(--panel); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover td { background: var(--panel); }
tr:target td { background: #3a3220 !important; }
li.good { color: var(--good); } li.bad { color: var(--bad); }
img.icon { width: 36px; height: 36px; vertical-align: middle; margin-right: 6px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid #000; vertical-align: middle; }
.xp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 16px; font-size: 15px; }
.xp-grid b { display: inline-block; width: 30px; color: var(--gold); }
footer { max-width: 860px; margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
/* home */
.hero { margin: 22px 0 26px; padding: 56px 40px 48px; border-radius: 16px; text-align: center; border: 1px solid var(--line);
  background: linear-gradient(rgba(10,12,20,.25), rgba(10,12,20,.85)), url(hero.jpg) center/cover; }
.hero-logo { width: min(440px, 80%); filter: drop-shadow(0 6px 20px rgba(0,0,0,.6)); }
.hero p { max-width: 620px; margin: 10px auto 22px; font-size: 20px; color: #f2ecdd; text-shadow: 0 2px 8px #000; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.button { padding: 10px 20px; border-radius: 9px; border: 1px solid var(--gold); color: var(--gold2); font-weight: 700; background: rgba(16,19,28,.6); }
.button.primary { background: var(--gold); color: #1a1408; }
.button:hover { text-decoration: none; filter: brightness(1.1); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 30px; }
.card { display: block; padding: 16px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--soft); }
.card b { display: block; margin-bottom: 4px; color: var(--gold); font: 700 18px "Cinzel", serif; }
.card:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-1px); }
/* quest guides */
.infobox { float: right; width: 310px; margin: 0 0 18px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.infobox table { display: table; margin: 0; font-size: 15px; }
.infobox th { position: static; background: none; color: var(--muted); font-weight: 500; width: 40%; white-space: normal; }
.infobox th.title { text-align: center; color: var(--gold); font: 700 18px "Cinzel", serif; background: var(--panel2); padding: 12px; }
.infobox td { color: var(--text); }
.mapcrop { display: block; position: relative; border-top: 1px solid var(--line); }
.mapcrop img { display: block; width: 100%; }
.mapcrop span { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.65); color: var(--gold2); font-size: 13px; }
.lead { font-size: 19px; color: #f2ecdd; }
ol.steps { list-style: none; padding: 0; counter-reset: none; clear: none; }
li.step { margin: 0 0 14px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
li.step h3 { margin: 0 0 8px; }
li.step ul { margin: 6px 0 0; padding-left: 20px; }
blockquote.journal { font-style: italic; margin: 0 0 6px; background: var(--panel2); }
.chat { display: block; margin-top: 2px; font-size: 15px; color: var(--soft); }
.chat q { color: #fff2c8; quotes: "“" "”"; }
p.where { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
ul.checklist, ul.rewards { padding-left: 20px; }
table.quests td:first-child { font-weight: 700; }
/* world map */
.worldmap { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #2c5e96; height: min(72vh, 760px); touch-action: none; }
#worldmap { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
#worldmap.drag { cursor: grabbing; }
#worldmap .label text { fill: #fff; font: 700 13px "Alegreya Sans", sans-serif; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.75); stroke-width: 3px; pointer-events: none; }
#worldmap .label.town text { font: 700 17px "Cinzel", serif; fill: #fff4d6; }
#worldmap .label.region text { font: italic 600 14px "Alegreya Sans", sans-serif; fill: #f4efdc; letter-spacing: 3px; text-transform: uppercase; opacity: .7; }
#worldmap[data-zoom="far"] .label.place, #worldmap[data-zoom="close"] .label.region { display: none; }
#worldmap .m circle, #worldmap .m rect, #worldmap .m path { stroke: #111; stroke-width: 1.5; }
#worldmap .glyph { fill: #1a1408; font: 700 11px sans-serif; text-anchor: middle; pointer-events: none; }
.qs { fill: #f0c040; } .ls { fill: #9fd0ff; } .bk { fill: #ffe066; } .sh { fill: #f0a040; } .fu { fill: #ff7a30; }
.fi { fill: #e8f6ff; } .co { fill: #b78cff; } .gl { fill: #7af0c8; } .en { fill: #e84a3a; }
#worldmap .m.hide { display: none; }
.map-tip { position: absolute; pointer-events: none; padding: 4px 10px; border-radius: 6px; background: rgba(10,12,20,.9); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.map-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: rgba(16,19,28,.85); color: var(--text); font-size: 20px; cursor: pointer; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 20px; font-size: 15px; }
.map-legend label { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #111; }
.map-preview { display: block; position: relative; margin: 10px 0 20px; }
.map-preview img { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.map-preview span { position: absolute; left: 16px; bottom: 14px; padding: 6px 14px; border-radius: 8px; background: rgba(10,12,20,.85); color: var(--gold2); font-weight: 700; }
@media (max-width: 1200px) { aside.toc { display: none; } }
@media (max-width: 860px) {
  .menu { display: block; }
  nav.side { position: fixed; left: 0; top: 60px; z-index: 15; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 30px rgba(0,0,0,.5); }
  body.nav-open nav.side { transform: none; }
  main { padding: 6px 16px 30px; }
  .brand span, .play { display: none; }
  header.top { gap: 10px; padding: 0 12px; }
  .search input { min-width: 0; }
  .infobox { float: none; width: 100%; margin: 0 0 18px; }
  h1 { font-size: 28px; }
  .hero { padding: 36px 18px 30px; }
}