:root { --bg:#f6f7f9; --card:#fff; --ink:#14171a; --muted:#66707a; --line:#dde1e6; --accent:#1083fe; --good:#1a8f4a; --bad:#c23b3b; --tc:#1083fe; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --bg:#0f1418; --card:#161e24; --ink:#e8edf1; --muted:#93a0ab; --line:#2a353e; --accent:#3d9bff; --good:#3fbf72; --bad:#e06464; color-scheme: dark; } }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
#app { max-width: 1180px; margin: 0 auto; padding: 16px 16px 120px; }
header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin: 8px 0 12px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.sub { margin: 4px 0 0; color: var(--muted); }
.who { display:flex; gap:8px; align-items:center; white-space:nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; }
button { font: inherit; cursor: pointer; }
.link { background:none; border:0; color:var(--accent); padding:0; }
.primary { background:var(--accent); color:#fff; border:0; border-radius:8px; padding:9px 16px; font-weight:600; }
.primary:disabled { opacity:.45; cursor:default; }
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.tabs button { background:none; border:0; padding:8px 12px; color:var(--muted); border-bottom:2px solid transparent; margin-bottom:-1px; }
.tabs button.on { color:var(--ink); border-color:var(--accent); font-weight:600; }
.signin { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:16px; }
.signin label { display:block; font-weight:600; margin-bottom:8px; }
.row { display:flex; gap:8px; } .row input { flex:1; min-width:0; }
input { font:inherit; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--ink); }
.bracket { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(200px, 1fr); gap:16px; overflow-x:auto; padding-bottom:8px; }
.round { display:flex; flex-direction:column; gap:10px; justify-content:space-around; }
.round h2 { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 2px; }
.slot { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.slot .label { font-size:12px; color:var(--muted); padding:6px 10px 0; }
.team { display:flex; align-items:center; gap:8px; width:100%; text-align:left; background:none; border:0; border-left:4px solid var(--tc); padding:9px 10px; color:var(--ink); min-height:40px; }
.team + .team { border-top:1px solid var(--line); }
.team:hover:not(:disabled) { background: color-mix(in srgb, var(--tc) 8%, transparent); }
.team.picked { background: color-mix(in srgb, var(--tc) 16%, transparent); font-weight:600; }
.team.picked::after { content:'Your pick'; margin-left:auto; font-size:11px; color:var(--muted); font-weight:500; }
.team.won .mark { color:var(--good); margin-left:auto; }
.team.picked.lost { text-decoration: line-through; color: var(--bad); }
.team:disabled { cursor:default; }
.team.empty { color:var(--muted); border-left-color:var(--line); }
.seed { font-size:12px; color:var(--muted); min-width:14px; text-align:right; }
.tname { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.savebar { position:fixed; left:0; right:0; bottom:0; background:var(--card); border-top:1px solid var(--line); padding:10px 16px; display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; justify-content:center; }
.savebar .tb input { width:72px; margin-left:4px; }
.savebar .seal { display:flex; gap:6px; align-items:center; }
.count { font-weight:600; }
.board { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.board th, .board td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; }
.board .num { text-align:right; font-variant-numeric: tabular-nums; }
.board tr.me td { background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight:600; }
.board a { color:inherit; }
.note { background:var(--card); border:1px solid var(--bad); border-radius:8px; padding:10px 12px; }
#toast { position:fixed; left:50%; bottom:84px; transform:translateX(-50%) translateY(20px); background:var(--ink); color:var(--bg); padding:10px 14px; border-radius:8px; opacity:0; transition:.2s; pointer-events:none; max-width:calc(100% - 32px); }
#toast.show { opacity:1; transform:translateX(-50%); } #toast.bad { background:var(--bad); color:#fff; }
.error { padding: 24px 0; }

/* Badges tab: one framed trophy case, tiles inline, tap a tile to open it in place */
.badge-case { background: color-mix(in srgb, var(--card) 88%, var(--accent) 4%); border:1px solid var(--line); border-radius:16px; padding:16px; margin-bottom:24px; box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent); }
.badge-case .case-head { margin:0 0 4px; font-size:18px; overflow-wrap:anywhere; }
.badge-case h3 { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:18px 0 8px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.tile { margin:0; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:8px; display:flex; flex-direction:column; gap:8px; min-width:0; }
.tile.hl { outline:2px solid var(--accent); }
.tile.open { grid-column: 1 / -1; }
.tile-face { display:flex; flex-direction:column; align-items:center; gap:3px; width:100%; background:none; border:0; padding:0; color:var(--ink); font:inherit; text-align:center; cursor:pointer; }
.tile-face img { width:100%; max-width:200px; height:auto; aspect-ratio:1; border-radius:10px; }
.tile.open .tile-face img { max-width:160px; }
.tile-title { font-weight:600; font-size:14px; margin-top:4px; overflow-wrap:anywhere; }
.tile-desc { font-size:13px; overflow-wrap:anywhere; }
.tile-meta { font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.tile.revoked .tile-face img { opacity:.5; }
.tile-open { border-top:1px solid var(--line); padding-top:8px; }
.tile-open img { display:block; width:100%; height:auto; border-radius:10px; }
.tile-open p { margin:6px 0 0; }
.tile .primary { width:100%; }
.tile a.primary.share { display:block; box-sizing:border-box; text-align:center; text-decoration:none; margin-top:10px; }
.tile.secret { background:#1b2229; border-color:#2a353e; color:#cfd8df; }
.tile.secret .tile-face { cursor:default; color:#cfd8df; }
.tile.secret .lock { width:100%; max-width:200px; aspect-ratio:1; display:grid; place-items:center; font-size:44px; border-radius:10px; background:repeating-linear-gradient(135deg,#232c34 0 10px,#1e262d 10px 20px); }
.tile.secret .tile-meta { color:#93a0ab; }
.bad { color:var(--bad); }
.contests { display:flex; gap:6px; overflow-x:auto; margin: 4px 0 10px; padding-bottom:2px; scrollbar-width:none; }
.contests a { white-space:nowrap; flex:none; }
.contests a { padding:6px 12px; border:1px solid var(--line); border-radius:999px; color:var(--ink); text-decoration:none; background:var(--card); font-size:14px; }
.contests a.on { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.contests .in { color:var(--good); font-weight:700; } .contests a.on .in { color:#fff; }
.games { display:grid; gap:18px; }
.games .day h2 { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 8px; }
.games .day { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap:10px; align-content:start; }
.games .day h2 { grid-column: 1 / -1; }
.slot.game .label { padding-bottom:6px; font-weight:600; color:var(--ink); }
.slot.game .when { font-weight:400; color:var(--muted); }
.slot.game.done { opacity:.85; }

.team .logo { width:20px; height:20px; flex:0 0 20px; object-fit:contain; }
.sealed-list { margin-top:18px; } .sealed-list h3 { font-size:14px; margin:0 0 4px; } .sealed-list ul { list-style:none; padding:0; margin:8px 0 0; display:flex; flex-wrap:wrap; gap:6px 14px; } .sealed-list li.me { font-weight:600; }
.fanview { margin: 0 0 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; } .brk { font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: 6px; }
.team .score { margin-left:auto; font-variant-numeric: tabular-nums; font-weight:600; } .team .score.live { color: #d93025; } .team .score + .mark { margin-left:6px; } .gstatus { font-size:11px; font-weight:600; color:var(--muted); padding:4px 10px 0; text-transform:uppercase; letter-spacing:.04em; } .gstatus.live { color:#d93025; }
body.fan .team.picked::after { content:'Their pick'; }
.team.picked.won { background: color-mix(in srgb, var(--good) 22%, transparent); }
.team.picked.won::after, body.fan .team.picked.won::after { content:'✓ Right'; color:var(--good); font-weight:700; }
.team.picked.won .mark { display:none; }
.team.picked.lost::after, body.fan .team.picked.lost::after { content:'✗ Wrong'; color:var(--bad); font-weight:700; display:inline-block; text-decoration:none; }
.team.lost:not(.picked) { opacity:.6; }
.team.busted { opacity:.45; background: none; }
.team.picked.busted::after, body.fan .team.picked.busted::after { content:'Out'; display:inline-block; text-decoration:none; }
.team.picked.lost, .team.busted { text-decoration:none; } .team.picked.lost .tname, .team.busted .tname { text-decoration: line-through; }
.who-link { display:inline-flex; align-items:center; gap:8px; color:inherit; text-decoration:none; } a.who-link:hover span { text-decoration:underline; }
.av { width:24px; height:24px; border-radius:50%; object-fit:cover; flex:0 0 24px; background:var(--line); }
.av.none { display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--muted); }
.av.big { width:48px; height:48px; flex-basis:48px; font-size:20px; }
.profilecard { display:flex; align-items:center; gap:12px; margin:18px 0 8px; padding:12px 14px; background:var(--card); border:1px solid var(--line); border-radius:12px; color:var(--ink); text-decoration:none; }
.profilecard .pc-text { display:flex; flex-direction:column; min-width:0; flex:1; } .profilecard .pc-bio { color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profilecard .pc-go { color:var(--accent); font-size:13px; white-space:nowrap; }
.glinks { font-size:11px; color:var(--muted); padding:4px 10px 6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.glinks a { color:var(--muted); } .glinks a:hover { color:var(--accent); }
.cardtoggle { font-size:13px; margin:6px 0 12px; } .cardtoggle label { cursor:pointer; }
/* narrow screens: the pick label becomes a small check so team names fit */
@media (max-width: 500px) {
  .team.picked::after, body.fan .team.picked::after { content:'✓'; font-size:13px; font-weight:700; color:var(--accent); }
  .team.picked.won::after, body.fan .team.picked.won::after { content:'✓'; color:var(--good); }
  .team.picked.lost::after, body.fan .team.picked.lost::after { content:'✗'; }
  .team.picked.busted::after, body.fan .team.picked.busted::after { content:'✗'; }
}
.tbline { font-size:13px; margin-top:2px; }
