:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a;
  --text: #e8eaee; --muted: #8b93a3; --accent: #4f8cff; --good: #2fbf71; --bad: #ef5b5b; --warn: #e3a72f;
  --QB: #e05a7a; --RB: #2fbf9f; --WR: #4f8cff; --TE: #e3a72f; --PICK: #9a7cf0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 14px; }
button.ghost { background: transparent; color: var(--muted); }
input { font: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%; }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hidden { display: none !important; }

header { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.brand span { color: var(--accent); }
.brand small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .3px; color: var(--muted); margin-top: -2px; }
nav { display: flex; gap: 4px; flex: 1; }
nav button { white-space: nowrap; background: transparent; border-color: transparent; color: var(--muted); }
nav button.active { color: var(--text); background: var(--panel2); border-color: var(--line); }
.fmt { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.fmt select { width: auto; font: inherit; font-size: 14px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-size: inherit; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 7px 12px; }
.seg button.active { background: var(--accent); color: #fff; }
.chk { display: flex; gap: 6px; align-items: center; color: var(--muted); white-space: nowrap; }
.chk input { width: auto; }

.banner { background: #3a2f12; color: #f5d68a; border-bottom: 1px solid #5a4818; padding: 8px 20px; font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.note { color: var(--muted); font-size: 13px; }
.actions { margin: 12px 0; display: flex; gap: 8px; }

/* trade calc */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-height: 260px; }
.side h2 { margin: 0 0 10px; font-size: 16px; }
.search { position: relative; }
.dd { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; z-index: 4; max-height: 320px; overflow: auto; }
.dd:empty { display: none; }
.dd li { padding: 7px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.dd li.sel, .dd li:hover { background: var(--line); }
.assets { list-style: none; padding: 0; margin: 12px 0; }
.assets li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; background: var(--panel2); margin-bottom: 6px; }
.assets .x { margin-left: auto; background: transparent; border: 0; color: var(--muted); padding: 0 4px; font-size: 18px; line-height: 1; }
.assets .v, .dd .v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.assets .x { margin-left: 4px; }
.pos { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; color: #0f1115; min-width: 34px; text-align: center; }
.pos.QB { background: var(--QB); } .pos.RB { background: var(--RB); } .pos.WR { background: var(--WR); } .pos.TE { background: var(--TE); } .pos.PICK { background: var(--PICK); }
.sub { color: var(--muted); font-size: 12px; }
.sidetotal { border-top: 1px solid var(--line); padding-top: 10px; display: flex; justify-content: space-between; color: var(--muted); }
.sidetotal b { color: var(--text); font-size: 20px; font-variant-numeric: tabular-nums; }
.verdict { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.verdict:empty { display: none; }
.verdict h3 { margin: 0 0 8px; }
.meter { height: 10px; border-radius: 5px; background: var(--panel2); display: flex; overflow: hidden; margin: 10px 0; }
.meter div:first-child { background: var(--accent); } .meter div:last-child { background: var(--PICK); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggest button { background: var(--panel2); color: var(--text); padding: 5px 10px; font-size: 13px; }

/* rankings */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { max-width: 280px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; }
td.barcell { width: 22%; }
.add { background: transparent; color: var(--muted); padding: 2px 8px; font-size: 12px; }

/* league */
.leagues { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.leagues button { background: var(--panel); text-align: left; padding: 12px; color: var(--text); }
.leagues button.active { border-color: var(--accent); }
.leagues .sub { display: block; }
.status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.status.Contender { background: #143a28; color: var(--good); }
.status.Rebuilder { background: #3d1c1c; color: var(--bad); }
.status.Middle { background: #3a2f12; color: var(--warn); }
.teams tr.team { cursor: pointer; }
.teams tr.team:hover td { background: var(--panel); }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--panel2); min-width: 120px; }
.stack div { height: 100%; }
.roster td { background: var(--panel); }
.roster ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.roster li { display: flex; gap: 8px; align-items: center; padding: 3px 0; break-inside: avoid; }
.roster li .v { margin-left: auto; color: var(--muted); }
.roster li.starter b { color: var(--good); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin: 6px 0 14px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.err { color: var(--bad); }

@media (max-width: 720px) {
  .sides { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .roster ul { columns: 1; }
  header { padding: 12px 16px; }
}
