:root {
  --bg: #f2ead6;
  --bg-pattern: rgba(122, 90, 20, 0.055);
  --panel: #fbf6e9;
  --panel-2: #efe5cb;
  --ink: #2a2135;
  --ink-soft: #4c4258;
  --muted: #7a6f78;
  --gold: #9a6b0f;
  --gold-fill: #c9930a;
  --gold-soft: #f3e3b3;
  --red: #b03040;
  --green: #4d7c43;
  --line: #ddd0ae;
  --line-strong: #c9b586;
  --track: #e4d9ba;
  --shadow: 0 1px 2px rgba(58, 44, 10, 0.12), 0 6px 18px rgba(58, 44, 10, 0.08);
  --drop-bg: #fdfaf1;
  --navh: 54px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a12;
    --bg-pattern: rgba(230, 185, 61, 0.05);
    --panel: #171221;
    --panel-2: #1f1930;
    --ink: #ede4d3;
    --ink-soft: #cfc4ae;
    --muted: #9d92b4;
    --gold: #e6b93d;
    --gold-fill: #e6b93d;
    --gold-soft: #3a2f14;
    --red: #e05260;
    --green: #8fc97e;
    --line: #2e2742;
    --line-strong: #463a63;
    --track: #2a2340;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 22px rgba(0, 0, 0, 0.35);
    --drop-bg: #120e1c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(45deg, var(--bg-pattern) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, var(--bg-pattern) 0 2px, transparent 2px 14px);
  color: var(--ink);
  font-family: "Spectral", Georgia, serif;
  font-size: 16.5px;
  line-height: 1.5;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: calc(26px + var(--navh)) 18px 64px; }
h1, h2, h3 { font-family: "Cinzel", serif; margin: 0; }
.mono { font-family: "VT323", monospace; }
header.lede { border-bottom: 3px double var(--line-strong); padding-bottom: 18px; margin-bottom: 20px; }
header.lede h1 { font-size: clamp(30px, 5.4vw, 44px); font-weight: 800; letter-spacing: 0.01em; line-height: 1.08; }
header.lede h1 .accent { color: var(--red); }
header.lede p { margin: 10px 0 0; color: var(--ink-soft); max-width: 62ch; font-size: 17.5px; }
header.lede p b { color: var(--ink); }
.drop {
  border: 2px dashed var(--line-strong);
  background: var(--drop-bg);
  border-radius: 10px;
  padding: 26px 22px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.drop.dragging { border-color: var(--gold); background: var(--gold-soft); }
.drop .big { font-family: "Cinzel", serif; font-weight: 700; font-size: 21px; }
.drop p { margin: 6px auto 0; color: var(--muted); max-width: 58ch; }
.drop .actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: "Spectral", Georgia, serif; font-size: 15.5px; font-weight: 600;
  border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--ink);
  padding: 9px 18px; border-radius: 8px; cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--gold-fill); border-color: var(--gold-fill); color: #171106; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 12px; font-size: 14px; border-radius: 7px; }
