:root {
  --bg: #07090e; --panel: rgba(18, 22, 31, 0.86); --panel-solid: #12161f;
  --line: rgba(200, 170, 110, 0.16); --line-strong: rgba(200, 170, 110, 0.34);
  --gold: #c8aa6e; --gold-bright: #f0d9a8; --text: #d9dee8; --muted: #7f8899;
  --ready: #4ade80; --close: #fbbf24; --open: #58a6ff; --locked: #f87171; --gone: #4a5163;
  --radius: 12px; --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
* { box-sizing: border-box; }
body {
  margin: 0; font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 700px at 12% -10%, #1b2a24 0%, transparent 60%),
    radial-gradient(900px 600px at 95% 0%, #2a1c30 0%, transparent 55%), var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 22px 20px 80px; }
.spacer { flex: 1; }

.topbar { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.brand h1 {
  margin: 0; font-size: 25px; letter-spacing: 0.5px; font-weight: 700;
  background: linear-gradient(100deg, var(--gold-bright), var(--gold) 55%, #8d7541);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub { color: var(--muted); font-size: 12.5px; }
.tally { text-align: right; line-height: 1.1; }
.tally .n { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; }
.ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; cursor: pointer; transition: .15s; }
.ghost:hover { border-color: var(--line-strong); background: rgba(255,255,255,.08); }
.ghost[disabled] { opacity: .5; cursor: progress; }

.meter { height: 7px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; margin-bottom: 24px; }
.meter > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2f7a4f, var(--ready)); transition: width .5s; }

.roster { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pc {
  position: relative; display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 7px 14px 7px 7px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--panel), rgba(12,15,22,.9)); transition: .18s; overflow: hidden;
}
.pc::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--cc, var(--gold)); }
.pc:hover { border-color: var(--line-strong); }
.pc.off { opacity: .35; filter: saturate(.35); }
.pc img { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line-strong); }
.pc .nm { font-weight: 650; color: var(--cc, var(--text)); }
.pc .cl { color: var(--muted); font-size: 11.5px; }

.notice { padding: 12px 15px; border-radius: var(--radius); margin-bottom: 18px; font-size: 12.5px; border: 1px solid var(--line-strong); background: rgba(200,170,110,.08); }
.notice.bad { border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.notice code { background: rgba(0,0,0,.4); padding: 1px 6px; border-radius: 4px; font-size: 11.5px; }
.notice b { color: var(--gold-bright); }

section { margin-bottom: 26px; }
.head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.head h2 { margin: 0; font-size: 15px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); font-weight: 650; }
.head .note { color: var(--muted); font-size: 11.5px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }

.next { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1px; background: rgba(255,255,255,.05); }
.next a { display: flex; gap: 11px; align-items: flex-start; padding: 10px 13px; background: var(--panel-solid); border-left: 2px solid var(--st, var(--open)); }
.next a:hover { background: #171c27; }
.next img { width: 34px; height: 34px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14); flex: none; }
.next .b { min-width: 0; flex: 1; }
.next .nm { font-weight: 600; font-size: 13px; }
.next .why { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.next .where { color: #5c6478; font-size: 10.5px; }

.controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 11px 14px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 20px; padding: 4px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: rgba(200,170,110,.16); border-color: var(--gold); color: var(--gold-bright); }
.chip .c { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 5px; }
.chip.on .c { color: var(--gold); }
#search { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; min-width: 210px; }
#search:focus { outline: none; border-color: var(--gold); }

.exp { margin-bottom: 12px; }
.exp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 15px; }
.exp > summary::-webkit-details-marker { display: none; }
.exp > summary:hover { background: rgba(255,255,255,.03); }
.exp .caret { color: var(--muted); font-size: 11px; width: 12px; }
.exp[open] .caret { transform: rotate(90deg); }
.exp .xn { font-weight: 650; font-size: 14.5px; }
.exp .xc { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.exp .xbar { width: 130px; height: 5px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.exp .xbar > i { display: block; height: 100%; background: linear-gradient(90deg, #2f7a4f, var(--ready)); }
.exp .rdy { color: var(--ready); font-size: 11.5px; font-weight: 600; }

.srcgroup { border-top: 1px solid rgba(255,255,255,.05); padding: 10px 15px 14px; }
.srcgroup h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.srcgroup h4 span { color: var(--muted); letter-spacing: 0; text-transform: none; margin-left: 6px; font-weight: 400; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 6px; align-items: start; }
.tile { display: flex; gap: 8px; align-items: flex-start; padding: 6px 9px 6px 6px; border: 1px solid rgba(255,255,255,.06); border-left: 2px solid var(--st, var(--open)); border-radius: 8px; background: rgba(255,255,255,.02); min-width: 0; }
.tile:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.tile.owned { opacity: .45; }
.tile img { width: 28px; height: 28px; border-radius: 6px; flex: none; }
.tile .t { min-width: 0; }
.tile .tn { font-size: 12px; overflow-wrap: anywhere; }
.tile .tw { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }

.st-owned { --st: var(--gone); } .st-ready { --st: var(--ready); } .st-close { --st: var(--close); }
.st-open { --st: var(--open); } .st-locked { --st: var(--locked); } .st-unobtainable { --st: var(--gone); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.foot { color: var(--muted); font-size: 11px; text-align: center; margin-top: 30px; }
.empty { color: var(--muted); font-size: 12px; padding: 10px 0; }
@media (max-width: 720px) { .wrap { padding: 16px 12px 60px; } }
