@import url(fonts/fonts.css);

:root {
  --ground: #111316; --rail: #0C0E11; --panel: #191C21; --panel-2: #20242A; --sunk: #15181C; --deep: #0B0D10;
  --line: #2B3038; --line-2: #3A4049; --line-soft: #22262C;
  --text: #ECE6D8; --text-2: #D3CCBC; --text-3: #C9C2B3; --dim: #A9A293; --faint: #8F897C;
  --brass: #D9A54A; --brass-hi: #ECC277; --brass-bg: #2A2418; --brass-line: #8A6A2F;
  --teal: #8FD3C9; --teal-bg: #17322F; --teal-line: #2C5A54;
  --blue: #9CC8EA; --blue-bg: #16283A; --blue-line: #2F5577;
  --green: #A8D49A; --green-bg: #1C2A1C; --green-line: #3B5E36;
  --violet: #D3B6EA; --violet-bg: #261C2E; --violet-line: #5A4270;
  --red: #F0A48F; --red-bg: #2A1A17; --red-line: #7A3B2E;
  --parch: #EFE4CB; --parch-ink: #2B2117; --parch-red: #7A2A1E; --parch-mid: #4A3D2E; --parch-rule: #B9886F;
  --serif: 'IM Fell English', Georgia, serif;
  --sans: 'Alegreya Sans', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: var(--brass-hi); }
