:root {
  --bg: #0a0b0e;
  --surface: #121419;
  --raised: #191c22;
  --hover: #1e2129;
  --line: #22262e;
  --line-2: #323743;
  --ink: #f3f1ec;
  --ink-2: #b6bac3;
  --muted: #7a7f8a;
  --gold: #e2b75a;
  --gold-2: #f0cd7f;
  --gold-soft: rgba(226, 183, 90, .09);
  --up: #3dd68c;
  --down: #ff6b61;
  --live: #ff4d5e;
  --r: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(900px 420px at 50% -180px, rgba(226, 183, 90, .12), transparent 70%) no-repeat, var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.gold { color: var(--gold); }
.neg { color: var(--down); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 11, 14, .8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-stretch: 112%; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.nav { display: flex; gap: 20px; align-self: stretch; }
.nav a {
  display: flex; align-items: center; padding-top: 2px; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.score { margin-left: auto; display: grid; text-align: right; line-height: 1.1; }
.score-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.score-value { font-size: 21px; font-weight: 800; font-stretch: 108%; letter-spacing: -.01em; }
.score-value.up { color: var(--up); }
.score-value.down { color: var(--down); }

main.wrap { padding-top: 44px; padding-bottom: 64px; min-height: 70vh; }

/* Type */
h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.1; font-weight: 800; font-stretch: 110%; letter-spacing: -.02em; }
.kicker { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.lede { margin: 0 0 24px; color: var(--ink-2); }
.lede b { color: var(--ink); font-weight: 700; }
.lede .gold { color: var(--gold); }
.note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.loading, .empty { color: var(--ink-2); padding: 48px 0; text-align: center; }
.empty a { color: var(--gold); }
.notice { margin: 0; padding: 18px 20px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.error { margin: 0 0 20px; padding: 10px 14px; font-size: 14px; color: #ffd3cf; background: rgba(255, 107, 97, .08); border: 1px solid rgba(255, 107, 97, .3); border-radius: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; color: var(--muted); font-size: 14px; font-weight: 600; transition: color .15s; }
.back::before { content: '←'; }
.back:hover { color: var(--ink); }
h2.sub { margin: 36px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 16px; border: 1px solid var(--gold); border-radius: 999px; background: var(--gold); color: #17130a;
  font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn:active { transform: scale(.98); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-line:hover { background: var(--raised); border-color: var(--muted); }
.btn-big { width: 100%; padding: 14px 22px; font-size: 16px; }
.btn[disabled] { opacity: .4; cursor: default; transform: none; }
.actions { display: grid; gap: 10px; margin-top: 20px; }
.actions.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.why { display: block; font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; }
.actions .why { padding: 14px 16px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.linkish { padding: 0; border: 0; background: none; color: var(--muted); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--ink); }

/* Faces and logos */
.face {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  object-fit: cover; object-position: top; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2);
}
.face-fallback { display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.face-xs { width: 26px; height: 26px; font-size: 11px; }
.face-sm { width: 30px; height: 30px; font-size: 12px; }
.face-lg { width: 68px; height: 68px; font-size: 24px; }
.face-xl { width: 92px; height: 92px; font-size: 32px; }
.logo { width: 24px; height: 24px; flex: none; object-fit: contain; }
.logo-sm { width: 20px; height: 20px; }
.logo-xs { width: 16px; height: 16px; }

/* Landing */
.landing { padding-top: 16px; }
.landing h1 { font-size: 46px; max-width: 520px; }
.fixtures { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.fixture {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.fx-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 18px; font-weight: 800; font-stretch: 108%; }
.fx-team .logo { width: 32px; height: 32px; }
.fx-team.r { justify-content: flex-end; }
.fx-mid { display: grid; text-align: center; font-size: 12.5px; line-height: 1.35; }
.fx-time { font-weight: 700; color: var(--ink); font-size: 13.5px; }

/* Draft */
.steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.step a { display: grid; gap: 1px; min-width: 0; padding-top: 10px; border-top: 3px solid var(--line-2); font-size: 12px; transition: border-color .2s; }
.step-role { font-weight: 700; color: var(--muted); }
.step-pick { min-height: 18px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done a { border-top-color: var(--gold); }
.step.now a { border-top-color: var(--ink); }
.step.now .step-role { color: var(--ink); }

.duel { margin-bottom: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.duel-head { display: flex; justify-content: space-between; margin: 0 4px 12px; font-size: 13px; color: var(--muted); }
.duel-head span:first-child { color: var(--ink-2); font-weight: 600; }
.duel-opts { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.duel-side { display: grid; gap: 8px; min-width: 0; }
.duel-vs { font-size: 12px; font-weight: 700; color: var(--muted); }
.opt {
  display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 18px 10px 14px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.opt:hover { background: var(--hover); border-color: var(--line-2); }
.opt:active { transform: scale(.98); }
.opt.on { background: var(--gold-soft); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.opt.none { justify-content: center; min-height: 120px; color: var(--muted); font-weight: 700; cursor: default; }
.opt-name { max-width: 100%; margin-top: 10px; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-team { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.opt-chance { font-size: 12px; color: var(--muted); }
.opt-value { margin-top: 8px; font-weight: 700; color: var(--gold); }

/* Rows: your team, the draft review, standings */
.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: 100%; padding: 12px 16px 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: background .15s, border-color .15s;
}
a.row:hover, button.row:hover { background: var(--raised); border-color: var(--line-2); cursor: pointer; }
.row.live { border-color: rgba(255, 77, 94, .35); }
.row.empty { background: transparent; border-style: dashed; border-color: var(--line-2); }
.row-main { display: grid; min-width: 0; }
.row-role { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: .05em; text-transform: uppercase; }
.row.empty .row-role { color: var(--muted); }
.row-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.row-val { display: grid; justify-items: end; gap: 1px; font-weight: 700; }
.plus { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px dashed var(--line-2); border-radius: 50%; color: var(--muted); font-size: 20px; }

.delta { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }
.delta.flat::before { content: '±'; }
.st.live { display: inline-flex; align-items: center; gap: 5px; color: var(--live); font-weight: 700; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Player */
.player-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.player-head h1 { margin: 0; font-size: 36px; }
.player-team { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 600; color: var(--ink-2); }
.panel { display: grid; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.player-value { gap: 6px; }
.player-value b { font-size: 36px; font-weight: 800; font-stretch: 108%; color: var(--gold); letter-spacing: -.01em; }
.player-since { font-size: 14px; color: var(--ink-2); }
.player-next { padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.live-now { font-size: 14px; color: var(--ink-2); }
.scroll { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th { padding: 8px 10px 8px 0; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
.history td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.history .r { text-align: right; }
.history th:last-child, .history td:last-child { padding-right: 0; }

/* Game chips and ratings */
.games { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 2px 0 2px; line-height: 22px; white-space: nowrap;
  font-size: 12px; color: var(--ink-2); background: var(--raised); border: 1px solid var(--line); border-radius: 6px;
}
.gchip .champ { width: 18px; height: 18px; border-radius: 4px; }
.gchip .res { font-weight: 700; }
.gchip .res.w { color: var(--up); }
.gchip .res.l { color: var(--down); }
.gchip.live .res { color: var(--live); }
.rate { display: inline-block; min-width: 30px; padding: 0 5px; border-radius: 5px; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; color: #fff; }
.rate.good { background: #1f9a57; }
.rate.ok { background: #7ea52f; }
.rate.meh { background: #c98f17; }
.rate.bad { background: #cf4238; }

/* Market */
.group { margin-bottom: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.group-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; font-weight: 800; }
.group-head .dim { margin-left: auto; font-size: 13px; font-weight: 500; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 96px; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.mrow-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mrow-who:hover .row-name { text-decoration: underline; text-underline-offset: 3px; }
.mrow-val { font-weight: 700; color: var(--gold); }
.mrow-act { display: flex; justify-content: flex-end; }
.mrow-act .btn { min-width: 72px; }

/* Leagues */
.league-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.league-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: background .15s, border-color .15s;
}
.league-list a:hover { background: var(--raised); border-color: var(--line-2); }
.panel h2 { margin: 0; font-size: 18px; font-weight: 800; }
.panel-actions { display: flex; gap: 10px; }
.panel-actions .btn { padding: 10px 20px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input {
  padding: 12px 14px; font-size: 16px; font-weight: 400; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; outline: 0; transition: border-color .15s;
}
.field input:focus { border-color: var(--gold); }
.invite { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 24px; color: var(--ink-2); }
.code { margin-left: 6px; padding: 2px 8px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; letter-spacing: .08em; color: var(--ink); background: var(--raised); border: 1px solid var(--line-2); border-radius: 6px; }
.row.standing { grid-template-columns: 28px minmax(0, 1fr) auto; }
.row.standing.mine { border-color: rgba(226, 183, 90, .45); background: var(--gold-soft); }
.rank { font-weight: 800; color: var(--muted); text-align: center; }
.faces { display: flex; margin-top: 4px; }
.faces .face { margin-right: -6px; box-shadow: 0 0 0 2px var(--surface); }
.score-up { color: var(--up); font-size: 17px; }
.score-down { color: var(--down); font-size: 17px; }
.score-flat { color: var(--ink-2); font-size: 17px; }
.mini { display: grid; gap: 6px; margin: -2px 0 6px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.mini-slot { display: grid; grid-template-columns: 58px 30px minmax(0, 1fr) auto 48px; align-items: center; gap: 10px; font-size: 14px; }
.mini-slot .delta { text-align: right; }
.mini-role { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.mini-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .note { margin: 4px 0 0; }

/* Rules */
.rules h2 { margin: 36px 0 10px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.rules p, .rules li { color: var(--ink-2); }
.rules b { color: var(--ink); font-weight: 700; }
.rules ol { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 8px; }
.rules li::marker { color: var(--gold); font-weight: 700; }
.paytable { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.paytable td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.paytable tr:last-child td { border-bottom: 0; }
.paytable td:last-child { text-align: right; font-weight: 700; color: var(--ink); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; max-width: calc(100vw - 32px);
  padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--raised); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { padding-top: 20px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.foot p { margin: 0 0 6px; }

/* Phones */
@media (max-width: 560px) {
  .top-inner { gap: 18px; }
  .brand-name { display: none; }
  .nav { gap: 16px; }
  main.wrap { padding-top: 32px; }
  h1 { font-size: 27px; }
  .landing { padding-top: 0; }
  .landing h1 { font-size: 36px; }
  .fixture { padding: 14px 16px; }
  .fx-team { font-size: 16px; gap: 8px; }
  .fx-team .logo { width: 26px; height: 26px; }
  .duel { padding: 10px; }
  .duel-opts { gap: 6px; }
  .opt { padding: 14px 6px 12px; }
  .opt-name { font-size: 15px; }
  .face-lg { width: 58px; height: 58px; }
  .row { gap: 12px; padding: 12px 14px 12px 12px; }
  .player-head h1 { font-size: 30px; }
  .face-xl { width: 76px; height: 76px; }
  .row-team { display: none; }
  .mrow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 10px 12px; }
  .mrow-act .btn { min-width: 0; }
  .actions.two { grid-template-columns: minmax(0, 1fr); }
  .mini-slot { grid-template-columns: 30px minmax(0, 1fr) auto 44px; }
  .mini-role { display: none; }
  .mini-name .dim { display: none; }
}
