:root {
  --bg: #0b0f17;
  --panel: #121826;
  --panel-2: #182033;
  --line: #243049;
  --text: #e8edf6;
  --muted: #8b97ad;
  --red: #e5383b;
  --red-soft: rgba(229, 56, 59, .16);
  --green: #2ecc71;
  --green-soft: rgba(46, 204, 113, .16);
  --gold: #f4b942;
  --blue: #4da3ff;
  --radius: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; min-height: 100vh; font-size: 14px; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: #0e1420; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; white-space: nowrap; }
.logo { background: var(--red); color: #fff; font-weight: 900; border-radius: 8px; padding: 4px 7px; font-size: 14px; letter-spacing: .5px; }
.brand-name b { color: var(--red); }
.top-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; flex: 1; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live-dot.on { background: var(--red); box-shadow: 0 0 0 0 rgba(229,56,59,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(229,56,59,0); } 100% { box-shadow: 0 0 0 0 rgba(229,56,59,0); } }
.top-actions { display: flex; align-items: center; gap: 8px; }
.layout-btns, .tv-views { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.layout-btns button, .tv-views button { background: transparent; border: 0; padding: 6px 11px; color: var(--muted); }
.layout-btns button.active, .tv-views button.active { background: var(--red); color: #fff; }
.icon-btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.icon-btn:hover { border-color: var(--muted); }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.primary { background: var(--red); border: 0; color: #fff; border-radius: 8px; padding: 8px 16px; font-weight: 600; }

/* Ticker */
.ticker { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; border-bottom: 1px solid var(--line); background: #0d121c; scrollbar-width: thin; }
.game { flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 128px; font-size: 12px; }
.game.live { border-color: var(--red); }
.game.redzone { background: var(--red-soft); }
.game .t { display: flex; justify-content: space-between; gap: 10px; }
.game .t.poss::before { content: "●"; color: var(--gold); font-size: 8px; margin-right: 4px; align-self: center; }
.game .t span:first-child { flex: 1; }
.game .s { font-weight: 700; }
.game .d { color: var(--muted); margin-top: 2px; font-size: 11px; white-space: nowrap; }
.game.live .d { color: #ff8a8c; }

/* Grid */
.grid { flex: 1; display: grid; gap: 12px; padding: 12px; min-height: 0; }
.grid.layout-1 { grid-template-columns: 1fr; }
.grid.layout-2 { grid-template-columns: 1fr 1fr; }
.grid.layout-4 { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
@media (max-width: 900px) { .grid.layout-2, .grid.layout-4 { grid-template-columns: 1fr; } .top-meta { display: none; } }
@media (max-width: 560px) { .brand-name { display: none; } .topbar { padding: 8px 12px; gap: 8px; } .grid { padding: 8px; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.panel-head select { background: transparent; color: var(--text); border: 0; font-weight: 700; font-size: 14px; flex: 1; min-width: 0; }
.panel-head select option { background: var(--panel); }
.panel-head .src { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.panel-body { overflow: auto; max-height: calc(100vh - 170px); }
.grid.layout-4 .panel-body { max-height: calc(50vh - 110px); }
@media (max-width: 900px) { .panel-body, .grid.layout-4 .panel-body { max-height: none; } }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Scoreboard header inside a league panel */
.mhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px; }
.team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team.right { flex-direction: row-reverse; text-align: right; }
.team img, .avatar-ph { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); flex: 0 0 auto; }
.team .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .rec { font-size: 11px; color: var(--muted); }
.team .info { min-width: 0; }
.scores { text-align: center; white-space: nowrap; }
.scores .big { font-size: 26px; font-weight: 800; }
.scores .big .vs { color: var(--muted); font-size: 13px; font-weight: 400; margin: 0 6px; }
.scores .win { color: var(--green); }
.scores .proj { font-size: 11px; color: var(--muted); }
.wp { height: 4px; background: var(--red-soft); margin: 0 12px 8px; border-radius: 2px; overflow: hidden; }
.wp div { height: 100%; background: var(--green); }

/* Lineup table */
.lineup { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lineup td { padding: 5px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.lineup .slot { width: 46px; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--panel-2); }
.lineup .pts { width: 58px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lineup .pts.r { text-align: left; }
.lineup .pts small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); }
.pl { min-width: 0; }
.pl .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pl .g { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl.r { text-align: right; }
.pl .g.live { color: #ff8a8c; }
.pl .g.done { color: var(--muted); opacity: .7; }
.inj { font: inherit; font-weight: 800; font-size: 10px; margin-left: 5px; padding: 0 4px; border-radius: 4px; border: 1px solid currentColor; background: transparent; cursor: pointer; line-height: 1.4; }
.inj.bad { color: var(--red); }
.inj.warn { color: var(--gold); }
.newschip { font: inherit; font-size: 9px; font-weight: 800; margin-left: 5px; padding: 0 4px; border-radius: 4px; border: 0; background: var(--blue); color: #0b0f17; cursor: pointer; line-height: 1.5; }
.flash-up { animation: up 2.5s ease-out; }
.flash-down { animation: down 2.5s ease-out; }
@keyframes up { 0% { background: rgba(46,204,113,.45); } 100% { background: transparent; } }
@keyframes down { 0% { background: rgba(229,56,59,.45); } 100% { background: transparent; } }
tr.redzone td.pl, tr.redzone-b td.pl.r { box-shadow: inset 3px 0 0 var(--red); }

.section-title { padding: 10px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); display: flex; justify-content: space-between; cursor: pointer; }
.bench .warn { color: var(--gold); font-size: 10px; font-weight: 700; margin-left: 6px; }
.others { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding: 6px 12px 12px; }
.om { background: var(--panel-2); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.om div { display: flex; justify-content: space-between; gap: 8px; }
.om span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.om b { font-variant-numeric: tabular-nums; }

/* Alerts */
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100vw); background: #0e1420; border-left: 1px solid var(--line); z-index: 40; display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.alerts-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.alerts-list li, .alert-feed li { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.alert-feed { list-style: none; margin: 0; padding: 0; }
.al-pts { font-weight: 800; margin-right: 6px; }
.al-pts.up { color: var(--green); } .al-pts.down { color: var(--red); }
.al-meta { font-size: 11px; color: var(--muted); }
.mine { color: var(--blue); font-weight: 700; font-size: 10px; margin-left: 4px; }
.theirs { color: var(--gold); font-weight: 700; font-size: 10px; margin-left: 4px; }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; padding: 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: slide .25s ease-out; }
.toast.down { border-left-color: var(--red); }
@keyframes slide { from { transform: translateY(12px); opacity: 0; } }

/* Setup modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(480px, 100%); max-height: 90vh; overflow: auto; }
.modal-card h2 { margin: 0 0 4px; }
.row { display: flex; gap: 8px; margin: 14px 0; }
.row input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; }
.league-list label { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.league-list label small { color: var(--muted); display: block; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 12px; }

/* DraftKings */
.dk-slots { display: grid; gap: 6px; }
.dk-slot { display: flex; align-items: center; gap: 8px; }
.dk-slot span { width: 44px; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; background: var(--panel-2); border-radius: 6px; padding: 7px 0; }
.dk-slot input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 10px; }
.dk-badge { background: #53d337; color: #0b0f17; font-weight: 900; border-radius: 8px; padding: 8px 7px; font-size: 13px; }
.dk-actions { display: flex; gap: 6px; }
.lineup.dk .pl .g + .g { color: var(--text); opacity: .8; }
.note { margin: 0 12px 8px; padding: 8px 10px; background: rgba(244,185,66,.12); border: 1px solid rgba(244,185,66,.4); border-radius: 8px; font-size: 12px; }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; padding: 0; }
.fine { font-size: 11px; padding: 8px 12px 12px; margin: 0; }

.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 18px 0 4px; }
.btn-link { display: inline-block; text-decoration: none; margin-top: 6px; }

/* Hand-entered matchup */
.modal-card.wide { width: min(860px, 100%); }
.m-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .m-cols { grid-template-columns: 1fr; } }
.m-team { width: 100%; margin-bottom: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font-weight: 700; }

/* League view */
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 6px 12px 14px; }
.lv-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; }
.lv-card.mine { border-color: var(--blue); }
.lv-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; min-width: 0; }
.lv-row img, .lv-row .avatar-ph { width: 28px; height: 28px; }
.lv-name { min-width: 0; }
.lv-name b, .lv-name small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-name small, .lv-pts small { color: var(--muted); font-size: 11px; }
.lv-pts { text-align: right; font-variant-numeric: tabular-nums; }
.lv-pts b { display: block; font-size: 16px; }
.lv-row.lead .lv-pts b { color: var(--green); }
.lv-wp { margin: 2px 0 0; }
.lv-odds { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

/* Weekly rollover */
.rollover { grid-column: 1 / -1; background: rgba(244,185,66,.10); border: 1px solid rgba(244,185,66,.45); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; }
.rollover ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rollover li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.roll-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* DK paste */
.paste { margin: 12px 0 4px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.paste summary { cursor: pointer; font-weight: 600; }
.paste textarea { width: 100%; margin: 8px 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; resize: vertical; }

/* Passcode gate */
.gate { background: var(--bg); }
.gate-card { text-align: center; width: min(380px, 100%); }
.big-logo { display: inline-block; font-size: 22px; padding: 8px 12px; margin-bottom: 6px; }
.gate-msg { color: #ff8a8c; min-height: 1.2em; margin: 0; }

/* Headshots & logos */
.plw { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pl.r .plw { flex-direction: row-reverse; }
.plt { min-width: 0; flex: 1; }
.hs { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: 0 0 auto; }
.hs.logo { border-radius: 4px; object-fit: contain; background: transparent; }
.tl { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
@media (max-width: 560px) { .hs { width: 24px; height: 24px; } }

/* Touchdown moments */
.td-banner { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px; border-radius: 14px; background: var(--panel); border: 2px solid var(--green); box-shadow: 0 12px 40px rgba(0,0,0,.55); animation: td-in .45s cubic-bezier(.2,1.4,.4,1); cursor: pointer; max-width: calc(100vw - 32px); }
.td-banner.theirs { border-color: var(--gold); }
.td-hs { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--panel-2); }
.td-hs.logo { border-radius: 8px; object-fit: contain; }
.td-word { font-size: 28px; font-weight: 900; letter-spacing: 2px; color: var(--green); line-height: 1; }
.td-banner.theirs .td-word { color: var(--gold); }
.td-name { font-size: 16px; font-weight: 700; margin-top: 4px; }
.td-name span { color: var(--muted); font-weight: 400; font-size: 12px; }
.td-where { font-size: 12px; color: var(--muted); }
@keyframes td-in { from { transform: translate(-50%, -30px) scale(.8); opacity: 0; } }
.grid.td-glow .panel { animation: td-glow 1.6s ease-out; }
@keyframes td-glow { 0% { box-shadow: 0 0 0 3px rgba(46,204,113,.8); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }
@media (prefers-reduced-motion: reduce) { .td-banner, .grid.td-glow .panel { animation: none; } }

/* Odds */
.tdodds { margin-left: 6px; font-size: 10px; font-weight: 700; color: var(--green); border: 1px solid rgba(46,204,113,.45); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.game .d.line { color: var(--gold); margin-top: 0; }
.best-td { margin: 0 12px; padding: 8px 10px; background: var(--green-soft); border-radius: 8px; font-size: 12px; }
.best-td b { color: var(--green); }

/* Injury details */
.inj-card { width: min(520px, 100%); }
.inj-head { display: flex; gap: 12px; align-items: center; }
.inj-head h2 { margin: 0; }
.inj-status { margin: 14px 0 6px; padding: 8px 10px; border-radius: 8px; font-weight: 700; }
.inj-status.bad { background: var(--red-soft); color: #ff8a8c; }
.inj-status.warn { background: rgba(244,185,66,.14); color: var(--gold); }
.inj-status.ok { background: var(--green-soft); color: var(--green); }
.inj-src { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.inj-src p { margin: 6px 0; line-height: 1.45; }
.inj-src a { color: var(--blue); font-size: 12px; }

/* Lineup checker */
.checker { grid-column: 1 / -1; background: var(--red-soft); border: 1px solid rgba(229,56,59,.5); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; }
.checker ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checker li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { font-size: 11px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; }

/* Focus + TV */
.focus-btn { padding: 2px 8px; font-size: 11px; }
.grid.focused .panel-body { max-height: calc(100vh - 170px); }
body.tv { font-size: 18px; }
body.tv .top-actions > :not(#tvBtn):not(.tv-views) { display: none; }
.top-actions .tv-views { display: none; }
body.tv .top-actions .tv-views { display: flex; }
body.tv .tv-views button { font-size: 15px; padding: 6px 14px; }
body.tv .grid .panel-body { max-height: calc(100vh - 150px); }
body.tv .lineup td { padding: 8px 10px; }
body.tv .lineup .pts { width: 80px; font-size: 20px; }
body.tv .scores .big { font-size: 44px; }
body.tv .hs { width: 42px; height: 42px; }
body.tv .pl .n { font-size: 20px; }
body.tv .pl .g { font-size: 14px; }
body.tv .game { min-width: 150px; font-size: 14px; }
body.tv .focus-btn { display: none; }

/* TV split views: keep the big type but fit 2 / 4 panels */
body.tv .grid.layout-2 .panel-body { max-height: calc(100vh - 150px); }
body.tv .grid.layout-4 { gap: 10px; padding: 10px; }
body.tv .grid.layout-4 .panel-body { max-height: calc(50vh - 95px); }
body.tv .grid.layout-4 .scores .big { font-size: 32px; }
body.tv .grid.layout-4 .pl .n { font-size: 16px; }
body.tv .grid.layout-4 .pl .g { font-size: 12px; }
body.tv .grid.layout-4 .lineup .pts { font-size: 16px; }
body.tv .grid.layout-4 .hs { width: 32px; height: 32px; }
body.tv .grid.layout-4 .lineup td { padding: 5px 8px; }

/* ---------- installed app (home screen) ---------- */
.topbar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.grid { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.install-bar { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 560px; margin: 0 auto; }
.install-bar[hidden] { display: none; }
.install-bar img { border-radius: 8px; flex: none; }
.install-bar div { flex: 1; font-size: 14px; line-height: 1.35; }
.install-bar b { color: #fff; }
#phoneAlerts.on { border-color: var(--green); color: var(--green); }

/* ---------- United for Rooder branding ---------- */
.brand-logo { width: 34px; height: 34px; border-radius: 8px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.gate { background: #0b0f17 url("u4r-bg.jpg") center / cover no-repeat; }
.gate::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,15,23,.35), rgba(11,15,23,.8)); }
.gate .gate-card { position: relative; background: rgba(19,26,38,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gate-logo { width: 132px; height: 132px; border-radius: 26px; display: block; margin: 0 auto 10px; box-shadow: 0 8px 28px rgba(0,0,0,.5); }
.panel-badge { width: 22px; height: 22px; border-radius: 5px; flex: none; }
body.tv .panel-badge { width: 30px; height: 30px; }
@media (min-aspect-ratio: 1/1) {
  .gate { background-size: auto 100%; background-position: 15% center; justify-content: flex-end; padding-right: 10vw; }
  .gate::before { background: linear-gradient(90deg, rgba(11,15,23,0) 30%, rgba(11,15,23,.85) 55%); }
}

/* ---------- My Teams home ---------- */
.view-tabs { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.view-tabs button { background: none; border: 0; border-radius: 7px; padding: 5px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.view-tabs button.active { background: var(--red); color: #fff; }
body.view-teams .layout-btns, body.view-teams #tvBtn { display: none; }
body.tv .top-actions .view-tabs { display: none; }
.grid.teams-view { display: block; max-width: 1280px; width: 100%; margin: 0 auto; }
.teams-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.teams-head h1 { margin: 0 0 2px; font-size: 24px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--line); }
.tcard.win { border-top-color: var(--green); }
.tcard.lose { border-top-color: var(--red); }
.tc-head { display: flex; align-items: center; gap: 10px; }
.tc-logo { width: 36px; height: 36px; border-radius: 9px; flex: none; object-fit: cover; }
.tc-logo.ph, .tc-logo.dk { display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-weight: 800; color: var(--muted); }
.tc-logo.dk { background: #1b2b12; color: #9be15d; border-color: #2e4a1d; font-size: 13px; }
.tc-league { flex: 1; min-width: 0; }
.tc-lname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-src { font-size: 12px; color: var(--muted); }
.tc-pill { font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 2px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.tc-pill.live { background: var(--red-soft); border-color: var(--red); color: #ff8a8c; }
.tc-pill.final { color: var(--text); }
.tc-names { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tc-side { min-width: 0; }
.tc-side.r { text-align: right; }
.tc-team { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-sub { font-size: 12px; color: var(--muted); }
.tc-nums { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; display: flex; justify-content: space-between; align-items: baseline; }
.tc-nums.solo { justify-content: flex-start; }
.tc-nums .hi { color: var(--text); }
.tc-vs { color: var(--muted); font-weight: 400; font-size: 18px; }
.tc-wp { margin: 0; }
.tc-proj, .tc-counts { font-size: 12px; color: var(--muted); }
.tc-proj b { color: var(--text); }
.live-n { color: #ff8a8c; }
.tc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tc-issues { font-size: 12px; background: rgba(244,185,66,.1); border: 1px solid rgba(244,185,66,.35); border-radius: 8px; padding: 6px 8px; color: var(--gold); }
.tc-actions { display: flex; gap: 8px; margin-top: auto; }
.primary.sm { padding: 6px 12px; }
.tcard.add { border-style: dashed; border-top-width: 1px; align-items: flex-start; justify-content: center; }
.tc-add-title { font-weight: 700; }
.teams-empty { text-align: center; padding: 48px 16px; }
.teams-empty img { border-radius: 16px; }
@media (max-width: 560px) {
  .teams-grid { grid-template-columns: 1fr; }
  .teams-head h1 { font-size: 20px; }
  .tc-nums { font-size: 22px; }
  .view-tabs button { padding: 5px 9px; }
}

/* ---------- DK Lineup Builder ---------- */
.dkb-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; flex-wrap: wrap; }
.dkb-top h1 { margin: 0 0 2px; font-size: 24px; }
.dkb-topbtns { display: flex; gap: 8px; align-items: center; }
.dkb-up { display: inline-flex; align-items: center; cursor: pointer; }
.dkb-help { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.dkb-help summary { cursor: pointer; font-weight: 600; }
.dkb-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.dkb-warn { background: rgba(244,185,66,.1); border: 1px solid rgba(244,185,66,.35); color: var(--gold); border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.dkb-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.dkb-pool { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 0; }
.dkb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.dkb-filters .seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.dkb-filters .seg button { background: none; border: 0; border-radius: 6px; padding: 4px 9px; color: var(--muted); font-weight: 600; font-size: 12px; }
.dkb-filters .seg button.active { background: var(--blue); color: #fff; }
.dkb-filters input[type=search], .dkb-filters select, .dkb-name { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; }
.dkb-filters input[type=search] { flex: 1; min-width: 150px; }
.dkb-filters .chk { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.dkb-scroll { overflow: auto; max-height: calc(100vh - 290px); border-radius: 8px; }
.dkb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dkb-table th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px; text-align: left; padding: 7px 8px; white-space: nowrap; z-index: 1; }
.dkb-table th.sortable { cursor: pointer; }
.dkb-table th.sorted { color: var(--text); }
.dkb-table td { padding: 5px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.dkb-table .num, .dkb-lt .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dkb-table th.num { text-align: right; }
.dkb-table .b { font-weight: 700; }
.dkb-table .good { color: var(--green); font-weight: 700; }
.dkb-table tr.in { background: rgba(77,163,255,.08); }
.dkb-none { text-align: center; padding: 20px; }
.dkb-add { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); font-weight: 800; }
.dkb-add:hover { border-color: var(--blue); }
.dkb-add.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.dkb-pos { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--panel-2); }
.dkb-pos.QB { color: #ff8a8c; } .dkb-pos.RB { color: #6fe3a1; } .dkb-pos.WR { color: #7cc0ff; } .dkb-pos.TE { color: #f4b942; } .dkb-pos.DST { color: #c9a7ff; }
.dkb-side { position: sticky; top: 70px; }
.dkb-lu { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.dkb-lu-head { display: flex; justify-content: space-between; align-items: center; }
.dkb-meter { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.dkb-meter div { height: 100%; background: var(--green); }
.dkb-meter div.over { background: var(--red); }
.dkb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.dkb-stats small { display: block; color: var(--muted); font-size: 11px; }
.dkb-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.dkb-stats b.bad { color: #ff8a8c; }
.dkb-lt tr.empty td { color: var(--muted); }
.dkb-x { background: none; border: 0; color: var(--muted); padding: 2px 6px; }
.dkb-x:hover { color: #ff8a8c; }
.dkb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dkb-btns button[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 980px) {
  .dkb-body { grid-template-columns: 1fr; }
  .dkb-side { position: static; order: -1; }
  .dkb-scroll { max-height: none; }
}

/* ---------- Game panel (play-by-play) ---------- */
.ticker .game { cursor: pointer; }
.ticker .game:hover { border-color: var(--blue); }
.gp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 12px; }
.gp-team { display: flex; align-items: center; gap: 10px; }
.gp-team.r { justify-content: flex-end; text-align: right; }
.gp-logo { width: 40px; height: 40px; object-fit: contain; }
.gp-abbr { font-weight: 800; font-size: 18px; }
.gp-rec { font-size: 12px; color: var(--muted); }
.gp-ball { color: var(--gold); font-size: 12px; }
.gp-score { text-align: center; }
.gp-nums { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gp-nums span { margin: 0 8px; color: var(--muted); font-weight: 400; }
.gp-status { font-size: 12px; color: var(--muted); }
.gp-status.live { color: #ff8a8c; font-weight: 700; }
.gp-wp { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); padding: 0 12px 8px; }
.gp-wpbar { flex: 1; height: 6px; border-radius: 3px; background: var(--blue); overflow: hidden; }
.gp-wpbar div { height: 100%; background: var(--gold); }
.gp-sit { padding: 0 12px 10px; font-size: 13px; }
.gp-rz { background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; margin-right: 8px; animation: rzpulse 1.6s infinite; }
@keyframes rzpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .gp-rz { animation: none; } }
.gp-leaders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 12px; }
.gp-lt { display: flex; gap: 8px; align-items: flex-start; }
.gp-lt .gp-logo { width: 26px; height: 26px; }
.gp-ld { font-size: 12px; line-height: 1.35; margin-bottom: 4px; }
.gp-ld small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.gp-ld span { display: block; }
.gp-drive { border-top: 1px solid var(--line); }
.gp-drive.cur { background: rgba(229,56,59,.05); }
.gp-dh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.gp-dh .gp-logo { width: 20px; height: 20px; }
.gp-dh b { color: var(--text); }
.gp-res { margin-left: auto; font-weight: 700; color: var(--text); }
.gp-res.score { color: var(--green); }
.gp-plays { list-style: none; margin: 0; padding: 0 12px 8px 40px; }
.gp-plays li { padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.gp-plays li:first-child { border-top: 0; }
.gp-plays li.score { background: var(--green-soft); margin: 0 -8px; padding: 6px 8px; border-radius: 6px; }
.gp-plays li.to .gp-tx { color: #ffb3b4; }
.gp-plays li.pen .gp-tx { color: var(--muted); }
.gp-pt { display: flex; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 2px; flex-wrap: wrap; }
.gp-tag { font-weight: 800; color: var(--green); }
.gp-tag.to { color: #ff8a8c; }
.gp-me { color: var(--text); }
.gp-me.mine { color: var(--green); }
.gp-me.theirs { color: #ff8a8c; }
body.tv .gp-plays li { font-size: 16px; }
@media (max-width: 560px) { .gp-leaders { grid-template-columns: 1fr; } .gp-nums { font-size: 26px; } .gp-plays { padding-left: 12px; } }

/* ---------- GameCast field ---------- */
.gp-tabs { display: flex; gap: 4px; margin: 0 12px 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; width: max-content; }
.gp-tabs button { background: none; border: 0; border-radius: 6px; padding: 4px 14px; font-weight: 700; font-size: 12px; color: var(--muted); }
.gp-tabs button.active { background: var(--blue); color: #fff; }
.gc { padding: 0 12px 4px; }
.gc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.gc-off { font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--tc); color: #fff; font-size: 12px; }
.gc-drv { margin-left: auto; font-size: 12px; }
.gc-field-wrap { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.gc-field { display: block; width: 100%; height: auto; }
.gc-grass { fill: #2f6b34; }
.gc-stripe { fill: #2a6230; }
.gc-yl { stroke: rgba(255,255,255,.75); stroke-width: .25; }
.gc-yl.minor { stroke: rgba(255,255,255,.4); stroke-width: .15; }
.gc-hash { stroke: rgba(255,255,255,.5); stroke-width: .15; }
.gc-num { fill: rgba(255,255,255,.6); font-size: 3.4px; font-weight: 700; text-anchor: middle; font-family: inherit; }
.gc-ez { fill: rgba(255,255,255,.9); font-size: 5px; font-weight: 900; text-anchor: middle; dominant-baseline: middle; letter-spacing: .6px; font-family: inherit; }
.gc-los { stroke: #4da3ff; stroke-width: .5; }
.gc-fd { stroke: #f4d03f; stroke-width: .5; }
.gc-drive { stroke-width: 1.2; opacity: .75; stroke-linecap: round; }
.gc-arrow { stroke-width: .7; stroke-dasharray: 1.2 .8; }
.gc-arrow.gain { stroke: #9cff9c; } .gc-arrow.loss { stroke: #ff9c9c; }
.gc-arrowhead { fill: #fff; }
.gc-ballg { transition: transform 1.1s cubic-bezier(.3,.7,.3,1); }
.gc-ball { fill: #8b4a1c; stroke: #3a1d08; stroke-width: .2; }
.gc-lace { stroke: #fff; stroke-width: .2; }
.gc-flash { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(18px, 4vw, 40px); font-weight: 900; letter-spacing: 2px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); pointer-events: none; animation: gcflash 3s ease-out forwards; }
.gc-flash.td { background: rgba(46,204,113,.35); }
.gc-flash.to { background: rgba(229,56,59,.35); }
@keyframes gcflash { 0% { opacity: 0; transform: scale(.9); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.gc-last { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.gc-last.score { border-color: var(--green); background: var(--green-soft); }
.gc-last.to { border-color: var(--red); background: var(--red-soft); }
.gc-lk { display: flex; gap: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.gc-lk .gain { color: var(--green); } .gc-lk .loss { color: #ff8a8c; }
.gc-recent { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; }
.gc-recent li { padding: 4px 2px; border-top: 1px dashed var(--line); }
.gc-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin: 8px 0 2px; }
.gc-legend .lg { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.lg.los { background: #4da3ff; } .lg.fd { background: #f4d03f; } .lg.dr { background: var(--muted); }
body.tv .gc-last { font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .gc-ballg { transition: none; } .gc-flash { animation: none; opacity: 0; } }
.gc-field-wrap { max-width: min(100%, calc(52vh * 120 / 53.3)); margin: 0 auto; }
.grid.layout-4 .gc-field-wrap { max-width: min(100%, calc(24vh * 120 / 53.3)); }

/* ---------- League chat ---------- */
.chat-drawer { width: min(400px, 100vw); }
.chat-drawer .drawer-head { gap: 8px; }
.chat-drawer select { flex: 1; min-width: 0; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-weight: 600; }
.chat-online { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.chat-online .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chat-online .dot.on { background: var(--green); }
.chat-name { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.chat-name label { flex: 1; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.chat-name input, .chat-form input, .chat-set input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.chat-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 6px 10px; }
.chat-msg.mine { align-self: flex-end; background: rgba(77,163,255,.14); border-color: rgba(77,163,255,.35); border-radius: 12px 12px 4px 12px; }
.chat-msg.td { border-color: var(--green); background: var(--green-soft); }
.chat-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.chat-text { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.chat-day { align-self: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.chat-empty { text-align: center; padding: 30px 10px; font-size: 13px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.chat-form input { flex: 1; min-width: 0; }
.chat-more { border-top: 1px solid var(--line); padding: 8px 14px 12px; font-size: 13px; }
.chat-more summary { cursor: pointer; color: var(--muted); }
.chat-set { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.chat-set input { flex: 1; min-width: 0; font-size: 12px; }
