/* Layout: a Trello board at night. Ink-dark board, rice-paper-on-ink lists scrolling sideways, seal-red and gold
   accents taken from the mod's own Ink Night menu; each card opens into a full sheet with its footage. */
:root {
  color-scheme: dark;
  --board: #13110e;
  --board-2: #1b1813;
  --list: #221e19;
  --card: #2d2821;
  --card-hi: #383128;
  --line: #4a443b;
  --ink: #ede3cc;
  --ink-soft: #cfc3a8;
  --muted: #a8997d;
  --gold: #c9a45c;
  --gold-light: #f2d9a0;
  --seal: #c24a36;
  --seal-text: #f8ecd6;
  --azure: #9cc9ec;
  --jade: #8fcb9b;
  --shadow: rgba(0, 0, 0, .45);
  --display: "Pixelify Sans", "Courier New", monospace;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  /* label hues */
  --l-guide: #b9a77f;
  --l-qi: #6fb3e6;
  --l-combat: #d4583f;
  --l-art: #d9b25f;
  --l-mob: #7fbf86;
  --l-boss: #b23a52;
  --l-item: #d98c4a;
  --l-biome: #5fae74;
  --l-site: #4fa7a0;
  --l-lore: #c9a45c;
  --l-faction: #e07a5f;
  --l-update: #a08ad6;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--board);
  background-image:
    radial-gradient(1200px 500px at 15% -10%, rgba(201, 164, 92, .10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(156, 201, 236, .07), transparent 60%),
    linear-gradient(var(--board), var(--board-2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mountains {
  position: fixed; inset: auto 0 0 0; height: 42vh; pointer-events: none; z-index: 0; opacity: .5;
}
header.top {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(74, 68, 59, .6);
  background: linear-gradient(rgba(19, 17, 14, .92), rgba(19, 17, 14, .6));
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.seal {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  background: var(--seal); color: var(--seal-text); border: 2px solid var(--gold);
  font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1;
  box-shadow: 0 2px 0 var(--shadow);
}
.logo { height: 60px; width: auto; image-rendering: pixelated; flex: none; filter: drop-shadow(0 2px 0 var(--shadow)); }
.brand h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; color: var(--gold-light); line-height: 1.05; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; letter-spacing: .04em; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; min-width: 0; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--list); border: 1px solid var(--line);
  padding: 6px 10px; min-width: 0; flex: 1 1 220px;
}
.search input {
  background: transparent; border: 0; outline: 0; color: var(--ink); font: inherit; width: 100%; min-width: 0;
}
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; position: relative; z-index: 2; }
.chip {
  font: 600 12px var(--display); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--line);
  padding: 4px 9px 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip i { width: 9px; height: 9px; display: inline-block; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--c); color: #16130f; border-color: var(--c); }
.chip[aria-pressed="true"] i { background: #16130f; }
.chip:focus-visible, .card:focus-visible, button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }

main.board {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  display: flex; gap: 12px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  padding: 6px 16px 16px;
  scroll-snap-type: x proximity;
}
.list {
  flex: 0 0 292px; max-height: 100%; display: flex; flex-direction: column;
  background: rgba(34, 30, 25, .94); border: 1px solid var(--line);
  box-shadow: 0 6px 18px var(--shadow);
  scroll-snap-align: start;
}
.list > h2 {
  margin: 0; padding: 10px 12px 8px; display: flex; align-items: baseline; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--gold-light); letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
}
.list > h2 small { margin-left: auto; font-family: var(--body); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list > .blurb { margin: 0; padding: 8px 12px 0; color: var(--muted); font-size: 12.5px; }
.cards { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.card {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 1px solid #3b352c; padding: 0;
  box-shadow: 0 2px 0 var(--shadow);
  transition: transform .12s ease, background .12s ease;
}
.card:hover { background: var(--card-hi); transform: translateY(-1px); }
.card .cover { position: relative; display: block; aspect-ratio: 16 / 9; background: #0f0d0b; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
.card .cover .icon { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, #2b261f, #14110e); }
.card .cover .icon img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.gifmark {
  position: absolute; left: 6px; bottom: 6px; font: 700 10px var(--display); letter-spacing: .1em;
  background: rgba(19, 17, 14, .85); color: var(--gold-light); border: 1px solid var(--gold); padding: 1px 5px;
}
.card .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.labels { display: flex; flex-wrap: wrap; gap: 4px; }
.label { height: 8px; width: 34px; background: var(--c); display: inline-block; }
.card h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.card p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta span { white-space: nowrap; }
.group {
  margin: 4px 0 -2px; display: flex; align-items: baseline; gap: 8px;
  font: 600 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
  border-bottom: 1px dashed var(--line); padding-bottom: 4px;
}
.group:first-child { margin-top: 0; }
.group small { margin-left: auto; font: 12px var(--body); color: var(--muted); letter-spacing: 0; }
.empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }

/* Card sheet */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-start; justify-content: center;
  background: rgba(8, 7, 5, .78); overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.sheet {
  width: min(860px, 100%); background: var(--list); border: 1px solid var(--line); box-shadow: 0 20px 60px var(--shadow);
  position: relative;
}
.sheet .stage { background: #0d0b09; position: relative; }
.sheet .stage img { display: block; width: 100%; max-height: 62vh; object-fit: contain; }
.sheet .stage .icon { padding: 36px; display: grid; place-items: center; background: radial-gradient(circle, #2b261f, #12100d); }
.sheet .stage .icon img { width: 128px; height: 128px; image-rendering: pixelated; }
.caption { margin: 0; padding: 6px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.thumbs { display: flex; gap: 6px; padding: 8px 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.thumbs button { flex: 0 0 auto; width: 96px; aspect-ratio: 16/9; padding: 0; border: 2px solid transparent; background: #0f0d0b; cursor: pointer; position: relative; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button[aria-current="true"] { border-color: var(--gold); }
.thumbs .gifmark { left: 3px; bottom: 3px; font-size: 8px; }
.sheet .content { padding: 16px 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
.sheet .content > * { min-width: 0; }
.sheet h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--gold-light); line-height: 1.1; text-wrap: balance; }
.sheet .inlist { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.sheet .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font: 600 11px var(--display); letter-spacing: .08em; text-transform: uppercase; background: var(--c); color: #16130f; padding: 2px 7px 1px; }
.sheet .desc p { margin: 0 0 10px; max-width: 64ch; color: var(--ink); }
.sheet .desc h4 { margin: 14px 0 6px; font: 600 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.sheet .desc ul { margin: 0 0 10px; padding-left: 18px; color: var(--ink); }
.sheet .desc li { margin: 3px 0; }
.sheet .desc li::marker { color: var(--gold); }
.sheet .desc b { color: var(--gold-light); }
kbd {
  font: 600 12px var(--display); background: #3a342c; color: var(--gold-light); border: 1px solid var(--gold);
  border-bottom-width: 3px; padding: 0 6px; white-space: nowrap;
}
aside.stats { align-self: start; background: var(--card); border: 1px solid #3b352c; }
aside.stats h4 { margin: 0; padding: 8px 12px; font: 600 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line); }
aside.stats dl { margin: 0; padding: 4px 12px 10px; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 13px; }
aside.stats dt { color: var(--muted); }
aside.stats dd { margin: 0; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.close {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; cursor: pointer;
  background: var(--seal); color: var(--seal-text); border: 2px solid var(--gold); font: 700 18px var(--display); line-height: 1;
}
.navrow { display: flex; justify-content: space-between; gap: 8px; padding: 0 18px 16px; }
.navrow button { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); font: 600 13px var(--display); padding: 6px 10px; cursor: pointer; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navrow button:hover { border-color: var(--gold); color: var(--gold-light); }
.note { color: var(--muted); font-size: 12.5px; font-style: italic; }

@media (max-width: 640px) {
  .brand h1 { font-size: 22px; }
  .logo { height: 46px; }
  .list { flex-basis: min(86vw, 320px); }
  .sheet .content { grid-template-columns: 1fr; }
  .sheet h2 { font-size: 22px; }
  .sheet-wrap { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* Real pages: the board links each card to its own page; a card page scrolls like a document. */
a { color: var(--gold-light); }
a:hover { color: #fff3d4; }
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.listnav { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px 10px; position: relative; z-index: 2; scrollbar-width: thin; }
.listnav a {
  flex: none; text-decoration: none; color: var(--ink-soft); font: 600 13px var(--display); letter-spacing: .04em;
  padding: 5px 10px 4px; border: 1px solid transparent;
}
.listnav a:hover, .listnav a[aria-current="page"] { color: var(--gold-light); border-color: var(--line); background: rgba(34, 30, 25, .8); }

/* Board cards are links now */
a.card { text-decoration: none; }
.card .more {
  display: flex; align-items: center; justify-content: space-between; margin-top: 2px; padding-top: 6px;
  border-top: 1px dashed #4a443b; font: 600 12px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--gold);
}
.card:hover .more { color: var(--gold-light); }
.list > h2 a { color: inherit; text-decoration: none; }
.list > h2 a:hover { color: #fff3d4; }

/* Card page */
body.page { overflow: auto; height: auto; display: block; }
body.page main.doc { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 8px 16px 48px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--gold-light); }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.doc-grid > * { min-width: 0; }
.panel { background: var(--list); border: 1px solid var(--line); box-shadow: 0 6px 18px var(--shadow); }
.panel .content { display: block; padding: 18px 20px 22px; }
.panel h1 { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 36px); color: var(--gold-light); line-height: 1.1; text-wrap: balance; }
.panel .summary { margin: 0 0 12px; color: var(--ink-soft); font-size: 16px; max-width: 64ch; }
.panel .desc { font-size: 15.5px; }
.panel .desc p { margin: 0 0 12px; max-width: 70ch; }
.panel .desc h4 { margin: 18px 0 6px; font: 600 14px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.panel .desc ul { margin: 0 0 12px; padding-left: 20px; }
.panel .desc li { margin: 4px 0; }
.panel .desc li::marker { color: var(--gold); }
.panel .desc b { color: var(--gold-light); }
.panel .stage img { max-height: 70vh; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
.side aside.stats { background: var(--list); border-color: var(--line); }
.minilist { background: var(--list); border: 1px solid var(--line); }
.minilist h4 { margin: 0; padding: 8px 12px; font: 600 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line); display: flex; }
.minilist h4 a { color: inherit; text-decoration: none; }
.minilist h4 small { margin-left: auto; color: var(--muted); font: 12px var(--body); letter-spacing: 0; }
.minilist ol { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; max-height: 52vh; overflow-y: auto; }
.minilist li a {
  display: flex; gap: 8px; align-items: center; padding: 5px 7px; text-decoration: none; color: var(--ink-soft);
  background: var(--card); border: 1px solid #3b352c; font-size: 13px; line-height: 1.25;
}
.minilist li a:hover { background: var(--card-hi); color: var(--ink); }
.minilist li a[aria-current="page"] { border-color: var(--gold); color: var(--gold-light); background: var(--card-hi); }
.minilist .dots { display: flex; gap: 2px; flex: none; }
.minilist .dots i { width: 4px; height: 14px; background: var(--c); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pager a {
  display: block; padding: 10px 12px; border: 1px solid var(--line); background: var(--list); text-decoration: none; color: var(--ink);
  font: 600 14px var(--display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pager a small { display: block; font: 11px var(--body); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.pager a:hover { border-color: var(--gold); }
.pager .next { text-align: right; grid-column: 2; }
.backlink { display: inline-flex; gap: 6px; margin-top: 18px; font: 600 13px var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
footer.site { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 16px 28px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 900px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
.card .more span, .pager small, .backlink { font-family: var(--body); }

/* The hidden way to the birthday map: a dot that looks like part of the header. */
.secret { align-self: flex-end; margin-left: -10px; padding: 0 4px 6px; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1; }
.secret:hover, .secret:focus-visible { color: var(--gold); }

/* An art's techniques, on the art's page */
.techs { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.techs h2 { margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; font: 700 22px var(--display); color: var(--gold-light); }
.techs h2 small { font: 13px var(--body); color: var(--muted); }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

/* An item's icon, first on its page: big crisp pixels on the dark stage. */
.stage img.pixel { display: block; image-rendering: pixelated; width: auto; height: min(240px, 40vh); margin: 0 auto; padding: 28px 0; box-sizing: content-box; }
.thumbs button[data-icon] img { object-fit: contain; image-rendering: pixelated; padding: 4px; box-sizing: border-box; }

/* Tables in a card (realms, who stands where) */
.panel .desc .tablewrap { overflow-x: auto; margin: 0 0 12px; }
.panel .desc table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; min-width: 100%; }
.panel .desc th, .panel .desc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.panel .desc thead th { background: var(--card); color: var(--gold); font: 600 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.panel .desc tbody th { color: var(--gold-light); font-weight: 700; white-space: nowrap; }
.panel .desc ol { margin: 0 0 12px; padding-left: 22px; }
.panel .desc ol li { margin: 6px 0; }