.loadmsg { margin-top: 12px; font-size: 15px; min-height: 1.2em; }
.loadmsg.err { color: var(--red); }
.loadmsg.ok { color: var(--green); }
.uploadalert { margin-top: 8px; font-size: 15px; color: var(--red); font-weight: 600; }
.uploadalert[hidden] { display: none; }
details.paths { margin-top: 14px; text-align: left; max-width: 720px; margin-left: auto; margin-right: auto; }
details.paths summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 15px; text-align: center; }
details.paths .pathlist { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
details.paths dt { font-weight: 600; margin-top: 8px; }
details.paths dt:first-child { margin-top: 0; }
details.paths dd { margin: 2px 0 0; color: var(--ink-soft); }
code.path { font-family: "VT323", monospace; font-size: 16.5px; background: var(--panel-2); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
.stats { display: none; margin-top: 20px; }
.stats.on { display: block; }
.stats .overall { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.stats .overall .pct { font-family: "VT323", monospace; font-size: 52px; line-height: 1; color: var(--gold); }
.stats .overall .of { font-size: 17px; color: var(--ink-soft); }
.overallbar { height: 12px; background: var(--track); border-radius: 6px; overflow: hidden; margin: 10px 0 16px; }
.overallbar > div { height: 100%; background: var(--gold-fill); width: 0%; transition: width 0.5s ease; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px 8px; box-shadow: var(--shadow); }
.stat .v { font-family: "VT323", monospace; font-size: 26px; line-height: 1.05; white-space: nowrap; }
.stat .k { font-size: 13.5px; color: var(--muted); letter-spacing: 0.02em; }
.statenote { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.moved { margin-top: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px 12px; box-shadow: var(--shadow); }
.moved h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.moved .mvblock { margin-top: 10px; }
.moved .flabel { font-weight: 700; color: var(--gold); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.moved .mvline { font-size: 15px; margin-top: 4px; color: var(--ink-soft); }
.moved .mvless { color: var(--red); font-weight: 600; }
.moved .mvchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.moved details.mvdet { margin-top: 6px; }
.moved details.mvdet summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14.5px; }
.controls { position: sticky; top: calc(var(--navh) - 2px); z-index: 20; background: var(--bg); padding: 14px 0 10px; margin-top: 22px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--navh) - 2px); }
.secnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  width: 100%; max-width: 1060px; margin-left: auto; margin-right: auto;
  display: flex; gap: 7px; flex-wrap: nowrap; overflow-x: auto;
  padding: 9px 20px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.secnav::-webkit-scrollbar { display: none; }
.navlink {
  flex: none; white-space: nowrap; text-decoration: none;
  font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
  border: 1.5px solid var(--line-strong); background: var(--panel);
  padding: 5px 14px; border-radius: 999px;
}
.navlink:hover { border-color: var(--gold); color: var(--ink); }
.navlink.active { background: var(--gold-fill); border-color: var(--gold-fill); color: #171106; }
#secretsSec, #bestSec, #collSec, #advSec { scroll-margin-top: calc(var(--navh) + 182px); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.controls .row1 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.controls input[type="search"] {
  flex: 1 1 220px; font: inherit; font-size: 16px; padding: 9px 13px;
  border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink);
}
.controls select {
  font: inherit; font-size: 15.5px; padding: 9px 10px;
  border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink);
}
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.chip {
  font-family: "Spectral", Georgia, serif; font-size: 14px; font-weight: 600;
  border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--ink-soft);
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
}
.chip .tag { font-size: 11.5px; font-weight: 700; color: var(--gold); margin-left: 5px; letter-spacing: 0.04em; }
.chip[aria-pressed="true"] { background: var(--gold-fill); border-color: var(--gold-fill); color: #171106; }
.chip[aria-pressed="true"] .tag { color: #5c4303; }
.dd { position: relative; display: inline-block; }
.ddbtn { display: inline-flex; align-items: center; }
.ddbtn .caret { font-size: 10.5px; margin-left: 6px; line-height: 1; }
.ddbtn-lg { font-size: 15.5px; padding: 8px 13px; }
.ddpanel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 216px; max-width: min(80vw, 320px); max-height: 62vh; overflow-y: auto;
  background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px;
}
.dd.right .ddpanel { left: auto; right: 0; }
.ddpanel[hidden] { display: none; }
.ddopt {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font-family: "Spectral", Georgia, serif; font-size: 14.5px; font-weight: 600;
  color: var(--ink-soft); background: transparent; border: 0; border-radius: 7px;
  padding: 7px 9px; cursor: pointer; text-align: left;
}
.ddopt:hover { background: var(--panel-2); color: var(--ink); }
.ddopt .box {
  width: 15px; height: 15px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: transparent;
}
.ddopt[aria-pressed="true"] { color: var(--ink); }
.ddopt[aria-pressed="true"] .box { background: var(--gold-fill); border-color: var(--gold-fill); color: #171106; }
.ddopt .tick { width: 15px; flex: none; text-align: center; color: var(--gold); font-size: 13px; visibility: hidden; }
.ddopt[aria-pressed="true"] .tick { visibility: visible; }
.ddopt .tag { font-size: 11.5px; font-weight: 700; color: var(--gold); margin-left: auto; letter-spacing: 0.04em; }
.showing { margin-top: 9px; color: var(--muted); font-size: 14.5px; }
.grouphead { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 4px; }
.grouphead h2 { font-size: 23px; font-weight: 700; }
.grouphead .n { font-family: "VT323", monospace; font-size: 22px; color: var(--gold); }
.groupsub { color: var(--muted); margin: 0 0 12px; font-size: 15px; max-width: 70ch; }
.cards { display: flex; flex-direction: column; gap: 9px; }
.card {
  display: grid; grid-template-columns: 46px 1fr 218px; gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; box-shadow: var(--shadow);
}
.card .rank { font-family: "VT323", monospace; font-size: 30px; color: var(--gold); text-align: center; line-height: 1; }
.card.near .rank { color: var(--red); }
.card h3 { font-size: 18.5px; font-weight: 700; line-height: 1.25; }
.card .req { color: var(--ink-soft); margin-top: 2px; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.pill { font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 9px; color: var(--ink-soft); background: var(--panel-2); }
.pill.dlc { border-color: var(--gold); color: var(--gold); background: transparent; }
.pill.kindp { border-color: var(--green); color: var(--green); background: transparent; }
.meta .unlocks { font-size: 14px; color: var(--muted); }
.meta a.wiki { font-size: 14px; color: var(--gold); text-decoration: none; font-weight: 600; }
.meta a.wiki:hover { text-decoration: underline; }
.prog { text-align: right; }
.prog .pctline { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; }
.prog .pct { font-family: "VT323", monospace; font-size: 34px; line-height: 1; }
.card.near .prog .pct { color: var(--red); }
.prog .counts { font-family: "VT323", monospace; font-size: 18px; color: var(--muted); }
.bar { height: 9px; background: var(--track); border-radius: 5px; overflow: hidden; margin-top: 7px; }
.bar > div { height: 100%; background: var(--gold-fill); }
.card.near .bar > div { background: var(--red); }
.prog .togo { font-size: 14px; color: var(--muted); margin-top: 5px; }
.approx { color: var(--gold); font-weight: 700; }
.noprog { text-align: right; }
.noprog .why { font-size: 14px; color: var(--muted); max-width: 30ch; margin-left: auto; }
.markbtn { margin-top: 7px; }
.card.done { opacity: 0.85; }
.card.done .rank { color: var(--green); font-size: 20px; }
.donebadge { font-size: 12.5px; font-weight: 700; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 1px 9px; }
.donebadge.manual { color: var(--gold); border: 1.5px dashed var(--gold); }
.empty { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); }
.donetoggle { margin-top: 30px; width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 13px 18px; cursor: pointer; font: inherit; color: var(--ink); }
.donetoggle h2 { font-size: 20px; }
.donetoggle .chev { font-family: "VT323", monospace; font-size: 24px; color: var(--gold); }
footer { margin-top: 44px; border-top: 3px double var(--line-strong); padding-top: 16px; color: var(--muted); font-size: 14.5px; }
footer p { margin: 0 0 8px; max-width: 78ch; }
footer a { color: var(--gold); }
.sessionscope { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.fdetail { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 7px; font-size: 14px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 3px; }
.fdetail .flabel { font-weight: 700; color: var(--gold); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.pill.covp { border-color: var(--red); color: var(--red); background: transparent; }
.pill.filev { border-color: var(--line); color: var(--muted); background: transparent; font-weight: 500; letter-spacing: 0.02em; }
details.trace { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; font-size: 13.5px; color: var(--muted); }
details.trace summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
details.trace summary:hover { color: var(--gold); }
details.trace .tline { margin-top: 4px; word-break: break-word; }
details.trace .tlabel { font-weight: 700; color: var(--gold); font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.extrasec { margin-top: 36px; }
.secrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; box-shadow: var(--shadow); align-items: center; }
.secrow h3 { font-size: 16.5px; font-weight: 700; }
.secrow .hint { color: var(--ink-soft); font-size: 14.5px; margin-top: 2px; }
.secrow .spell { font-family: "VT323", monospace; font-size: 19px; background: var(--panel-2); padding: 1px 8px; border-radius: 5px; word-break: break-all; }
.secrow.done { opacity: 0.85; }
.bestgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.bestitem { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; box-shadow: var(--shadow); }
.bestitem .bn { font-weight: 700; }
.bestitem .bp { color: var(--muted); font-size: 13px; display: block; }
.bestitem .bid { font-family: "VT323", monospace; color: var(--gold); font-size: 14.5px; }
.bestitem .bk { color: var(--ink-soft); font-size: 13px; display: block; }
.bestitem.found { opacity: 0.8; }
.bestitem .foundbadge { font-size: 11.5px; font-weight: 700; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.bestitem .missbadge { font-size: 11.5px; font-weight: 700; color: var(--red); border: 1px solid var(--red); border-radius: 999px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.bestfilters { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.bestgrid .ghead { grid-column: 1 / -1; font-family: "Cinzel", serif; font-weight: 700; font-size: 16.5px; margin-top: 12px; }
.bestgrid .ghead:first-child { margin-top: 0; }
.advblock { margin-top: 20px; }
.advblock:first-child { margin-top: 6px; }
.advhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.advhead h3 { font-size: 18.5px; font-weight: 700; }
.advtask { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); margin-bottom: 6px; align-items: baseline; }
.advtask .advreq { font-weight: 600; }
.advtask .advunlocks { grid-column: 1; color: var(--muted); font-size: 14px; }
.advtask .advunlocks .arr { color: var(--gold); font-weight: 700; }
.advtask .advtype { grid-row: 1; grid-column: 2; color: var(--gold); font-size: 14.5px; }
.advtask.done { opacity: 0.75; }
.advtask.done .advreq { font-weight: 500; color: var(--ink-soft); }
.advalldone { color: var(--green); font-weight: 600; font-size: 15px; padding: 2px 0 8px; }
details.advdone { margin: 2px 0 8px; }
details.advdone summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }

.ic { width: 15px; height: 15px; flex: none; vertical-align: -2.5px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 20px; height: 20px; vertical-align: -4px; color: var(--gold); margin-right: 7px; }
.sigils { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.sigil { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 11px 3px 9px; background: var(--panel); }
.sigil .ic { color: var(--gold); }
.plats { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.plat { font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 2px 11px; color: var(--ink-soft); background: var(--panel); }
.plat .st { font-weight: 700; }
.plat.ok .st { color: var(--green); }
.plat.no { color: var(--muted); }
.plat.no .st { color: var(--red); }
.plat .dim { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.pill.filev .ic { color: var(--gold); width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.meta .unlocks .arr { color: var(--gold); font-weight: 700; }
footer details.footdet { margin: 2px 0 10px; }
footer details.footdet summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14.5px; }
footer details.footdet ul { margin: 8px 0 0; padding-left: 18px; }
footer details.footdet li { margin-bottom: 5px; max-width: 78ch; }
@media (max-width: 720px) {
  #secretsSec, #bestSec, #collSec, #advSec { scroll-margin-top: calc(var(--navh) + 272px); }
  .card { grid-template-columns: 34px 1fr; }
  .card .rank { font-size: 24px; }
  .prog, .noprog { grid-column: 2; text-align: left; }
  .prog .pctline { justify-content: flex-start; }
  .noprog .why { margin-left: 0; }
  .stats .overall .pct { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .overallbar > div { transition: none; }
}

/* --- Public-site additions (port) --- */
.skip { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--panel); color: var(--ink); padding: 10px 14px; border: 1px solid var(--line-strong); }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--gold-fill); outline-offset: 2px; }
.intro, .faq { margin: 18px 0; }
.intro h2, .faq h2 { margin: 0 0 8px; }
.newernotice { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--ink); font-size: 15px; }
