[hidden] { display: none !important; }
:root {
  --bg: #0f0f12; --bg2: #18181d; --card: #1d1d23; --card2: #26262e; --line: #34343e;
  --text: #f3f3f5; --muted: #a6a7b2; --gold: #e0262e; --gold2: #f5c6c8; --on-accent: #ffffff;
  --win: #3ccf7a; --loss: #ff6b6b; --push: #b8c2d6; --pick: #facc15; --hit: #22c55e; --miss: #ef4444; --even: #94a3b8;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -220px, #3a1316 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1100px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 58px; width: auto; }
.brand h1 { margin: 0; font: 900 22px/1.1 Impact, "Arial Black", system-ui, sans-serif; color: var(--text); letter-spacing: .5px; text-transform: uppercase; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.who span { color: var(--text); font-weight: 600; }
.link { background: none; border: 0; color: var(--gold2); padding: 4px; text-decoration: underline; }

.tabs { display: flex; gap: 4px; max-width: 1100px; margin: 0 auto; padding: 0 12px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 85%, transparent); padding-bottom: 8px; padding-top: 6px; }
.tabs button { flex: 1 0 auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--gold); border-color: var(--gold); color: var(--on-accent); font-weight: 700; }

main { max-width: 1100px; margin: 0 auto; padding: 8px 12px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.auth { max-width: 400px; margin: 0 auto 30px; }
.auth .hero { display: block; width: min(300px, 78vw); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
label small { color: var(--muted); font-weight: 400; }
.pwwrap { position: relative; display: block; }
.pwwrap input { width: 100%; padding-right: 64px; }
.show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--gold2); font-size: 13px; padding: 6px; }
.pwrules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.pwrules li::before { content: "○ "; }
.pwrules li.ok { color: var(--win); }
.pwrules li.ok::before { content: "✓ "; }
.tlogo { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.auth form { display: grid; gap: 12px; margin-top: 12px; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
input, select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 999px; padding: 4px; }
.seg button { background: none; border: 0; border-radius: 999px; padding: 8px; color: var(--muted); }
.seg button.on { background: var(--card2); color: var(--text); font-weight: 600; }
.btn { border: 1px solid var(--line); background: var(--card2); border-radius: 10px; padding: 10px 14px; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--on-accent); font-weight: 700; }
.msg { color: var(--loss); min-height: 1em; margin: 0; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

/* week bar */
.weekbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.weekbar h2 { margin: 0; font-size: 18px; text-align: center; flex: 1; }
.weekbar button { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 36px; font-size: 18px; }
.weekbar button:disabled { opacity: .35; cursor: default; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 18px; }
.stat span { color: var(--muted); font-size: 12px; }
.note { color: var(--muted); font-size: 13px; margin: 4px 2px 12px; }
.note b { color: var(--text); font-weight: 600; }

/* games */
.games { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .games { grid-template-columns: 1fr 1fr; } }
.game { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; }
.game.lotw { border-color: var(--pick); box-shadow: 0 0 0 1px var(--pick) inset, 0 0 18px rgba(250,204,21,.22); }
.ghead { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; gap: 8px; }
.ghead .lock { color: #ff8a8f; }
.ghead .live { color: var(--win); font-weight: 600; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; text-align: left; background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 8px; min-height: 58px; }
.team img { width: 34px; height: 34px; object-fit: contain; }
.team .nm { font-weight: 650; line-height: 1.15; }
.team .rec { color: var(--muted); font-size: 12px; white-space: nowrap; }
.team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .sp { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.team .sc { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.team.mine { border-color: var(--pick); background: linear-gradient(180deg, rgba(250,204,21,.22), rgba(250,204,21,.06)); }
.team:disabled { cursor: default; }
.team:disabled:not(.mine) { opacity: .7; }
.at { display: none; }
.gfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gfoot select { padding: 6px 8px; font-size: 15px; border-radius: 8px; }
.gfoot .rk { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.lotwbtn { margin-left: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.lotwbtn.on { background: var(--pick); border-color: var(--pick); color: #231a00; font-weight: 700; }
.lotwbtn:disabled { opacity: .5; cursor: default; }
.myline { font-size: 13px; color: var(--muted); }
.myline b { color: var(--text); }
.myline .moved { color: var(--gold2); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 13px; }
.badge.win { background: rgba(60,207,122,.16); color: var(--win); }
.badge.loss { background: rgba(255,107,107,.16); color: var(--loss); }
.badge.push { background: rgba(184,194,214,.16); color: var(--push); }
.pill { display: inline-block; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-weight: 700; white-space: nowrap; }

/* tables */
.tablewrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; background: var(--card); font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--bg2); position: sticky; top: 0; }
td:first-child, th:first-child { text-align: left; position: sticky; left: 0; background: inherit; }
tr:last-child td { border-bottom: 0; }
td.pos { color: var(--win); } td.neg { color: var(--loss); }
.rank1 td:first-child::before { content: "🏆 "; }
.me td { background: var(--card2); }
td .tot { font-weight: 800; font-size: 16px; }

/* everyone */
.eg { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.eg h3 { margin: 0 0 6px; font-size: 14.5px; display: flex; justify-content: space-between; gap: 8px; }
.eg h3 small { color: var(--muted); font-weight: 400; }
.erow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }
.erow .pk { color: var(--muted); }
.erow .pk b { color: var(--text); }
.erow .r { color: var(--muted); font-variant-numeric: tabular-nums; }
.erow .pts { min-width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }

.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 0; color: var(--text); }
.prose li { margin-bottom: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #2a1218; border: 1px solid var(--loss); color: #ffd9d9; padding: 10px 16px; border-radius: 12px; max-width: 92vw; z-index: 20; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.ok { background: #102a1c; border-color: var(--win); color: #d4ffe6; }
@media (max-width: 560px) {
  .tag { display: none; }
  .who { flex-direction: column; align-items: flex-end; gap: 0; }
  .whobtns { display: flex; gap: 2px; }
}
@media (max-width: 420px) {
  .team { grid-template-columns: 28px 1fr; grid-template-rows: auto auto; }
  .team img { width: 28px; height: 28px; grid-row: span 2; }
  .team .sp, .team .sc { grid-column: 2; }
  .brand h1 { font-size: 19px; }
  .brand img { width: 44px; height: 44px; }
}

.mystats { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; font-size: 14px; }
.mystats .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; width: 100%; }
.mystats small, small.dim { color: var(--muted); }
img.mini { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 4px; }
.eg h3 img.mini { width: 22px; height: 22px; }
.tagb { font-size: 14px; }
#account .card form { display: grid; gap: 12px; margin-top: 10px; }
#account { margin-top: 20px; }
.cgrid { display: grid; gap: 12px; }
@media (min-width: 860px) { .cgrid { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.ch { margin: 0 0 6px; font-size: 17px; }
.dim { color: var(--muted); font-weight: 400; }
.prow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.prow .btn { white-space: nowrap; font-size: 13px; padding: 8px 10px; }
.chip { display: inline-block; margin: 4px 6px 0 0; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: var(--card2); border: 1px solid var(--line); color: var(--gold2); }
.chip.red { color: #ffb3b6; border-color: #7a2a2e; }
.resetbox { margin-bottom: 12px; border-color: var(--gold); }
.temp { font: 700 24px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; background: var(--bg); border: 1px dashed var(--gold); border-radius: 10px; padding: 12px; text-align: center; margin: 8px 0; user-select: all; word-break: break-all; }
a.link { display: inline-block; }
.who .link { white-space: nowrap; }
@media (max-width: 420px) { .brand h1 { font-size: 17px; } .whobtns .link { font-size: 13px; } }
.forgot { margin-top: 2px; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.reqs { margin-bottom: 12px; border-color: #c9a227; }
.reqs .prow:first-of-type { border-top: 0; }
.chip.amber { color: #ffd98a; border-color: #6b5517; }
.btn.small { font-size: 13px; padding: 8px 10px; }

/* pick colors: yellow while pending, then green (hit) / red (miss) / gray (push) */
.team.mine.res-win, .game.lotw.res-win { border-color: var(--hit); }
.team.mine.res-win { background: linear-gradient(180deg, rgba(34,197,94,.26), rgba(34,197,94,.08)); }
.game.lotw.res-win { box-shadow: 0 0 0 1px var(--hit) inset, 0 0 18px rgba(34,197,94,.28); }
.team.mine.res-loss, .game.lotw.res-loss { border-color: var(--miss); }
.team.mine.res-loss { background: linear-gradient(180deg, rgba(239,68,68,.26), rgba(239,68,68,.08)); }
.game.lotw.res-loss { box-shadow: 0 0 0 1px var(--miss) inset, 0 0 18px rgba(239,68,68,.28); }
.team.mine.res-push, .game.lotw.res-push { border-color: var(--even); }
.team.mine.res-push { background: linear-gradient(180deg, rgba(148,163,184,.22), rgba(148,163,184,.06)); }
.game.lotw.res-push { box-shadow: 0 0 0 1px var(--even) inset; }
.lotwbtn.on.res-win { background: var(--hit); border-color: var(--hit); color: #06210f; }
.lotwbtn.on.res-loss { background: var(--miss); border-color: var(--miss); color: #fff; }
.lotwbtn.on.res-push { background: var(--even); border-color: var(--even); color: #111; }
.lotwbtn.on:disabled { opacity: 1; }
.warn { background: rgba(250,204,21,.10); border: 1px solid rgba(250,204,21,.55); color: #fde68a; border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; font-size: 14px; }
.warn b { color: #fff3c4; }
.warn.bad { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.6); color: #fecaca; }
.warn.bad b { color: #fff; }
