:root {
  --bg: #1c1b19; --panel: #262420; --line: #3a3732; --text: #e8e2d6; --dim: #9a9387;
  --accent: #cd412b; --good: #7fb04a; --warn: #e0a43a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, sans-serif; }
a { color: inherit; }
body > header { display: flex; gap: 18px; align-items: center; padding: 10px 20px; background: #12110f; border-bottom: 2px solid var(--accent); flex-wrap: wrap; }
body > header .brand { font-weight: 700; letter-spacing: .5px; text-decoration: none; color: var(--accent); }
body > header nav a { text-decoration: none; color: var(--dim); margin-right: 14px; }
body > header nav a:hover { color: var(--text); }
body > header form { margin-left: auto; }
.badge { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 12px; }
main { padding: 20px; max-width: 1300px; margin: auto; }
h1 { margin: 0 0 14px; font-size: 22px; }
h2 { font-size: 16px; margin: 22px 0 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.card .big { font-size: 22px; font-weight: 700; }
.dim { color: var(--dim); }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--accent); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.owned td { background: rgba(127, 176, 74, .08); }
img.icon { width: 40px; height: 40px; object-fit: contain; vertical-align: middle; }
img.icon.lg { width: 128px; height: 128px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > div { height: 100%; background: var(--good); }
input, select, button { background: #12110f; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; font: inherit; }
button { cursor: pointer; } button:hover { border-color: var(--accent); }
form.inline { display: inline; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 2px; margin-right: 2px; vertical-align: middle; border: 1px solid #0006; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.pill { display: inline-block; padding: 0 6px; border-radius: 3px; background: var(--line); font-size: 12px; }
.pill.set { background: var(--good); color: #111; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
svg.chart { background: var(--panel); border: 1px solid var(--line); width: 100%; max-width: 680px; }

/* shared */
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
a.item { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
a.item:hover span { text-decoration: underline; }
img.icon { border-radius: 4px; background: #00000026; }
td.ic { width: 1px; padding-right: 0; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.small { padding: 2px 8px; font-size: 12px; }

/* filter bars */
.controls { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 18px; }
.ctl { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ctl .lbl { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; width: 70px; }
.ctl label { display: inline-flex; align-items: center; gap: 4px; }
.chip input { display: none; }
.chip span { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--dim); user-select: none; }
.chip input:checked + span { border-color: var(--accent); color: var(--text); background: #cd412b22; }
input.add { border-radius: 14px; width: 170px; }
details.more { display: inline; }
details.more summary { cursor: pointer; color: var(--dim); display: inline; }
details.more[open] { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding-left: 80px; }
.tabs a { text-decoration: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); }
.tabs a.on { color: var(--text); border-color: var(--accent); }

/* kit matcher */
section.kit { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.kit-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.kit-head h2 { margin: 0 0 6px; color: var(--text); font-size: 17px; text-transform: none; letter-spacing: 0; }
.kit-head h2 a { text-decoration: none; }
.palette { display: flex; height: 6px; width: 220px; border-radius: 3px; overflow: hidden; }
.palette span { flex: 1; }
.pieces { display: flex; gap: 4px; flex-wrap: wrap; }
.pieces img { width: 44px; height: 44px; border-radius: 4px; background: radial-gradient(circle, #4a463f 0%, #2a2824 75%); border: 2px solid transparent; }
.pieces a.owned img { border-color: var(--good); }
.wrow { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.wlabel { font-weight: 600; color: var(--dim); padding-top: 4px; }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.skin { background: #1c1b19; border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.skin:hover { border-color: #5a554d; }
.skin.is-owned { border-color: var(--good); }
.skin .pic { position: relative; display: block; aspect-ratio: 1; background: radial-gradient(circle, #3a3732 0%, #22201d 70%); border-radius: 4px; }
.skin .pic img { width: 100%; height: 100%; object-fit: contain; }
.skin .tag { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.tag.set { background: var(--good); color: #111; }
.tag.own { background: #111c; color: var(--good); }
.skin .nm { text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skin .meta { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skin .meta a { font-weight: 600; text-decoration: none; }
.fit { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fit > div { height: 100%; background: linear-gradient(90deg, var(--warn), var(--good)); }

/* profit finder */
table.deals td { padding: 8px 10px; }
.pill.c-high { background: var(--good); color: #111; }
.pill.c-med { background: var(--warn); color: #111; }
.pill.c-low { background: var(--line); }
.pill.k-deal, .pill.k-underpriced { background: var(--good); color: #111; }
details.caveats { margin-top: 14px; color: var(--dim); }
details.caveats summary { cursor: pointer; }

.pill.manip { background: #e0a43a; color: #111; font-weight: 700; }

/* nav + currency toggle */
body > header nav a.on { color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.curtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-left: auto; }
.curtoggle a { padding: 3px 10px; text-decoration: none; color: var(--dim); font-size: 12px; font-weight: 600; }
.curtoggle a.on { background: var(--accent); color: #fff; }
body > header form { margin-left: 0; }
a.btn { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; font-size: 12px; }
a.btn.on { border-color: var(--good); color: var(--good); }
.chiplink { padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--dim); }
.chiplink.on { border-color: var(--accent); color: var(--text); background: #cd412b22; }

/* vendor badges */
.mkt { white-space: nowrap; }
.vb { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 3px; font-size: 11px; font-weight: 700; line-height: 16px; vertical-align: 1px; }
.vb.t-official { background: #2f6fb0; color: #fff; }
.vb.t-trusted { background: var(--good); color: #111; }
.vb.t-good { background: #4f7a32; color: #e8f5dc; }
.vb.t-limited { background: #6b5a2c; color: #f3e2b2; }
.vb.t-risky { background: var(--accent); color: #fff; }
.vb.yours { background: #8a5cd1; color: #fff; }
.stars { --pct: calc(var(--r) / 5 * 100%); display: inline-block; font-size: 15px; letter-spacing: 1px; line-height: 1;
  background: linear-gradient(90deg, #f0b429 var(--pct), #4a463f var(--pct)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars::before { content: "★★★★★"; }

/* inventory hero */
.inv-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; margin-bottom: 8px; }
.spot { display: flex; gap: 14px; align-items: center; padding: 12px 18px 12px 12px; border-radius: 10px; text-decoration: none;
  background: radial-gradient(circle at 20% 50%, #3a3732, #22201d); border: 2px solid var(--line); }
.spot-pic { width: 120px; height: 120px; }
.spot-pic img, .ic-pic img { width: 100%; height: 100%; object-fit: contain; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tile .big, .spot .big { font-size: 24px; font-weight: 800; }
.tile.gold { border-color: #b08a2a; background: linear-gradient(160deg, #3a3019, var(--panel)); }
.tile.hot { border-color: #a5472e; background: linear-gradient(160deg, #3a2219, var(--panel)); }
.raritybar { grid-column: 1 / -1; display: flex; height: 22px; border-radius: 6px; overflow: hidden; font-size: 11px; font-weight: 700; }
.raritybar > div { display: flex; align-items: center; justify-content: center; min-width: 60px; color: #111; white-space: nowrap; overflow: hidden; }

/* rarity colours */
.t-legendary { --tc: #f0b429; } .t-epic { --tc: #a970ff; } .t-rare { --tc: #3fa7ff; } .t-uncommon { --tc: #6cc04a; } .t-common { --tc: #6b665e; }
.raritybar > div { background: var(--tc); }
.spot { border-color: var(--tc); box-shadow: 0 0 18px -6px var(--tc); }
.tierkey { color: var(--tc); font-weight: 700; }

/* set cards */
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.setcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.setcard.oneaway { border-color: #d0682f; box-shadow: 0 0 0 1px #d0682f55, 0 0 22px -10px #ff7a3c; }
.setcard.trophy { border-color: #b08a2a; background: linear-gradient(160deg, #362c16, var(--panel) 60%); }
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-name { font-weight: 700; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.ribbon { background: linear-gradient(90deg, #ff7a3c, #cd412b); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 10px; letter-spacing: .5px; }
.sc-bar { height: 7px; background: #12110f; border-radius: 4px; overflow: hidden; }
.sc-bar > div { height: 100%; background: linear-gradient(90deg, #4f8f3a, #9be15d); border-radius: 4px; }
.trophy .sc-bar > div { background: linear-gradient(90deg, #b08a2a, #f0d36b); }
.sc-pieces { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-pieces .pc { position: relative; display: block; border-radius: 6px; background: radial-gradient(circle, #45413a, #24221e 75%); border: 1px solid transparent; line-height: 0; }
.sc-pieces .pc img { display: block; }
.sc-pieces .pc.have { border-color: #6cc04a88; }
.sc-pieces .pc.need img { filter: grayscale(1) brightness(.55); opacity: .65; }
.sc-pieces .pc.need:hover img { filter: none; opacity: 1; }
.sc-pieces .pc.locked img { filter: grayscale(1) brightness(.35); opacity: .45; }
.pc .q, .ic-pic .q { position: absolute; right: 1px; bottom: 1px; font-size: 10px; font-weight: 800; background: #000a; padding: 0 3px; border-radius: 3px; line-height: 14px; }
.pc .lk, .ic-pic .lk { position: absolute; left: 1px; top: 1px; font-size: 10px; line-height: 12px; }
.pc .deal { position: absolute; right: 1px; top: 1px; font-size: 10px; font-weight: 800; background: var(--good); color: #111; border-radius: 3px; padding: 0 3px; line-height: 13px; }
.sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; font-size: 13px; }
.trophies .setcard { padding: 10px; }
details.more-sets { margin-top: 10px; }
details.more-sets summary { cursor: pointer; color: var(--dim); margin-bottom: 10px; }

/* skin grid */
.invgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.icard { background: #1f1d1a; border: 1px solid var(--line); border-radius: 8px; padding: 7px; text-decoration: none; display: flex; flex-direction: column; gap: 3px;
  border-bottom: 3px solid var(--tc); transition: transform .08s; }
.icard:hover { transform: translateY(-2px); box-shadow: 0 6px 16px -8px var(--tc); }
.icard.t-legendary, .icard.t-epic { box-shadow: inset 0 0 22px -12px var(--tc); }
.ic-pic { position: relative; aspect-ratio: 1; border-radius: 6px; background: radial-gradient(circle, #3e3a34, #22201d 72%); }
.ic-name { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-meta { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* hunting */
section.hunt { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; display: grid; gap: 12px; }
section.hunt.trophy { border-color: #b08a2a; }
.hunt-head { display: flex; gap: 18px; align-items: flex-start; }
.hunt-head > div:first-child { flex: 1; }
.hunt-head h2 { margin: 0 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 17px; }
.hunt-head h2 a { text-decoration: none; }
.hunt-cost { text-align: right; }
.hunt-cost .big { font-size: 22px; font-weight: 800; }

/* outfit builder */
.outfit-wrap { display: grid; grid-template-columns: 440px 1fr; gap: 20px; align-items: start; }
.doll { position: relative; display: grid; gap: 8px; padding: 14px; border-radius: 12px;
  background: radial-gradient(ellipse at 50% 40%, #34312b, #1a1917 75%); border: 1px solid var(--line);
  grid-template-columns: 1fr 1fr 1fr; grid-template-rows: repeat(5, 104px);
  grid-template-areas: "hands head weapon" "hands face weapon" "torso chest weapon" "legs kilt weapon" ". feet ."; }
.silhouette { position: absolute; left: 50%; top: 12px; height: calc(100% - 24px); transform: translateX(-50%); pointer-events: none; opacity: .9; }
.slot { position: relative; z-index: 1; }
.s-head { grid-area: head; } .s-face { grid-area: face; } .s-chest { grid-area: chest; } .s-torso { grid-area: torso; }
.s-hands { grid-area: hands; } .s-kilt { grid-area: kilt; } .s-legs { grid-area: legs; } .s-feet { grid-area: feet; }
.s-weapon { grid-area: weapon; align-self: center; height: 220px; }
.slot-pick { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 10px; text-decoration: none;
  border: 2px dashed #4a463f; background: #1c1b1966; position: relative; }
.slot.filled .slot-pick { border-style: solid; border-color: #6cc04a66; background: radial-gradient(circle, #47433c, #23211e 75%); }
.slot.notmine .slot-pick { border-color: #e0a43a88; }
.slot.active .slot-pick { border-color: var(--accent); box-shadow: 0 0 0 2px #cd412b55, 0 0 18px -6px var(--accent); }
.slot-pick img { width: 88%; height: 82%; object-fit: contain; }
.plus { font-size: 26px; color: #6b665e; }
.slot-label { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }
.slot-x { position: absolute; top: 3px; right: 5px; text-decoration: none; color: var(--dim); font-weight: 700; z-index: 2; }
.slot-x:hover { color: var(--accent); }
.slot-buy { position: absolute; top: 4px; left: 5px; font-size: 10px; font-weight: 700; background: #e0a43a; color: #111; border-radius: 3px; padding: 0 4px; z-index: 2; }
.outfit-sum { margin-top: 12px; display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.harmony .big { font-size: 22px; font-weight: 800; }
.h-perfect .big, .h-great .big { color: var(--good); } .h-good .big { color: var(--warn); } .h-clashing .big { color: var(--accent); }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-bottom: 18px; }
.pick { background: #1f1d1a; border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.pick:hover { border-color: #6b665e; }
.pick.mine { border-bottom: 3px solid var(--good); }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (max-width: 1000px) { .outfit-wrap { grid-template-columns: 1fr; } }
