:root {
  --bg: #07170f; --bg2: #0c2318; --card: #10301f; --card2: #143a26; --line: #1f4d33;
  --gold: #e3b448; --gold2: #f5d27a; --green: #3ddc84; --red: #ff6b6b; --text: #eef5ef; --mute: #9fb8a8;
  --augusta: #006747; --yellow: #ffd23f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Montserrat', system-ui, sans-serif; }
a { color: var(--gold2); text-decoration: none; }
button { font-family: inherit; }
.serif { font-family: 'Playfair Display', Georgia, serif; }

header.top { display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; background: linear-gradient(180deg, #0a2a1a, #06180f); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 50; flex-wrap: wrap; }
header.top .brand { font-family: 'Playfair Display', Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--gold2); white-space: nowrap; }
header.top .brand small { display: block; font-family: 'Montserrat'; font-size: .62rem; letter-spacing: .25em; color: var(--mute); text-transform: uppercase; }
nav.tabs { display: flex; gap: .3rem; flex-wrap: wrap; flex: 1; }
nav.tabs a { padding: .42rem .85rem; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .86rem; }
nav.tabs a.on { background: var(--gold); color: #06180f; }
nav.tabs a:hover:not(.on) { background: var(--card2); }
.sync { font-size: .75rem; color: var(--mute); white-space: nowrap; }
.sync .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.sync.bad .dot { background: var(--red); }
body.tv header.top { display: none; }

main { padding: 1rem; max-width: 1700px; margin: 0 auto; }
body.tv main { max-width: none; padding: .8rem 1.2rem; }
h1, h2, h3 { margin: .2rem 0 .6rem; }
h2.sec { font-family: 'Playfair Display', Georgia, serif; color: var(--gold2); font-size: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.mute { color: var(--mute); }
.small { font-size: .8rem; }
.grid { display: grid; gap: .9rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.gteams { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.card h3 { font-size: 1rem; color: var(--gold2); letter-spacing: .04em; text-transform: uppercase; }
.kicker { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.pos { color: var(--green); } .neg { color: var(--red); } .gold { color: var(--gold2); }
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--card2); border: 1px solid var(--line); }
.pill.cut { background: #4a1414; border-color: #7a2323; color: #ffb3b3; }
.pill.live { background: #123d2a; border-color: var(--green); color: var(--green); }
.pill.gold { background: #3b2f0e; border-color: var(--gold); color: var(--gold2); }
.flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; vertical-align: -2px; margin-right: 5px; }

table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th { text-align: left; color: var(--mute); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
table.t td { padding: .38rem .4rem; border-bottom: 1px solid rgba(31,77,51,.5); }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: rgba(227,180,72,.06); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.counted { background: rgba(61,220,132,.16); font-weight: 700; color: #b8ffd6; }
td.fill { color: var(--mute); font-style: italic; }
.big { font-size: 2.2rem; font-weight: 800; }

.btn { background: var(--augusta); color: #fff; border: 1px solid #0b8a5f; border-radius: 8px; padding: .5rem .9rem; font-weight: 700; cursor: pointer; font-size: .88rem; }
.btn:hover { filter: brightness(1.15); }
.btn.gold { background: var(--gold); color: #1b1300; border-color: var(--gold2); }
.btn.red { background: #8b1d1d; border-color: #b33; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.sm { padding: .3rem .6rem; font-size: .78rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { background: #061109; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; font-family: inherit; font-size: .9rem; }
textarea { width: 100%; min-height: 120px; }
label.f { display: block; font-size: .75rem; color: var(--mute); margin: .4rem 0 .15rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.subtabs { display: flex; gap: .3rem; margin-bottom: .8rem; flex-wrap: wrap; }
.subtabs button { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; cursor: pointer; font-weight: 600; }
.subtabs button.on { background: var(--gold); color: #1b1300; }
.notice { background: #2a2108; border: 1px solid var(--gold); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .8rem; font-size: .9rem; }
.err { background: #3a1010; border-color: var(--red); }

/* ---------- draft board ---------- */
.onclock { display: flex; gap: .4rem; overflow-x: auto; padding: .3rem 0 .6rem; }
.onclock .chip { padding: .3rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; font-size: .82rem; font-weight: 600; }
.onclock .chip.now { background: var(--gold); color: #1b1300; border-color: var(--gold2); }
.onclock .chip.full { opacity: .4; text-decoration: line-through; }
.draft-layout { display: grid; grid-template-columns: minmax(520px, 1.25fr) 1fr; gap: .9rem; }
@media (max-width: 1100px) { .draft-layout { grid-template-columns: 1fr; } .g2 { grid-template-columns: 1fr; } }
.teams-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: .55rem; }
.tm { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem; font-size: .78rem; }
.tm.leading { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227,180,72,.35); }
.tm .nm { font-weight: 800; color: var(--gold2); font-size: .92rem; display: flex; justify-content: space-between; }
.tm .money { display: flex; justify-content: space-between; color: var(--mute); margin: .15rem 0 .3rem; }
.tm .slot { display: flex; justify-content: space-between; padding: .14rem .3rem; border-radius: 4px; background: rgba(0,103,71,.35); margin: 2px 0; }
.tm .slot.empty { background: rgba(255,255,255,.03); color: #4f6b5a; }

.profile { position: relative; overflow: hidden; }
.profile .ph { display: flex; gap: 1rem; align-items: center; }
.avatar { width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #1d6b45, #0a2a1a); border: 3px solid var(--gold); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-size: 2.1rem; color: var(--gold2); flex-shrink: 0; }
.profile .pname { font-family: 'Playfair Display', Georgia, serif; font-size: 2.4rem; line-height: 1.05; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .5rem; margin: .8rem 0; }
.stat { background: rgba(6,17,9,.6); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem; }
.stat .l { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.stat .v { font-size: 1.45rem; font-weight: 800; }
.stat .s { font-size: .7rem; color: var(--mute); }
.bidbox { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(90deg, #3b2f0e, #1a1405); border: 2px solid var(--gold); border-radius: 12px; padding: .7rem 1rem; margin-top: .6rem; }
.bidbox .amt { font-size: 3rem; font-weight: 900; color: var(--gold2); line-height: 1; }
.bidbox .who { font-size: 1.3rem; font-weight: 800; }
.meter { height: 12px; background: #061109; border-radius: 999px; position: relative; border: 1px solid var(--line); margin-top: .35rem; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.meter .mark { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--text); }
.flash { animation: flash 1s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 6px rgba(245,210,122,.8); } to { box-shadow: 0 0 0 0 rgba(245,210,122,0); } }
.sold-banner { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); z-index: 100; pointer-events: none; animation: fadeout 3.2s forwards; }
.sold-banner div { background: var(--gold); color: #1b1300; padding: 1.2rem 2.5rem; border-radius: 16px; font-size: 2.4rem; font-weight: 900; text-align: center; transform: rotate(-3deg); }
@keyframes fadeout { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- live / analytics ---------- */
.standings td.team { font-weight: 800; font-size: 1rem; }
.standings .rk { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--gold2); width: 38px; }
.livedot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-left: 3px; animation: pulse 1.4s infinite; vertical-align: 2px; }
@keyframes pulse { 50% { opacity: .2; } }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--mute); font-size: 11px; font-family: Montserrat, sans-serif; }
.barrow { display: grid; grid-template-columns: 150px 1fr 70px; gap: .5rem; align-items: center; margin: .25rem 0; font-size: .85rem; }
.bar { height: 16px; background: #061109; border-radius: 4px; position: relative; overflow: hidden; }
.bar > i { position: absolute; top: 0; bottom: 0; }
.leaderline { display: flex; justify-content: space-between; align-items: baseline; padding: .32rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.tvpanel { min-height: calc(100vh - 2rem); }
body.tv .card { font-size: 1.12rem; }
body.tv table.t { font-size: 1.12rem; }
.tvtitle { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; }
.tvtitle .brand { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--gold2); }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: .4rem; }
.progress i { display: block; height: 100%; background: var(--gold); animation: grow linear forwards; }
@keyframes grow { from { width: 0; } to { width: 100%; } }
.gteams { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
.scrollx { overflow-x: auto; }
@media (max-width: 700px) {
  header.top { gap: .4rem; padding: .45rem .6rem; }
  nav.tabs { flex-wrap: nowrap; overflow-x: auto; flex: 0 0 100%; order: 3; }
  nav.tabs a { white-space: nowrap; padding: .35rem .7rem; }
  main { padding: .6rem; }
  .hide-sm { display: none; }
  table.t { font-size: .8rem; }
  .card { padding: .7rem; }
  .profile .pname { font-size: 1.7rem; }
  .avatar { width: 64px; height: 64px; font-size: 1.5rem; }
  .bidbox .amt { font-size: 2.2rem; }
  .g3, .g2 { grid-template-columns: 1fr; }
}
