/* Player wiki. Same palette and fonts as the Dualis Character Creator and the GM workspace. Phone first. */
:root {
  --bg: #f4f0e8; --surface: #fffdf9; --surface-2: #f6f1e8; --ink: #23201c; --ink-2: #5d564d; --line: #e0d7c8;
  --accent: #8a3b2e; --accent-ink: #ffffff; --accent-soft: #f3e2dc;
  --shadow: 0 1px 2px rgba(40,30,20,.06), 0 4px 16px rgba(40,30,20,.05); --radius: 12px;
  --head: "Cormorant SC", Georgia, serif; --body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #15161a; --surface: #1e2025; --surface-2: #262930; --ink: #ece7df; --ink-2: #a9a299; --line: #353941;
  --accent: #d27a62; --accent-ink: #1a1210; --accent-soft: #3a2621; color-scheme: dark; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: .02em; line-height: 1.2; margin: 1.2em 0 .4em; }
h1 { font-size: 32px; margin-top: .2em; } h2 { font-size: 24px; } h3 { font-size: 20px; } h4 { font-size: 16px; color: var(--ink-2); }
a { color: var(--accent); text-underline-offset: 2px; }
p { margin: 0 0 .9em; }
.muted { color: var(--ink-2); } .small { font-size: 13.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 21px var(--head); }
.brand b { font: 700 19px var(--head); letter-spacing: .03em; }
.searchbar { display: flex; gap: 8px; flex: 1 1 240px; max-width: 520px; margin-left: auto; }
input[type=search] { flex: 1; min-width: 0; font: 16px var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 44px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 44px; padding: 6px 16px; border-radius: 10px; font: 600 15px var(--body); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

main { max-width: 980px; margin: 0 auto; padding: 18px 14px 70px; }
.crumbs { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; } .crumbs a { color: var(--ink-2); }
.lead { font-size: 18px; color: var(--ink-2); font-style: italic; margin: 0 0 1em; }

/* entry page: infobox floats on wide screens, stacks first on phones */
.entry { display: flex; flex-direction: column; }
.infobox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; margin: 0 0 16px; box-shadow: var(--shadow); }
.infobox dl { margin: 0; display: grid; grid-template-columns: minmax(80px, 38%) 1fr; }
.infobox dt, .infobox dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.infobox dt { color: var(--ink-2); font-size: 13.5px; font-weight: 600; padding-right: 10px; }
.infobox dt:nth-last-of-type(1), .infobox dd:last-of-type { border-bottom: 0; }
.typechip { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; text-decoration: none; }
@media (min-width: 760px) {
  main { padding-top: 26px; }
  .entry { display: block; }
  .infobox { float: right; width: 280px; margin: 6px 0 14px 22px; }
  .entry-body { min-width: 0; }
  .after { clear: both; }
}
.body .block { margin: 0 0 1em; }
.body .block > :last-child { margin-bottom: 0; }
.body h2 { font-size: 22px; } .body h3 { font-size: 18px; }
.body ul, .body ol { padding-left: 1.4em; margin: 0 0 .9em; }
.body blockquote { margin: 0 0 .9em; padding: 2px 14px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.body table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; margin-bottom: .9em; }
.body th, .body td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.body th { background: var(--surface-2); }
.body img.wiki-img { max-width: 100%; height: auto; border-radius: 8px; }
.body pre { overflow-x: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; }
.body aside.sidebar { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); }
.body aside.sidebar h4 { margin: 0 0 4px; }
.wiki-text { color: inherit; }
.relations ul, .linkshere { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.relations .rel { margin: 0 0 10px; }
.relations .rel-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 15px; }
.pill:hover { border-color: var(--accent); }

/* lists */
.cards { display: grid; gap: 10px; grid-template-columns: 1fr; padding: 0; margin: 0; list-style: none; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
a.card:hover { border-color: var(--accent); }
.card .t { font-weight: 600; font-size: 16.5px; display: block; }
.card .s { display: block; color: var(--ink-2); font-size: 14.5px; margin-top: 2px; }
.typegrid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); padding: 0; margin: 0; list-style: none; }
@media (min-width: 640px) { .typegrid { grid-template-columns: repeat(4, 1fr); } }
.typegrid a { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; box-shadow: var(--shadow); }
.typegrid a:hover { border-color: var(--accent); } .typegrid .n { font-weight: 400; font-size: 13.5px; color: var(--ink-2); }
.story { display: block; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; margin: 8px 0 4px; box-shadow: var(--shadow); }
.story b { font: 700 22px var(--head); letter-spacing: .03em; display: block; } .story span { opacity: .9; font-size: 14.5px; }
.filter { margin: 8px 0 14px; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.notice { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.empty { padding: 28px 8px; text-align: center; color: var(--ink-2); }