a:hover { color: #F5D79C; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.serif { font-family: var(--serif); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); font-size: 13px; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.hidden { display: none !important; }

/* shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.rail { flex: 1 1 220px; max-width: 100%; padding: 20px 14px; background: var(--rail); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: baseline; gap: 10px; padding: 0 10px; text-decoration: none; color: var(--text); }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1; }
.brand span { font-size: 20px; line-height: 1; color: var(--brass); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { flex: 1 1 170px; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px;
  text-decoration: none; color: var(--text-3); }
.nav a:hover { background: #1B1E23; color: var(--text); }
.nav a.on { background: var(--panel-2); color: var(--text); }
.nav a.on svg { stroke: var(--brass); }
.nav .count { margin-left: auto; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--brass-bg); color: var(--brass-hi); font-size: 13px; text-align: center; }
.railfoot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 10px; font-size: 14px; }
.railfoot div { display: flex; justify-content: space-between; gap: 8px; }
.railfoot span:first-child { color: var(--dim); }
.main { flex: 999 1 560px; min-width: 0; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.pagehead h1 { font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.card.dashed { border-style: dashed; border-color: #4A505A; }
.card h2 { font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.cardhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.sunk { background: var(--ground); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); text-decoration: none; }
a.chip:hover { border-color: var(--brass-line); color: var(--text); }
.chip.brass { background: var(--brass-bg); border-color: var(--brass-line); color: var(--brass-hi); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 500; text-decoration: none; }
.btn:hover { border-color: var(--brass-line); }
.btn.primary { background: var(--brass); border-color: var(--brass); color: #111316; font-weight: 700; }
.btn.primary:hover { background: var(--brass-hi); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.seg button { min-height: 40px; min-width: 64px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); font-weight: 500; }
.seg button.on { background: var(--brass); color: #111316; }

/* trust badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid; }
.b-rule { background: var(--brass); color: #111316; border-color: var(--brass); }
.b-third { background: transparent; color: var(--brass-hi); border-color: var(--brass-line); }
.b-expert { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.b-craft { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.b-idea { background: transparent; color: var(--dim); border: 1px dashed #6A6F78; }
.b-yours { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.b-summary { background: var(--panel-2); color: var(--text); border-color: #6A6F78; }
.b-private { background: transparent; color: var(--dim); border-color: var(--line-2); font-weight: 500; }

/* search */
.searchbar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
.searchbar input { flex: 1 1 auto; min-width: 0; height: 50px; border: 0; background: transparent; font-size: 18px; outline: none; }
.facets { flex: 1 1 190px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.facets button { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3); text-align: left; }
.facets button.on { background: var(--panel-2); color: var(--text); }
.results { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.result { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.result:hover { border-color: var(--brass-line); color: var(--text); }
.result .t { font-size: 17px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result .s { font-size: 13px; color: var(--dim); }
.result .snip { font-size: 14px; color: var(--text-2); }
mark { background: transparent; color: var(--brass-hi); font-weight: 700; }
.archives { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* prose (markdown) */
.prose { font-size: 16px; line-height: 1.55; color: var(--text-2); }
.prose p { margin: 0 0 .8em; }
.prose p:last-child { margin-bottom: 0; }
.prose h3, .prose h4 { font-family: var(--serif); font-size: 21px; color: var(--text); margin: 1em 0 .4em; }
.prose ul, .prose ol { margin: 0 0 .8em; padding-left: 22px; }
.prose li { margin: .25em 0; }
.prose table { border-collapse: collapse; margin: .4em 0 1em; font-size: 15px; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 6px 12px 6px 0; text-align: left; vertical-align: top; }
.prose th { color: var(--dim); font-weight: 500; }
.prose blockquote { margin: 0 0 1em; padding: 10px 14px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line-soft); }
.prose strong { color: var(--text); }
.term { color: inherit; text-decoration: underline dotted rgba(217,165,74,.7); text-underline-offset: 3px; }
.term:hover { color: var(--brass-hi); }

/* parchment stat blocks */
.parch { background: var(--parch); color: var(--parch-ink); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; }
.parch h2 { font-family: var(--serif); font-size: 30px; color: var(--parch-red); line-height: 1.05; }
.parch .sub { font-style: italic; color: var(--parch-mid); }
.parch .rule { height: 2px; background: var(--parch-red); border-radius: 2px; }
.parch .rule.thin { background: var(--parch-rule); }
.parch b.k { color: var(--parch-red); }
.parch .abil { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; text-align: center; }
.parch .abil b { display: block; color: var(--parch-red); font-size: 12px; }
.parch h3 { font-family: var(--serif); font-size: 22px; color: var(--parch-red); border-bottom: 1px solid var(--parch-red); margin-top: 6px; }
.parch p { margin: 0; }
.parch a { color: var(--parch-red); }
.parch .term { text-decoration-color: rgba(122,42,30,.5); }
.parch .prose { color: var(--parch-ink); }
.parch .prose strong { color: var(--parch-ink); }
.parch .prose th { color: var(--parch-mid); }
.parch .prose th, .parch .prose td { border-color: #CDB894; }
.roll { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; margin: 4px 6px 0 0; border-radius: 999px; border: 1px solid var(--parch-red); background: #F7EEDB; color: var(--parch-red); font-weight: 700; font-size: 14px; }
.roll:hover { background: #fff6e4; }
.rolllog { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.rolltoast { pointer-events: auto; background: var(--panel); border: 1px solid var(--brass-line); border-radius: 12px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: rise .25s ease; }
.rolltoast b { font-family: var(--serif); font-size: 34px; line-height: 1; font-weight: 400; color: var(--brass-hi); }
.rolltoast span { display: flex; flex-direction: column; font-size: 14px; }
.rolltoast small { color: var(--dim); font-size: 13px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* hub */
.hubhead h1 { font-family: var(--serif); font-size: 52px; line-height: 1; }
.thread { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.thread:hover { border-color: var(--blue-line); color: var(--text); }
.thread .v { flex: 0 0 auto; width: 52px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.thread .v b { font-size: 18px; color: var(--blue); }
.thread .v small { font-size: 11px; color: var(--dim); }
.thread .b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--brass-line); color: var(--text); }
.tile.dashed { border-style: dashed; border-color: var(--line-2); }
.toc a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 8px; text-decoration: none; color: var(--text); background: var(--sunk); margin-bottom: 4px; }
.summary p { margin: 0; font-size: 19px; line-height: 1.55; color: var(--text); }
.cite { font-size: 12px; vertical-align: super; margin-left: 1px; text-decoration: none; }

/* learn */
.road { position: relative; min-width: 980px; aspect-ratio: 1200 / 200; }
.roadwrap { overflow-x: auto; }
.road svg, .atlas svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stop { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.stop span { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 2px solid var(--line-2); background: var(--panel); color: var(--faint); transition: box-shadow .2s; }
.stop.st-done span { background: var(--brass); color: #111316; border-color: var(--brass); }
.stop.st-current span { background: #111316; color: var(--brass-hi); border-color: var(--brass); animation: ring 1.8s ease-in-out infinite; }
.stop.sel span { box-shadow: 0 0 0 4px rgba(236,194,119,.45); animation: none; }
@keyframes ring { 0%,100% { box-shadow: 0 0 0 2px var(--brass), 0 0 0 5px rgba(217,165,74,.35); } 50% { box-shadow: 0 0 0 2px var(--brass), 0 0 0 11px rgba(217,165,74,0); } }
.stopbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border-top: 1px solid var(--line); }
.stopbar .title { font-family: var(--serif); font-size: 22px; flex: 1 1 220px; min-width: 0; }
.track { padding: 3px 10px; border-radius: 999px; font-size: 13px; border: 1px solid; }
.track.Rules { background: var(--brass-bg); color: var(--brass-hi); border-color: var(--brass-line); }
.track.Play { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.track.Run { background: var(--teal-bg); color: var(--teal); border-color: var(--teal-line); }
.steps { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--ground); border: 1px solid var(--line); border-radius: 12px; }
.steps button { flex: 1 1 100px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); font-weight: 500; }
.steps button.on { background: var(--brass); color: #111316; }
.lead { margin: 0; font-size: 18px; line-height: 1.55; color: #E3DCCB; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.lcard { padding: 14px 16px; border-radius: 12px; background: var(--ground); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.lcard b { font-family: var(--serif); font-weight: 400; font-size: 21px; color: var(--brass-hi); }
.lcard.adv { background: var(--brass-bg); border-color: var(--brass-line); }
.lcard.dis { background: var(--red-bg); border-color: var(--red-line); }
.lcard.dis b { color: var(--red); }
.points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: #E3DCCB; line-height: 1.5; }
.srcrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line-soft); }
.srcrow .badge { min-width: 64px; justify-content: center; }
.srcrow .what { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; }
.srcrow .what small { color: var(--dim); font-size: 13px; }
.srcrow .pages { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; padding-left: 4px; }
.srcrow .pages a { font-size: 14px; text-decoration: none; color: var(--text-2); }
.srcrow .pages a:hover { color: var(--blue); }
.dialog { display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; gap: 12px; align-items: flex-start; }
.line .who { flex: 0 0 64px; font-family: var(--serif); font-size: 17px; color: var(--brass-hi); padding-top: 1px; }
.line .what { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.line .tag { align-self: flex-start; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--teal-bg); color: var(--teal); border: 1px solid var(--teal-line); }
.dicebox { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 18px; border-radius: 12px; background: var(--ground); border: 1px solid var(--line); }
.die { width: 72px; height: 72px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 34px; background: var(--panel-2); color: #7D786D; border: 2px solid var(--line-2); text-decoration: line-through; }
.die.kept { background: var(--brass); color: #111316; border-color: var(--brass); text-decoration: none; }
.die.small { width: 56px; height: 56px; font-size: 26px; border-radius: 12px; }
.total { font-family: var(--serif); font-size: 44px; line-height: 1; }
.verdict { padding: 4px 12px; border-radius: 999px; font-weight: 700; }
.verdict.yes { background: var(--brass); color: #111316; }
.verdict.no { background: var(--red-bg); color: var(--red); }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; text-align: left; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); width: 100%; }
.toggle .box { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 5px; border: 1.5px solid #6A6F78; display: flex; align-items: center; justify-content: center; color: #111316; font-size: 13px; font-weight: 700; }
.toggle.on { background: var(--panel-2); color: var(--text); border-color: var(--brass); }
.toggle.on .box { background: var(--brass); border-color: var(--brass); }
.toggle.dis.on { border-color: #E0806A; }
.toggle.dis.on .box { background: #E0806A; border-color: #E0806A; }
.q { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--ground); border: 1px solid var(--line); }
.q.right { border-color: var(--brass-line); }
.q.wrong { border-color: var(--red-line); }
.q .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q .opts button { flex: 1 1 160px; min-height: 44px; padding: 8px 12px; border-radius: 10px; text-align: left; border: 1px solid var(--line-2); background: var(--panel); }
.q .opts button.good { background: var(--brass-bg); border-color: var(--brass); }
.q .opts button.bad { background: var(--red-bg); border-color: #B5452F; }
.done { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 18px; border-radius: 12px; background: var(--brass-bg); border: 1px solid var(--brass-line); }
.done b { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--brass-hi); }
.atlas { position: relative; width: 100%; aspect-ratio: 600 / 420; border-radius: 12px; overflow: hidden; background: #0F1216; border: 1px solid var(--line); }
.fog { position: absolute; inset: 0; pointer-events: none; transition: opacity .6s ease; }
.regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; }
.regions button { display: flex; flex-direction: column; gap: 6px; min-height: 56px; padding: 8px 12px; border-radius: 10px; text-align: left; background: var(--sunk); border: 1px solid var(--line-soft); }
.regions button.on { background: var(--panel-2); border-color: var(--brass-line); }
.bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brass); transition: width .4s; }
.sortitems { display: flex; flex-direction: column; gap: 8px; }
.sortitem { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line-soft); }
.sortitem > span { flex: 1 1 220px; min-width: 0; }
.sortitem .seg button { min-width: 0; min-height: 36px; font-size: 14px; }
.sortitem.right { border-color: var(--brass-line); }
.sortitem.wrong { border-color: var(--red-line); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; }
.bubble.you { align-self: flex-end; background: var(--brass-bg); border: 1px solid #5C4823; border-bottom-right-radius: 4px; color: #F2E3C2; }
.bubble.gm { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.gm .who { display: block; font-family: var(--serif); color: var(--brass); margin-bottom: 4px; }
.bubble .rule { display: block; margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--teal-bg); color: var(--teal); border: 1px solid var(--teal-line); font-size: 14px; white-space: normal; }
.composer { display: flex; gap: 8px; }
.composer input, .composer textarea { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ground); resize: vertical; }
.dicetray { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dicetray button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 14px; }
.dicetray input { width: 70px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--ground); }
.typing { color: var(--dim); font-style: italic; }

/* ask */
.answer { font-size: 18px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.answer ul { margin: .5em 0 0; padding-left: 22px; white-space: normal; }
.answer li { margin: .3em 0; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login input { min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ground); }
.err { color: var(--red); font-size: 14px; }
.empty { padding: 24px 14px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--dim); text-align: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brass); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.preview { position: fixed; z-index: 60; max-width: 360px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--brass-line); box-shadow: 0 16px 40px rgba(0,0,0,.55); font-size: 14px; color: var(--text-2); pointer-events: none; }
.preview b { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--brass-hi); margin-bottom: 4px; }

@media (max-width: 820px) {
  .rail { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 14px 16px; gap: 12px; }
  .railfoot { display: none; }
  .nav a { flex: 1 1 140px; }
  .main { padding: 16px 16px 32px; }
  .hubhead h1 { font-size: 40px; }
}

/* world: map, people, table */
.field { min-height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--ground); color: var(--text); }
.field.n { width: 64px; }
.field-l { display: flex; flex-direction: column; gap: 4px; }
select.field { padding-right: 6px; }
.mapcard { display: flex; flex-direction: column; gap: 10px; }
.mapview { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #E7D8B6; box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0,0,0,.45); touch-action: none; }
.mapinner { position: absolute; left: 0; top: 0; height: auto; aspect-ratio: inherit; user-select: none; }
.mapinner img { display: block; width: 100%; height: auto; pointer-events: none; }
.pin { position: absolute; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: none; }
.pin .dot { width: 16px; height: 16px; border-radius: 50%; background: #F4EBD3; border: 2px solid #2B2117; transition: box-shadow .2s; }
.pin.visited .dot { background: var(--brass); }
.pin.dmonly .dot { background: rgba(31,94,87,.25); border: 2px dashed #1F5E57; }
.pin.sel .dot { box-shadow: 0 0 0 6px rgba(217,165,74,.55); }
.pin.pending .dot { background: #fff; border-color: var(--brass); box-shadow: 0 0 0 6px rgba(217,165,74,.4); }
.pin .lbl { position: absolute; left: 34px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: var(--serif); font-size: 15px; color: #2B2117; text-shadow: 0 0 3px #E7D8B6, 0 0 3px #E7D8B6, 0 0 6px #E7D8B6; pointer-events: none; }
.pin.dmonly .lbl { color: #1F5E57; font-style: italic; }
.mapzoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.mapzoom button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #8C7556; background: rgba(239,228,203,.9); color: #2B2117; font-size: 20px; }
.peoplegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.personcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.personcard:hover { border-color: var(--brass-line); color: var(--text); }
.personcard img, .personcard .mono-av { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.personcard .pn { font-family: var(--serif); font-size: 22px; }
.personcard .px { font-size: 14px; color: var(--text-2); }
.mono-av { display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--brass-hi); font-family: var(--serif); font-size: 28px; }
.portrait { width: 112px; height: 112px; border-radius: 16px; object-fit: cover; flex: 0 0 auto; }
.mono-av.big { font-size: 52px; }
.battle { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #2A2E33; box-shadow: 0 0 0 1px var(--line); touch-action: none; user-select: none; }
.battle img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gridlines { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px); background-size: calc(100% / var(--cols)) calc(100% / var(--rows)); }
.token { position: absolute; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: clamp(8px, 1.2vw, 15px); letter-spacing: -.02em; color: #111316; border: 2px solid #111316; box-shadow: 0 2px 6px rgba(0,0,0,.6); cursor: grab; touch-action: none; }
.token.foe { background: #3A1A16; color: #F2C9BF; border-color: #B5452F; }
.token.now { animation: ring 1.6s ease-in-out infinite; }
.token.down { opacity: .45; filter: grayscale(1); }
.initlist { display: flex; flex-direction: column; gap: 6px; }
.initrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); }
.initrow.now { background: var(--brass-bg); border-color: var(--brass-line); }
.initrow.down { opacity: .55; }
.initrow .who { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.initrow .nm { font-weight: 500; }
.av { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #111316; border: 2px solid #111316; }
.av.foe { background: #3A1A16; color: #F2C9BF; border-color: #B5452F; }
.hpbar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.hpbar i { display: block; height: 100%; }
.hpctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.hpctl input { width: 64px; min-height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--ground); }
.initnum { width: 52px; min-height: 36px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--ground); text-align: center; }
select.cond { min-height: 28px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--dim); font-size: 12px; padding: 0 8px; }
body.tv .rail { display: none; }
body.tv .main { padding: 14px; }
.tvwrap { display: flex; flex-wrap: wrap; gap: 14px; min-height: calc(100vh - 28px); }
.tvmap { flex: 999 1 600px; min-width: 0; position: relative; align-self: flex-start; }
.tvinit { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tvbanner { position: absolute; left: 2%; bottom: 3%; padding: 10px 18px; border-radius: 12px; background: rgba(10,11,13,.85); border: 1px solid var(--brass-line); display: flex; flex-direction: column; }
.tvbanner b { font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--brass-hi); }
.tvbanner span { color: var(--dim); font-size: 14px; }
.tvwait { min-height: calc(100vh - 28px); display: flex; align-items: center; justify-content: center; font-size: 64px; color: var(--brass); }

/* settings */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; align-items: start; }
.settings .field { width: 100%; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; }
.kv .mono { font-size: 13px; }
