: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;
  --ease: cubic-bezier(.2, .7, .2, 1); --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 500px at 50% -200px, rgba(79, 140, 255, .10), transparent 70%) no-repeat, var(--bg); -webkit-font-smoothing: antialiased; 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;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease); -webkit-tap-highlight-color: transparent; }
button:hover { filter: brightness(1.08); }
button:active { transform: scale(.97); }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); border-color: var(--muted); filter: none; }
input { font: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .22); }
select { cursor: pointer; transition: border-color .18s var(--ease); }
select:hover { border-color: var(--muted) !important; }
.hidden { display: none !important; }

header { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: rgba(23, 26, 33, .82); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.3px; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.brand { transition: opacity .18s var(--ease); } .brand:hover { opacity: .8; }
.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; }
.me { margin-left: auto; }
.acct { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.acct.signout { background: transparent; color: var(--muted); border-color: var(--line); }
.acct.signout:hover { color: var(--text); border-color: var(--muted); filter: none; }
nav button { white-space: nowrap; background: transparent; border-color: transparent; color: var(--muted); position: relative; }
nav button:hover { color: var(--text); background: rgba(255, 255, 255, .04); filter: none; }
nav button.active { color: var(--text); background: var(--panel2); border-color: var(--line); }
nav button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .25s var(--ease); }
nav button.active::after { transform: scaleX(1); }
nav::-webkit-scrollbar, .fmt::-webkit-scrollbar { display: none; }
.toolbox { position: relative; min-width: 0; }
.tb-btn { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 8px 4px 4px; border: 0; border-radius: 10px; background: none; color: var(--accent); }
.tb-btn:hover { filter: none; background: rgba(255, 255, 255, .05); }
.tb-btn:active { transform: none; }
.tb-label { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-label:empty { display: none; }
/* playbook icon: the cover swings open on its spine (3D flip) to show the pages, and swings shut again */
.tb-ic { --pb: 36px; position: relative; display: block; flex: none; width: var(--pb); height: var(--pb); perspective: calc(var(--pb) * 4); transition: transform .45s var(--ease); }
.tb-ic svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tb-ic .pb-sheet { fill: var(--panel); }
.pb-base { transition: opacity .25s var(--ease); }
.pb-cover { position: absolute; inset: 0; transform-origin: 29.17% 50%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.45, .05, .25, 1); }
.pb-front, .pb-back { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.pb-back { transform: rotateY(180deg); }
.tb-btn[aria-expanded="true"] .tb-ic { transform: translateX(calc(var(--pb) * .21)) scale(.82); }
.tb-btn[aria-expanded="true"] .pb-cover { transform: rotateY(-180deg); }
.tb-btn[aria-expanded="true"] .pb-base { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .tb-ic, .pb-cover, .pb-base { transition: none; } }
.tb-menu { position: absolute; top: calc(100% + 10px); left: 0; width: 340px; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); max-height: calc(100vh - 90px); overflow-y: auto; display: grid; gap: 2px; z-index: 20; transform-origin: top left; animation: tbIn .16s var(--ease); }
.tb-menu[hidden] { display: none; }
@keyframes tbIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.tb-head { padding: 6px 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tb-item { --tc: var(--accent); display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; border: 1px solid transparent; transition: background .15s var(--ease); }
.tb-item:hover { background: rgba(255, 255, 255, .05); }
.tb-item.active { background: color-mix(in srgb, var(--tc) 10%, transparent); border-color: color-mix(in srgb, var(--tc) 40%, transparent); }
.tb-item .tool-ic { width: 38px; height: 38px; flex: none; }
.tb-item b { display: block; font-size: 15px; }
.tb-item small { display: block; font-size: 13px; color: var(--muted); }
.fmt { transition: opacity .2s var(--ease); }
body[data-view="home"] #banner { display: none; }
body:not([data-view="trade"]):not([data-view="rankings"]) .fmt { display: none; }
.fmt { position: relative; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 18px; }
.fmt-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 12px 7px 9px; border-radius: 999px; background: var(--panel2); border-color: var(--line); color: var(--text); font-size: 14px; }
.fmt-btn:hover { filter: none; border-color: var(--muted); }
.fmt-btn[aria-expanded="true"] { border-color: var(--accent); }
.fmt-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.fmt-btn[aria-expanded="true"] svg { transform: rotate(60deg); }
.fmt-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-link { font-size: 13px; color: var(--muted); }
.calc-link:hover { color: var(--text); }
body:not([data-view="rankings"]) .calc-link, body:not([data-view="rankings"]) .calc-info { display: none; }
.calc-info { flex-basis: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; font-size: 14px; color: var(--muted); }
.calc-info p { margin: 10px 0; }
.fmt-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 15; width: 320px; max-width: calc(100vw - 32px); padding: 14px; display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: tbIn .16s var(--ease); }
.fmt-panel[hidden] { display: none; }
.fmt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.fmt-row select { width: 150px; font: inherit; font-size: 14px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
.fmt-row .seg button { padding: 6px 10px; font-size: 14px; }
.fmt-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.hs { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel2); display: inline-block; vertical-align: middle; margin: 0 8px 0 6px; }
.pname { display: flex; align-items: center; }
.pname .hs { margin-left: 0; }
.pick-ic { background: radial-gradient(circle at 50% 40%, #2a3040, #171a21 70%); }
.inj { font-size: 11px; font-weight: 600; color: var(--bad); border: 1px solid var(--bad); border-radius: 4px; padding: 0 4px; margin-left: 4px; white-space: nowrap; }
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:hover:not(.active) { color: var(--text); background: rgba(255, 255, 255, .05); filter: none; }
.seg button:active { transform: none; }
.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; }
.tab { animation: tabIn .32s var(--ease) both; }
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.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 { box-shadow: var(--shadow); animation: pop .16s var(--ease); }
.dd li { transition: background-color .12s; 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 { animation: pop .22s var(--ease); 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 0; border-radius: 4px; color: #0f1115; width: 40px; flex: none; display: inline-block; 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; }
.meter div { transition: flex-grow .4s var(--ease), width .4s var(--ease); }
.verdict { animation: pop .25s var(--ease); 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; transition: background-color .12s; }
.rank tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.bar { transition: width .4s var(--ease); }
.bar { height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; }
td.barcell { width: 22%; }

/* league */
.leagues { margin-bottom: 18px; }
.league-pick { display: flex; align-items: center; gap: 12px; max-width: 520px; }
.lp { position: relative; flex: 1; min-width: 0; }
#lpBtn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; background: var(--panel2); border-color: var(--line); color: var(--text); border-radius: 10px; }
#lpBtn:hover { filter: none; border-color: var(--muted); }
#lpBtn[aria-expanded="true"] { border-color: var(--accent); }
#lpBtn > span { flex: 1; min-width: 0; }
#lpBtn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
#lpBtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.lp b, .lp small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp small { font-size: 13px; color: var(--muted); }
#lpList { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 12; list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: tbIn .16s var(--ease); }
#lpList[hidden] { display: none; }
#lpList li { padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
#lpList li:hover, #lpList li:focus-visible { background: rgba(255, 255, 255, .05); outline: none; }
#lpList li[aria-selected="true"] { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
#userForm { flex-wrap: nowrap; max-width: 520px; }
#userForm input { flex: 1; min-width: 0; max-width: none; }
#userForm button { flex: none; }
.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.ToiletBowl { background: #3d1c1c; color: var(--bad); white-space: nowrap; }
.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); }

/* home */
.hero { position: relative; isolation: isolate; overflow: hidden; text-align: center; padding: 48px 24px; aspect-ratio: 1300 / 633; display: flex; flex-direction: column; justify-content: center; margin: 4px 0 24px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--shadow); background: #05070b; }
.hero > :not(.stadium) { position: relative; max-width: 720px; margin-left: auto; margin-right: auto; }
.hero .eyebrow { color: var(--accent); display: table; padding: 4px 12px; border-radius: 999px; background: rgba(5, 9, 16, .7); border: 1px solid rgba(79, 140, 255, .35); }
.hero .lede { color: #e6eaf0; display: table; padding: 10px 18px; border-radius: 12px; background: rgba(6, 12, 8, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .08); }
.hero h1, .hero .lede, .hero .eyebrow { text-shadow: 0 2px 18px rgba(0, 0, 0, .9); }
/* bird's-eye view of the field behind the hero */
.stadium { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: #2c5f22; }
.stadium::after { content: ""; position: absolute; inset: 0; background: radial-gradient(46% 44% at 50% 50%, rgba(3, 10, 4, .5), rgba(3, 10, 4, .08) 80%, transparent); }
.turf { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* end-zone names: the headline font, white with a thin black outline */
.turf .ez { fill: #fff; font: 800 50px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: .02em; text-anchor: middle; dominant-baseline: central;
  stroke: #000; stroke-width: .05em; stroke-linejoin: round; paint-order: stroke; }
.turf .ez tspan { fill: var(--accent); }
.turf .num { fill: #f4f6f2; font: 700 27px/1 "Archivo Narrow", Impact, sans-serif; }
.turf .mid { display: none; }
.turf .num-v { fill: #f4f6f2; fill-opacity: .9; font: 700 15px/1 "Archivo Narrow", Impact, sans-serif; text-anchor: middle; dominant-baseline: middle; }
.turf .mid circle { fill: #173d86; stroke: #f4f6f2; stroke-width: 3; }
.turf .mid text { fill: #fff; font: 800 22px/1 Inter, sans-serif; text-anchor: middle; }
.turf .mid tspan { fill: #8fb8ff; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
.hero h1 span { color: var(--accent); }
.hero .lede { margin: 16px auto 26px; max-width: 560px; font-size: 17px; }
.hero .hero-form { display: flex; gap: 8px; width: 100%; max-width: 400px; margin: 0 auto; }
.hero-form input { padding: 12px 14px; border-radius: 10px; }
.hero-form button { white-space: nowrap; padding: 12px 18px; border-radius: 10px; font-weight: 600; border-color: var(--accent); box-shadow: 0 6px 20px rgba(79, 140, 255, .3); }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 12px 0 36px; }
.tool { --tc: var(--accent); display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 14px; background: linear-gradient(180deg, var(--panel), rgba(23, 26, 33, .6)); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; position: relative; overflow: hidden; animation: tabIn .45s var(--ease) both;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease); }
.tool:nth-child(2) { animation-delay: .05s; } .tool:nth-child(3) { animation-delay: .1s; } .tool:nth-child(4) { animation-delay: .15s; }
.tool::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tc); opacity: .8; }
.tool:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tc) 55%, var(--line)); box-shadow: var(--shadow); }
.tool h2 { margin: 6px 0 0; font-size: 18px; letter-spacing: -.01em; }
.tools-head, .tool-sub { display: none; }
.tool p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.tool-ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--tc); }
.tool-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool .go { margin-top: 10px; color: var(--tc); font-weight: 600; font-size: 14px; }
.tool .go::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform .2s var(--ease); }
.tool:hover .go::after { transform: translateX(4px); }
.home-top { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 6px; }
.home-top-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.home-top h2 { margin: 0; font-size: 16px; }
.top-list { list-style: none; counter-reset: top; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); column-gap: 32px; }
.top-list li { counter-increment: top; display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.top-list li::before { content: counter(top); width: 18px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.top-list .pname { flex: 1; min-width: 0; }
.top-list .pname > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.top-list .pname a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-list b { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
#trendNote { margin-top: 4px; }
.trend-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
.trend-cols .top-list { display: block; margin-top: 4px; }
.trend-h { margin: 14px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.trend-h.up { color: var(--good); }
.trend-h.down { color: var(--bad); }
.trend-h.up::before { content: "▲ "; }
.trend-h.down::before { content: "▼ "; }
.top-list b.up, .top-list b.down { width: auto; min-width: 52px; white-space: nowrap; }
.top-list b.up { color: var(--good); }
.top-list b.down { color: var(--bad); }
.top-list li.empty { padding: 14px 0; border: 0; }
.top-list li.empty::before { content: none; }
/* League Sync: team pictures */
.tcell { display: flex; align-items: center; gap: 10px; }
.tavatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; background: var(--panel2); border: 1px solid var(--line); display: inline-grid; place-items: center; font-weight: 700; color: var(--muted); }

@media (max-width: 600px) {
  .trend-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .sides { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  header { padding: 10px 16px; gap: 10px; }
  /* phones: one header row, toolbox dead center, account button at the right */
  header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .brand { justify-self: start; font-size: 19px; }
  .brand small { font-size: 10px; letter-spacing: .1px; }
  .toolbox { justify-self: center; }
  .me { justify-self: end; margin: 0; }
  .acct { font-size: 12px; padding: 6px 10px; }
  /* nothing may push the page wider than the phone (iOS then zooms the whole site out) */
  body { overflow-x: clip; }
  .teams th, .teams td { padding-left: 4px; padding-right: 4px; }
  .teams td { overflow-wrap: anywhere; }
  .tcell { gap: 8px; }
  .tavatar { width: 30px; height: 30px; font-size: 13px; }
  .status { font-size: 11px; padding: 2px 6px; }
  .tb-ic { --pb: 32px; }
  .tb-btn { gap: 6px; }
  .tb-label { font-size: 13px; line-height: 1.15; white-space: normal; max-width: 76px; text-align: left; }
  /* phones: compact two-column tiles, scrolls if more tools are added later */
  .tb-menu { position: fixed; top: var(--tb-top, 64px); left: 12px; right: 12px; width: auto; grid-template-columns: 1fr 1fr; gap: 6px; max-height: calc(100dvh - var(--tb-top, 64px) - 16px); overflow-y: auto; overscroll-behavior: contain; }
  .tb-head { grid-column: 1 / -1; padding: 4px 6px 2px; }
  .tb-item { gap: 8px; padding: 8px; min-height: 48px; background: rgba(255, 255, 255, .03); border-color: var(--line); }
  .tb-item .tool-ic { width: 30px; height: 30px; border-radius: 8px; }
  .tb-item .tool-ic svg { width: 17px; height: 17px; }
  .tb-item b { font-size: 13px; line-height: 1.2; }
  .tb-item small { display: none; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .roster ul { columns: 1; }
  main { padding: 16px 16px 48px; }
  /* phones: the field stands up (end zones top and bottom), drawn by drawPhoneField() just tall enough for the text */
  .hero { padding: 84px 36px 124px; margin-bottom: 18px; border-radius: 14px; aspect-ratio: auto; } /* 36px keeps all text inside the white sidelines */
  .hero .eyebrow { font-size: 11px; letter-spacing: .06em; padding: 4px 10px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 40px); }
  .turf:not(.turf-v) { display: none; }
  .stadium::after { background: radial-gradient(70% 45% at 50% 50%, rgba(3, 10, 4, .5), rgba(3, 10, 4, .1) 85%, transparent); }
  .hero .lede { padding: 8px 12px; }
  .hero .lede { font-size: 14px; }
  /* stacked, slim username box and button */
  .hero .hero-form { flex-direction: column; gap: 8px; max-width: 180px; }
  .hero-form input { padding: 8px 12px; text-align: center; }
  .hero-form input::placeholder { font-size: 14px; }
  .hero-form button { padding: 8px 12px; font-size: 14px; }
  /* phones: a "Tools" heading and four small icon tiles in one row */
  .tools-head { display: flex; align-items: center; gap: 8px; margin: 4px 2px 10px; font-size: 18px; letter-spacing: -.01em; }
  .tools-head svg { width: 24px; height: 24px; fill: none; color: var(--accent); stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tools { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 24px; }
  .tool { padding: 10px 4px 9px; gap: 2px; align-items: center; text-align: center; border-radius: 10px; }
  .tool .tool-ic { width: 34px; height: 34px; border-radius: 9px; }
  .tool .tool-ic svg { width: 18px; height: 18px; }
  .tool h2 { margin: 4px 0 0; font-size: 12px; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; justify-content: center; } /* same two-line box so all labels line up */
  .tool p, .tool .go { display: none; }
  input, select { font-size: 16px !important; } /* stops iOS zooming in on focus */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* draft room: layout from Draft Buddy */
#tab-draft { --gone: #f2604c; --contested: #e9a33a; --safe: #4fc1a0; --narrow: "Archivo Narrow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#tab-draft [hidden] { display: none !important; }
.dr-setup { display: grid; place-items: center; padding: 24px 0; }
.setup-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.setup-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.lede { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.setup-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.setup-card button { margin-top: 14px; width: 100%; padding: 11px; background: var(--panel2); color: var(--text); }
.setup-card button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.draft-list { margin-top: 18px; display: grid; gap: 8px; }
.draft-list:empty { display: none; }
.setup-card .draft-option { margin: 0; text-align: left; padding: 12px; line-height: 1.4; }
.draft-option .meta { display: block; color: var(--muted); font-size: 12px; }
.manual { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.manual summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.setup-card .err { font-size: 13px; margin: 14px 0 0; }

.dr-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.bar-id { font-weight: 600; }
.bar-id .meta { margin-left: 10px; color: var(--muted); font-weight: 400; font-size: 13px; }
.bar-live { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
a.btn { background: var(--accent); color: #fff; border-radius: 8px; padding: 7px 12px; text-decoration: none; white-space: nowrap; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--safe); opacity: .35; flex: none; }
.dot.beat { opacity: 1; box-shadow: 0 0 0 4px rgba(79, 193, 160, .25); }
.dot.off { background: var(--muted); }

.dr-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 0 24px; border-bottom: 1px solid var(--line); }
.countdown { display: flex; align-items: baseline; gap: 14px; }
.countdown .big { font-family: var(--narrow); font-size: clamp(56px, 12vw, 92px); font-weight: 700; line-height: .85; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.countdown-label { color: var(--muted); font-size: 15px; max-width: 150px; line-height: 1.3; }
.dr-hero.onclock .big { color: var(--gone); }
.dr-hero.onclock .countdown-label { color: var(--gone); font-weight: 600; }
.hero-side { display: flex; gap: 32px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat span:first-child { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat.runs span:first-child { font-size: 15px; font-weight: 500; }

.dr-strip { padding: 16px 0; border-bottom: 1px solid var(--line); }
.dr-strip h2 { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; font-size: 13px; color: var(--text); }
.chip b { color: var(--safe); font-weight: 600; margin-left: 6px; }
.chip.take { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 6px; text-align: left; border-radius: 999px; }
.chip.take .hs { margin: 0 6px 0 0; }
.chip.take .pmeta { display: block; margin: 0; }
.chip.take .go { margin-left: 10px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.chip.take:first-child { border-color: var(--accent); }

.dr-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; }
.pills { display: flex; gap: 6px; }
.pill { padding: 6px 13px; background: transparent; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); }
.pill.on { background: var(--panel2); color: var(--text); border-color: var(--accent); }
.dr-controls input[type="search"] { flex: 1 1 180px; max-width: 280px; }
.dr-controls select { font: inherit; font-size: 14px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 220px; }

.dr-board th { cursor: pointer; white-space: nowrap; }
.dr-board th.sorted { color: var(--text); }
.dr-board th.num, .dr-board td.num { text-align: right; }
.dr-board th.prob { width: 30%; }
.dr-board td { font-size: 14px; }
.dr-board tr.urgent td { background: rgba(242, 96, 76, .09); }
.pname-wrap { display: flex; align-items: center; }
.pname-wrap .hs { margin-left: 0; }
.pname { font-family: var(--narrow); font-weight: 600; font-size: 15px; }
.pmeta { color: var(--muted); font-size: 12px; margin-left: 8px; }
.pname-wrap .pmeta:last-child { display: block; margin: 0; }
.val.up { color: var(--safe); }
.probwrap { display: flex; align-items: center; gap: 10px; min-width: 110px; }
.track { flex: 1; height: 7px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.fill { height: 100%; border-radius: 4px; transition: width .3s ease; }
.pct { width: 40px; text-align: right; font-weight: 600; font-size: 13px; }
.shift { font-size: 11px; font-weight: 600; cursor: help; }
.shift.down { color: var(--gone); } .shift.up { color: var(--safe); }
.flat { color: var(--line); }
.dr-foot { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dr-foot .warn { color: var(--contested); }
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
@media (max-width: 720px) {
  .dr-hero { gap: 18px; padding: 22px 0; }
  .hero-side { gap: 20px; }
  .dr-board td, .dr-board th { padding-left: 4px; padding-right: 4px; }
  .dr-board .hs { display: none; }
  .dr-board th.prob { width: auto; white-space: normal; }
  .dr-board td:first-child { word-break: break-word; }
  .probwrap { min-width: 70px; gap: 6px; }
  .pct { width: 34px; }
  .bar-id .meta { display: block; margin: 2px 0 0; }
  .dr-foot { flex-direction: column; }
  .chip.take { width: 100%; }
  .chip.take .go { margin-left: auto; }
}

/* links to player pages from the rest of the site */
a.plink { color: inherit; text-decoration: none; }
a.plink:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
