:root {
  --bg: #0b0e13;
  --surface: #131820;
  --surface-2: #1a212c;
  --surface-3: #232c3a;
  --border: #263040;
  --border-strong: #354257;
  --text: #e8ecf2;
  --text-2: #a9b3c3;
  --muted: #6f7b8e;
  --gold: #d4ad5a;
  --gold-soft: #d4ad5a22;
  --dire: #c8412f;
  --dire-soft: #c8412f1f;
  /* diverging: blue = good for you, red = bad, gray = even */
  --pos: #4c9be8;
  --neg: #e5574b;
  --even: #3a3f48;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 500px at 15% -10%, #c8412f14, transparent 60%),
    radial-gradient(900px 400px at 100% 0%, #d4ad5a0f, transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { margin: 0; }
kbd {
  font: 600 .7rem/1 Inter, system-ui, sans-serif; color: var(--text-2);
  background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 5px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  background: #0b0e13d9; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.logo { width: 34px; height: 34px; color: var(--gold); filter: drop-shadow(0 0 8px #d4ad5a55); }
.brand h1 { font: 700 1.25rem/1.1 Cinzel, Georgia, serif; letter-spacing: .06em; color: var(--gold); }
.brand p { margin: 0; font-size: .75rem; color: var(--muted); }
.status { display: flex; align-items: center; gap: .5rem; }
.pill {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: .78rem; color: var(--text-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.fresh .dot { background: #3fbf6a; box-shadow: 0 0 0 3px #3fbf6a2a; }
.pill.stale .dot { background: #e8a33d; box-shadow: 0 0 0 3px #e8a33d2a; }
.pill.busy .dot { background: var(--gold); animation: pulse 1s infinite ease-in-out; }
.pill.error .dot { background: var(--neg); }
@keyframes pulse { 50% { opacity: .3; } }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-2);
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.spinning svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.5rem; align-items: start;
  max-width: 1440px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
}
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 84px; }
@media (max-width: 960px) { .sidebar { position: static; } }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  box-shadow: 0 1px 0 #ffffff08 inset, 0 10px 30px #00000040;
}
.card h2, .results-head h2 {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2);
}
.card > h2 { margin-bottom: .75rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.text-btn { background: none; border: 0; padding: 0; font-size: .78rem; color: var(--muted); }
.text-btn:hover { color: var(--text); }
.sub { margin: 0 0 .25rem; font-size: .78rem; color: var(--muted); }

/* ---------- positions ---------- */
.positions { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.positions button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem;
  padding: .6rem .2rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: border-color .15s, background .15s, color .15s;
}
.positions button:hover { border-color: var(--border-strong); color: var(--text); }
.positions svg { width: 20px; height: 20px; }
.positions .num { position: absolute; top: 3px; left: 6px; font-size: .62rem; font-weight: 700; color: var(--muted); }
.positions .lbl { font-size: .68rem; font-weight: 600; white-space: nowrap; }
.positions button[aria-checked="true"] {
  border-color: var(--gold); color: var(--gold); background: var(--gold-soft);
  box-shadow: 0 0 0 1px var(--gold) inset, 0 0 18px #d4ad5a2a;
}
.positions button[aria-checked="true"] .num { color: var(--gold); }

/* ---------- hero slots ---------- */
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .75rem; }
.enemy-card { border-color: #c8412f40; background: linear-gradient(180deg, #2a1a1c, var(--surface) 70%); }
.enemy-card h2 { color: #f08a7c; }
.slot {
  position: relative; aspect-ratio: 16 / 10; padding: 0; overflow: hidden;
  border-radius: 6px; border: 1px dashed #c8412f55; background: #c8412f0d;
  display: grid; place-items: center; color: #c8412f88; font-weight: 700; font-size: .8rem;
}
.slot.filled { border: 1px solid #c8412f99; cursor: pointer; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .name {
  position: absolute; inset: auto 0 0 0; padding: 8px 3px 2px; font-size: .6rem; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, #000c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot.filled::after {
  content: "✕"; position: absolute; inset: 0; display: grid; place-items: center;
  background: #0b0e13b3; color: var(--neg); font-size: 1rem; opacity: 0; transition: opacity .12s;
}
.slot.filled:hover::after { opacity: 1; }
.slots.small { grid-template-columns: repeat(5, 1fr); }
.slots.small:empty { display: none; }
.slots.small .slot { border-color: var(--border-strong); background: var(--surface); filter: grayscale(.7); }

/* ---------- search ---------- */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: .7rem; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .65rem .75rem .65rem 2.2rem;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem;
  list-style: none; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  max-height: 340px; overflow-y: auto; box-shadow: 0 16px 40px #000a;
}
.suggest li { display: flex; align-items: center; gap: .6rem; padding: .35rem .45rem; border-radius: 6px; cursor: pointer; font-weight: 500; }
.suggest li img { width: 48px; height: 27px; object-fit: cover; border-radius: 4px; }
.suggest li.active { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--gold); }
.suggest li:hover { background: var(--surface-3); }
.keys { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .65rem; font-size: .72rem; color: var(--muted); }

/* ---------- folds ---------- */
.fold { padding: .8rem 1rem; }
.fold summary { display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s;
}
.fold[open] summary::after { transform: rotate(45deg); }
.fold[open] summary { margin-bottom: .75rem; }
.count { font-size: .7rem; font-weight: 700; color: var(--bg); background: var(--text-2); border-radius: 999px; padding: 0 .45rem; }
.count:empty { display: none; }
.range { display: grid; grid-template-columns: 1fr auto; gap: .35rem; margin-bottom: .8rem; font-size: .8rem; color: var(--text-2); }
.range output { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.range input { grid-column: 1 / -1; accent-color: var(--gold); }

/* ---------- results ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.results-head h2 { font-size: 1.05rem; letter-spacing: .02em; text-transform: none; color: var(--text); font-weight: 600; }
.results-head h2 em { font-style: normal; color: var(--gold); }
.legend { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--muted); }
.sw { display: inline-block; width: 18px; height: 8px; border-radius: 2px; margin-left: .4rem; }
.sw.neg { background: var(--neg); } .sw.mid { background: var(--even); } .sw.pos { background: var(--pos); }

/* featured top 3 */
.featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1200px) { .featured { grid-template-columns: 1fr; } }
.feat {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); padding: 1rem; display: flex; flex-direction: column; gap: .8rem;
  box-shadow: 0 10px 30px #00000050;
}
.feat::before {
  content: ""; position: absolute; inset: -20px; z-index: 0;
  background: var(--img) center / cover; filter: blur(28px) saturate(1.3); opacity: .35;
}
.feat::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, #13182066, var(--surface) 75%); }
.feat > * { position: relative; z-index: 1; }
.feat.rank-1 { border-color: #d4ad5a88; box-shadow: 0 0 0 1px #d4ad5a44, 0 12px 36px #d4ad5a1a; }
.feat-top { display: flex; gap: .85rem; align-items: center; }
.feat-top img { width: 112px; height: 63px; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 18px #000a; flex: none; }
.feat-name { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.feat-rank { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.feat-score { margin-left: auto; text-align: right; }
.feat-score b { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.feat-score small { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.stat { background: #0b0e1399; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .55rem; }
.stat small { display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat b { font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feat .chips { gap: .3rem; }

/* list rows */
.list { display: flex; flex-direction: column; gap: .4rem; }
.list-head, .row {
  display: grid; align-items: center; gap: .9rem;
  grid-template-columns: 2rem 64px minmax(130px, 1.2fr) 150px 62px 62px 74px minmax(220px, 2.2fr);
}
.list.no-player .list-head, .list.no-player .row {
  grid-template-columns: 2rem 64px minmax(130px, 1.2fr) 150px 62px 62px minmax(220px, 2.2fr);
}
.list.no-player .col-you { display: none; }
.list-head {
  padding: 0 .9rem .25rem; font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.row {
  padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface);
  transition: border-color .12s, background .12s;
}
.row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.rank { font-size: .8rem; font-weight: 700; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.row > img { width: 64px; height: 36px; object-fit: cover; border-radius: 5px; }
.hero-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-name small { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num small { color: var(--muted); font-size: .72rem; }
.up { color: #8cc4f5; } .down { color: #f2958b; } .flat { color: var(--text-2); }

/* diverging score bar */
.scorebar { display: grid; grid-template-columns: 1fr 3.4rem; align-items: center; gap: .5rem; }
.scorebar .track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.scorebar .track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.scorebar .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.scorebar .fill.pos { left: 50%; background: var(--pos); }
.scorebar .fill.neg { right: 50%; background: var(--neg); }
.scorebar b { text-align: right; font-variant-numeric: tabular-nums; }

/* share meter */
.meter { display: flex; flex-direction: column; gap: 3px; }
.meter .bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--text-2); border-radius: 2px; }

/* matchup chips */
.chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: 2px 7px 2px 2px; border-radius: 5px;
  font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
  background: var(--chip, var(--even)); border: 1px solid #ffffff10;
}
.chip img { width: 30px; height: 17px; object-fit: cover; border-radius: 3px; }
.no-enemies { font-size: .78rem; color: var(--muted); }

@media (max-width: 1100px) {
  .list-head { display: none; }
  .row { grid-template-columns: 1.5rem 64px 1fr 120px; }
  .row .col-opt { display: none; }
  .row .chips { grid-column: 2 / -1; }
}

.empty, .banner { color: var(--text-2); text-align: center; padding: 2rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.banner { text-align: left; padding: .7rem 1rem; margin-bottom: 1rem; font-size: .82rem; background: var(--surface); border-style: solid; }
.banner b { color: var(--gold); }

/* ---------- player ---------- */
.player-form { display: flex; gap: .4rem; }
.player-form input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .6rem .7rem;
}
.player-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.btn {
  border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold);
  border-radius: var(--radius-sm); padding: 0 .9rem; font-weight: 600;
}
.btn:hover { background: #d4ad5a33; }
.btn:disabled { opacity: .5; cursor: progress; }
.player-info { display: flex; align-items: center; gap: .75rem; }
.player-info img { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--border-strong); }
.player-info b { display: block; font-size: 1rem; }
.player-info small { color: var(--muted); font-size: .75rem; }
.player-error { margin: .5rem 0 0; font-size: .78rem; color: #f2958b; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: .8rem; padding: 3px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.seg button { border: 0; background: none; color: var(--text-2); padding: .4rem; border-radius: 6px; font-size: .8rem; font-weight: 600; }
.seg button[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px #0006; }

/* predicted enemy role badge */
.slot .role {
  position: absolute; top: 2px; left: 2px; z-index: 1; padding: 0 4px; border-radius: 3px;
  background: #000b; color: #fff; font-size: .58rem; font-weight: 700; line-height: 1.5;
}
.slot .role.lane { background: var(--gold); color: #1a1406; }

/* lane opponent chip */
.chip.lane { box-shadow: 0 0 0 1.5px var(--gold); }
.chip .lane-tag { font-size: .6rem; font-weight: 700; color: var(--gold); letter-spacing: .04em; }
.you small { display: block; }

/* ---------- rank, player options ---------- */
.rank-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .75rem; font-size: .8rem; color: var(--text-2); font-weight: 600; }
.rank-row select {
  flex: 1; max-width: 200px; font: inherit; font-weight: 500; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .4rem .5rem;
}
.rank-row select:focus { outline: none; border-color: var(--gold); }
.player-options { display: flex; flex-direction: column; gap: .4rem; margin-top: .8rem; }
.player-options .seg { margin-top: 0; }

/* ---------- danger + avoid ---------- */
.danger {
  display: inline-flex; align-items: center; gap: .25rem; margin-left: .45rem; padding: 0 .4rem; border-radius: 4px;
  font-size: .68rem; font-weight: 700; vertical-align: 1px; color: #ffb4ab; background: #e5574b26; border: 1px solid #e5574b55;
}
.danger svg { width: 11px; height: 11px; }
.feat .danger { margin: 0; align-self: flex-start; }
.avoid {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: -.25rem 0 1.25rem; padding: .55rem .75rem;
  border: 1px solid #e5574b40; border-radius: var(--radius); background: linear-gradient(90deg, #e5574b14, transparent 60%);
}
.avoid-label { display: inline-flex; align-items: center; gap: .35rem; margin-right: .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f2958b; }
.avoid-label svg { width: 14px; height: 14px; }
.avoid-hero { display: inline-flex; align-items: center; gap: .35rem; padding: 2px 8px 2px 2px; border-radius: 5px; background: var(--surface-2); font-size: .78rem; font-weight: 600; }
.avoid-hero img { width: 34px; height: 19px; object-fit: cover; border-radius: 3px; filter: saturate(.5); }
.avoid-hero b { color: #f2958b; font-variant-numeric: tabular-nums; }

/* ---------- trend ---------- */
.trend { margin-left: .3rem; font-size: .66rem; font-weight: 700; }

/* ---------- breakdown / expandable rows ---------- */
.row-wrap { border-radius: var(--radius-sm); }
.row { cursor: pointer; }
.row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.row-wrap.open .row { border-color: var(--border-strong); background: var(--surface-2); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.detail {
  display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1.25rem; padding: .9rem 1rem 1rem;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }
.breakdown { display: flex; flex-direction: column; gap: .35rem; }
.part { display: grid; grid-template-columns: 4.6rem 1fr 3rem; align-items: center; gap: .5rem; font-size: .76rem; color: var(--text-2); }
.part .track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); }
.part .track::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.part .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.part .fill.pos { left: 50%; background: var(--pos); }
.part .fill.neg { right: 50%; background: var(--neg); }
.part b { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown.compact { padding: .5rem .6rem; background: #0b0e1399; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.detail-info { font-size: .8rem; color: var(--text-2); min-width: 0; }
.detail-info p { margin: 0 0 .4rem; }
.vs-table { width: 100%; border-collapse: collapse; margin-top: .4rem; font-size: .76rem; }
.vs-table th { text-align: left; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .25rem .4rem; border-bottom: 1px solid var(--border); }
.vs-table th.num { text-align: right; }
.vs-table td { padding: .25rem .4rem; border-bottom: 1px solid #ffffff08; }
.vs-table td img { width: 28px; height: 16px; object-fit: cover; border-radius: 3px; vertical-align: middle; margin-right: .4rem; }

/* ---------- clickable cards ---------- */
.feat { cursor: pointer; transition: transform .12s, border-color .12s; }
.feat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.feat:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- hero drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: #05070acc; backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); overflow-y: auto; outline: none;
  background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -20px 0 60px #000a;
  animation: slide .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
body.drawer-open { overflow: hidden; }
.drawer-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
  background: linear-gradient(90deg, #131820f2, #131820cc), var(--img) center / cover; border-bottom: 1px solid var(--border);
}
.drawer-head > img { width: 128px; height: 72px; border-radius: 8px; box-shadow: 0 6px 18px #000a; }
.drawer-head h3 { margin: 0; font-size: 1.4rem; }
.drawer-head .feat-score { margin-left: auto; }
.drawer-head .close { flex: none; font-size: .9rem; }
.drawer-sec { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.drawer-sec h4 { margin: 1rem 0 .5rem; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.drawer-sec h4:first-child { margin-top: 0; }
.drawer-sec h4 .sub { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: .3rem; }
.drawer-sec .sub { color: var(--muted); font-size: .8rem; margin: 0 0 .5rem; }
.drawer-sec .detail { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.drawer-sec .danger { margin: .6rem 0 0; }

.items { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .45rem; }
.item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.item img { width: 48px; height: 35px; object-fit: cover; border-radius: 4px; border: 1px solid #ffffff14; box-shadow: 0 2px 6px #0007; }
.item small { font-size: .68rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.items.timeline .arrow { align-self: center; margin-top: -14px; color: var(--muted); font-size: 1.1rem; }

.grid-scroll { overflow-x: auto; padding-bottom: .25rem; }
.skill-grid { display: grid; grid-template-columns: minmax(150px, 1fr) repeat(var(--cols), 26px); gap: 3px; font-size: .72rem; min-width: max-content; }
.sg-lvl { text-align: center; color: var(--muted); font-weight: 600; }
.sg-name { display: flex; align-items: center; gap: .4rem; padding-right: .5rem; white-space: nowrap; overflow: hidden; color: var(--text-2); }
.sg-name span { overflow: hidden; text-overflow: ellipsis; }
.sg-name img, .talent-ico { width: 22px; height: 22px; border-radius: 4px; flex: none; }
.talent-ico { display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: .7rem; }
.sg-cell { height: 26px; border-radius: 4px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .7rem; }
.sg-cell.hit { background: var(--gold); color: #1a1406; }

.talents { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.talents li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .6rem; background: var(--surface-2); border-radius: 6px; font-size: .8rem; }
.talents b { color: var(--gold); font-variant-numeric: tabular-nums; }
.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.matches li { display: grid; grid-template-columns: minmax(90px, 1fr) auto; gap: .2rem .75rem; align-items: center; padding: .4rem .6rem; background: var(--surface-2); border-radius: 6px; font-size: .8rem; }
.matches a { color: var(--text); font-weight: 600; text-decoration: none; }
.matches a:hover { color: var(--gold); text-decoration: underline; }
.matches .sub { margin: 0; text-align: right; }
.mini-items { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 3px; }
.mini-items img { width: 33px; height: 24px; object-fit: cover; border-radius: 3px; }
.build-loading { display: flex; align-items: center; gap: .6rem; color: var(--text-2); padding: 1rem 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--gold); animation: spin .8s linear infinite; }
.vs-table td:first-child { white-space: nowrap; }
.drawer .detail { grid-template-columns: minmax(200px, 240px) 1fr; }
@media (max-width: 640px) { .drawer .detail { grid-template-columns: 1fr; } }
.drawer-panel { overflow-x: hidden; }
.detail-info { overflow-x: auto; }

/* ---------- drawer: graphical score details ---------- */
.mus { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .7rem; }
.mu { display: grid; grid-template-columns: 52px 1fr 2.8rem; align-items: center; gap: .6rem; }
.mu-hero { position: relative; width: 52px; height: 29px; }
.mu-hero img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.mu-hero i {
  position: absolute; left: 1px; top: 1px; padding: 0 3px; border-radius: 3px; font-style: normal;
  font-size: .56rem; font-weight: 700; line-height: 1.5; background: #000b; color: #fff;
}
.mu.lane .mu-hero img { box-shadow: 0 0 0 2px var(--gold); }
.mu.lane .mu-hero i { background: var(--gold); color: #1a1406; }
.mu .track { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); }
.mu .track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.mu .fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.mu .fill.pos { left: 50%; background: var(--pos); }
.mu .fill.neg { right: 50%; background: var(--neg); }
.mu b { text-align: right; font-variant-numeric: tabular-nums; font-size: .82rem; }
.pill-stats { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-stat {
  display: inline-flex; flex-direction: column; padding: .3rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); cursor: help;
}
.pill-stat small { font-size: .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pill-stat b { font-size: .9rem; font-variant-numeric: tabular-nums; }
.pill-stat.warn { border-color: #e8a33d66; background: #e8a33d14; }
.pill-stat.warn b { color: #f0bd6a; }
.hero-name .danger { display: flex; width: max-content; max-width: 100%; margin: 3px 0 0; }
