/* MRL Fantasy. Navy and electric blue. No side stripes on cards. */
:root {
  --navy: #071a33;
  --blue: #1479ff;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #071a33;
  --muted: #5b6b82;
  --line: #e1e6ee;
  --chip: #e9edf3;
  --chip-on: #071a33;
  --chip-on-text: #ffffff;
  --accent: #1479ff;
  --accent-text: #0b5fd6;
  --pos: #11924a;
  --neg: #d32f3c;
  --live: #e5484d;
  --track: #e1e6ee;
  --hl: rgba(20, 121, 255, 0.07);
  --shadow: 0 1px 2px rgba(7, 26, 51, 0.06), 0 6px 20px rgba(7, 26, 51, 0.06);
  --visor: #071a33;
  --eye: #7fd0ff;
  --radius: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #040d1c; --card: #0b1a31; --text: #eef3fb; --muted: #8b9bb3; --line: #1a2c49; --chip: #132541;
    --chip-on: #eef3fb; --chip-on-text: #071a33; --accent: #3b8eff; --accent-text: #6aa9ff; --pos: #35c47b; --neg: #ff6370;
    --track: #1a2c49; --hl: rgba(59, 142, 255, 0.12); --shadow: none; --visor: #040d1c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #040d1c; --card: #0b1a31; --text: #eef3fb; --muted: #8b9bb3; --line: #1a2c49; --chip: #132541;
  --chip-on: #eef3fb; --chip-on-text: #071a33; --accent: #3b8eff; --accent-text: #6aa9ff; --pos: #35c47b; --neg: #ff6370;
  --track: #1a2c49; --hl: rgba(59, 142, 255, 0.12); --shadow: none; --visor: #040d1c; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-left: var(--safe-l); padding-right: var(--safe-r);
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }
input, select { font: inherit; font-size: 16px; color: var(--text); }
h1, h2, h3 { margin: 0; }
.ic { flex: none; }
.muted { color: var(--muted); }
.pos-t { color: var(--pos); }
.neg-t { color: var(--neg); }
.live-t { color: var(--live); }
.acc-t { color: var(--accent-text); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }
.sub { color: var(--muted); font-size: 14px; }
.sep { opacity: 0.6; margin: 0 2px; }
.bar-sep { opacity: 0.35; margin: 0 4px; }
.fine { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.pad { padding: 0 16px; }
#app { min-height: 100vh; padding-bottom: calc(24px + var(--safe-b)); }
#app.has-live { padding-bottom: calc(96px + var(--safe-b)); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; padding: calc(10px + var(--safe-t)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.tb-l { display: flex; gap: 8px; }
.tb-r { display: flex; gap: 10px; justify-content: flex-end; }
.tb-c { min-width: 0; display: flex; justify-content: center; }
.rbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; position: relative; }
.rbtn .dot, .tile .dot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--live); border: 2px solid var(--bg); }
.backbtn { width: 44px; height: 44px; display: grid; place-items: center; margin-left: -10px; }
.wordmark { font-weight: 900; font-style: italic; font-size: 25px; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark span { color: var(--accent); }
.bartitle { font-size: 18px; font-weight: 700; }
.titlebtn { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; min-width: 0; max-width: 100%; }
.titlebtn span:not(.tav) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chips */
.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 52px; height: 40px;
  padding: 0 16px; border-radius: 999px; background: var(--chip); color: var(--muted); font-weight: 600; font-size: 15px;
  border: 2px solid transparent; white-space: nowrap;
}
.chip.on { background: transparent; border-color: var(--text); color: var(--text); }
.chip.big { height: 46px; font-size: 16px; color: var(--text); }
.sportrow { padding: 6px 16px 14px; }
.sportrow .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.vs { gap: 8px; padding: 0 12px; font-weight: 500; color: var(--muted); }
.vsep { flex: none; width: 1px; background: var(--line); margin: 6px 2px; }
.pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--chip); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
:root[data-theme="dark"] .card { border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { border: 1px solid var(--line); } }
.dotline { border-top: 2px dotted var(--line); margin: 14px 0; }
.demo-flag { display: block; margin: -4px 16px 12px; padding: 8px 12px; border-radius: 12px; background: var(--hl); color: var(--accent-text); font-size: 13px; font-weight: 600; text-align: center; }

/* home */
.home { display: grid; gap: 16px; }
.homecol { min-width: 0; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding: 2px 16px 10px; scroll-padding: 0 16px; }
.carousel::-webkit-scrollbar { display: none; }
.lcard { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; padding: 18px; }
.lcard .big { font-size: 36px; }
.lhead { display: flex; align-items: center; gap: 12px; }
.lhead h2 { flex: 1; font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbadge { width: var(--s); height: var(--s); border-radius: 12px; background: linear-gradient(145deg, var(--navy), #10305c); color: var(--blue); display: grid; place-items: center; flex: none; }
.lbadge .ic { width: 60%; height: 60%; stroke: #fff; fill: var(--blue); }
:root[data-theme="dark"] .lbadge { background: linear-gradient(145deg, #10305c, #18437f); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.mside, .mmeta { min-width: 0; }
.mside.right .mscore { justify-content: flex-end; text-align: right; }
.mscore { display: flex; align-items: center; gap: 10px; }
.big { font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.proj { color: var(--muted); font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.proj span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.mbars { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; }
.mbars.three { grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.cap { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.winbar { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.winbar b { font-weight: 600; font-size: 15px; min-width: 38px; }
.winbar.right b { text-align: right; }
.track { flex: 1; height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; display: flex; }
.winbar.right .track { justify-content: flex-end; }
.fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.mmeta .tname { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmeta .sub { font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmeta.right { text-align: right; }
.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btnrow.pad { padding: 14px 16px; }
.obtn, .sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px;
  border-radius: 999px; border: 2px solid var(--accent); color: var(--accent-text); font-weight: 700; font-size: 17px;
}
.sbtn { background: var(--accent); color: #fff; }
.obtn, .sbtn { white-space: nowrap; }
.btnrow.pad .obtn { padding: 0 10px; font-size: 16px; }
.sbtn.full { width: 100%; margin-top: 16px; }
.sbtn.tiny { min-height: 36px; font-size: 14px; padding: 0 14px; border-width: 0; }
.dots { display: flex; justify-content: center; gap: 10px; padding: 4px 0 0; }
.pdot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: 0.4; }
.pdot.on { opacity: 1; background: transparent; box-shadow: inset 0 0 0 2.5px var(--text); width: 14px; height: 14px; margin: -2.5px 0; }
.welcome .lead { margin: 0; font-size: 15px; color: var(--muted); }
.sports3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.sports3 div { background: var(--chip); border-radius: 14px; padding: 12px 8px; text-align: center; display: grid; gap: 2px; }
.sports3 b { font-size: 14px; }
.sports3 span { font-size: 13px; color: var(--muted); font-weight: 600; }

.rankcard { margin: 0 16px; padding: 20px 0 6px; }
.rhead { display: flex; align-items: center; gap: 12px; padding: 0 20px 14px; }
.rhead h2 { flex: 1; font-size: 19px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.rhead .ic { width: 28px; height: 28px; }
.rankcard .chips { padding: 0 20px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; font-size: 17px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 52px; height: 32px; border-radius: 99px; background: var(--track); position: relative; flex: none; transition: background 0.2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(20px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.thead { display: grid; grid-template-columns: 1fr 92px 48px; padding: 10px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.thead span:last-child { text-align: right; }
.rrow { display: grid; grid-template-columns: auto 1fr 92px 48px; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.rrow:nth-child(even) { background: color-mix(in srgb, var(--chip) 35%, transparent); }
.list .rrow { grid-template-columns: auto 1fr auto 44px; padding: 12px 16px; }
.rinfo { min-width: 0; }
.rname { font-weight: 700; font-size: 16.5px; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.rpos { color: var(--muted); font-weight: 700; font-size: 13px; }
.ropp { font-size: 14px; font-variant-numeric: tabular-nums; }
.list .ropp { text-align: right; }
.ropp .pts { font-weight: 700; font-size: 16px; }
.rrank { text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }

/* badges and avatars */
.tbadge {
  display: inline-grid; place-items: center; height: var(--s); min-width: calc(var(--s) * 1.7); padding: 0 4px; border-radius: 5px;
  background: var(--tc); color: #fff; font-size: calc(var(--s) * 0.55); font-weight: 800; letter-spacing: 0.02em; line-height: 1; flex: none;
}
.tav {
  width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--tc); color: #fff; font-weight: 800; font-size: calc(var(--s) * 0.36); letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.tav.empty, .tav.add { background: var(--chip); box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }
.rav { position: relative; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: end center; background: color-mix(in srgb, var(--tc) 16%, var(--card)); color: var(--tc); overflow: visible; }
.rav svg { width: 84%; height: 84%; margin-bottom: 2%; }
.rav.empty { background: transparent; border: 2px dashed var(--line); place-items: center; color: var(--muted); }
.rstatus { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 5px; color: #fff; letter-spacing: 0.04em; }
.rstatus.q { background: var(--neg); }
.rstatus.dmg { background: #7a1020; }

/* team page */
.tabs { position: sticky; top: calc(64px + var(--safe-t)); z-index: 19; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs a { text-align: center; padding: 12px 4px 13px; font-weight: 700; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; border-bottom: 4px solid transparent; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.teampage { padding-top: 16px; }
.teamhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px; }
.th-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.th-l h1 { font-size: 25px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.th-l .inl { color: var(--accent-text); display: inline-grid; }
.th-r { text-align: right; }
.th-r .big { font-size: 34px; }
.tiles { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 16px 16px 4px; }
.tiles::-webkit-scrollbar { display: none; }
.tile { flex: none; min-width: 138px; background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 4px; align-items: center; position: relative; }
:root[data-theme="dark"] .tile { border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile { border: 1px solid var(--line); } }
.tile b { font-size: 16px; white-space: nowrap; }
.tile span { grid-column: 1 / -1; font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .dot { position: static; border: 0; width: 9px; height: 9px; }
.weekbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px; margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.weekbar span { font-weight: 700; font-size: 18px; color: var(--accent-text); }
.ibtn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent-text); }
.list { background: var(--card); }
.sechead { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); background: var(--bg); }
.srow { display: grid; grid-template-columns: 58px auto 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.slot { display: inline-grid; place-items: center; height: 34px; min-width: 52px; padding: 0 8px; border-radius: 999px; border: 2px solid var(--accent); color: var(--accent-text); font-weight: 800; font-size: 14px; }
.sinfo { min-width: 0; }
.sinfo .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sscore { text-align: right; font-variant-numeric: tabular-nums; }
.sscore .pts, .vpts .pts { font-weight: 700; font-size: 17px; }
.sscore .sub, .vpts .sub { font-size: 13px; }
.emptyslot .slot { border-style: dashed; }
.emptyslot a { color: var(--accent-text); font-weight: 600; }
.inset { margin: 0 16px 14px; padding: 14px 16px; }
.stathead, .statrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.stathead { font-weight: 700; font-size: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.stathead span:last-child, .statrow b:last-child { text-align: right; }
.statrow { padding: 8px 0; font-variant-numeric: tabular-nums; }
.statrow span { color: var(--muted); font-size: 14px; text-align: center; }

/* matchup */
.mchips { padding: 0 16px 14px; }
.mhead { background: var(--card); padding: 18px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.mhead .big { font-size: 38px; }
.moments-card { margin: 16px 0; padding: 16px; }
.moments-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.moments { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.moments::-webkit-scrollbar { display: none; }
.moment { flex: none; display: flex; align-items: center; gap: 10px; background: var(--chip); border-radius: 14px; padding: 8px 12px 8px 8px; }
.moment .rname { font-size: 14px; }
.moment .sub { font-size: 12.5px; }
.vlist { background: var(--card); }
.vsport { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.vrow { display: grid; grid-template-columns: 1fr 52px 1fr; border-bottom: 1px solid var(--line); }
.vslot { display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--chip); color: var(--muted); }
.vside { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 12px 10px; min-width: 0; }
.vside.right { text-align: right; }
.vinfo { min-width: 0; }
.vinfo .rname { font-size: 15px; }
.rname .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rname .tbadge { flex: none; }
.vside.right .vinfo .rname { justify-content: flex-end; }
.vinfo .sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vpts { font-variant-numeric: tabular-nums; flex: none; }
.vside.left .vpts { text-align: right; }

/* robots tab */
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); margin-bottom: 12px; color: var(--muted); }
:root[data-theme="dark"] .search { border: 1px solid var(--line); }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.robots-pad .toggle { padding: 14px 0; }
.teampage .pad > .toggle { padding: 14px 0; }
.addbtn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.addbtn.drop { border-color: var(--neg); color: var(--neg); }
.owned { width: 40px; height: 40px; border-radius: 50%; background: var(--chip); color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 800; }

/* league tab */
.iconcard { margin: 0 16px 16px; padding: 18px 0 16px; }
.cardtitle { font-size: 18px; font-weight: 800; text-transform: uppercase; padding: 0 20px; }
.iconcard .dotline { margin: 12px 20px 16px; }
.iconrow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
.iconrow::-webkit-scrollbar { display: none; }
.iconlink { flex: none; width: 88px; display: grid; justify-items: center; align-content: start; gap: 8px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--muted); line-height: 1.15; }
.circ { width: 64px; height: 64px; border-radius: 50%; background: var(--chip); color: var(--text); display: grid; place-items: center; }
.circ .ic { width: 28px; height: 28px; }
.flush { margin: 0 16px; overflow: hidden; padding: 0 0 8px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin: 14px 16px; border-radius: 999px; background: var(--chip); }
.seg > * { min-height: 40px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; font-size: 15.5px; color: var(--muted); }
.seg > .on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(7, 26, 51, 0.14); }
.seg.wide { margin: 4px 0 16px; }
.form .seg { margin: 10px 0 0; }
.tablehead { display: grid; grid-template-columns: minmax(0, 1fr) 50px 48px 30px; gap: 8px; padding: 10px 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tablehead span:not(:first-child) { text-align: right; }
.strow { display: grid; grid-template-columns: 26px auto minmax(0, 1fr) 50px 48px 30px; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.strow > span:nth-child(n + 4) { text-align: right; font-size: 14.5px; }
.strow.me { background: var(--hl); }
.rk { font-size: 15px; color: var(--muted); white-space: nowrap; }
.rk i { font-style: normal; font-size: 12px; margin-right: 1px; }
.stname { display: grid; min-width: 0; }
.stname b { color: var(--accent-text); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stname small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb { display: grid; gap: 10px; padding-top: 12px; padding-bottom: 6px; }
.sbcard { display: grid; gap: 8px; padding: 12px 14px; text-align: left; box-shadow: none; border: 1px solid var(--line); }
.sbline { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; color: var(--muted); }
.sbline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbline b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sbline.lead { color: var(--text); }
.bracket { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: center; }
.bcol { display: grid; gap: 12px; }
.blabel { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.bmatch { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bteam { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 14px; font-weight: 600; min-width: 0; }
.bteam + .bteam { border-top: 1px solid var(--line); }
.bteam span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seed { font-size: 12px; color: var(--muted); width: 12px; }

/* sub pages and forms */
.narrow { max-width: 640px; margin: 0 auto; padding: 8px 16px 0; display: grid; gap: 14px; }
.form { padding: 18px; display: grid; gap: 14px; }
.form h3 { font-size: 17px; font-weight: 800; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.form input, .form select { height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 14px; width: 100%; appearance: none; -webkit-appearance: none; }
.form select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; }
.form input:focus, .form select:focus { border-color: var(--accent); outline: none; }
.formnote { display: grid; gap: 2px; font-size: 14px; }
.formnote span { color: var(--muted); }
.form .sub { margin: 0; line-height: 1.45; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-size: 15px; }
.setrow span { color: var(--muted); }
.setrow b { text-align: right; }
.tbtn { color: var(--accent-text); font-weight: 700; font-size: 15px; min-height: 44px; text-align: left; }
.schrow, .actrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.schrow .stname { flex: 1; }
.wk { width: 64px; font-weight: 700; font-size: 14px; color: var(--muted); flex: none; }
.actrow span { flex: 1; font-size: 15px; }
.actrow small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.actrow .ic { color: var(--muted); }
.achgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ach { padding: 16px; display: grid; gap: 6px; justify-items: start; }
.ach .circ { width: 48px; height: 48px; color: var(--muted); }
.ach.earned .circ { background: var(--accent); color: #fff; }
.ach small { color: var(--muted); font-size: 13px; }
.ach .pill { height: 26px; font-size: 12px; }
.ach:not(.earned) { opacity: 0.72; }
.howsport { margin-top: 6px; }
.howsport h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 8px; }
.howpos { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.howpos span:last-child { display: grid; }
.howpos small { color: var(--muted); font-size: 13px; }
.chat { padding: 16px; display: grid; gap: 10px; }
.bubble { background: var(--chip); border-radius: 16px 16px 16px 4px; padding: 10px 14px; max-width: 80%; font-size: 15px; display: grid; gap: 2px; }
.bubble b { font-size: 12px; color: var(--muted); }
.bubble.me { justify-self: end; background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.bubble.me b { color: rgba(255, 255, 255, 0.8); }

.empty { text-align: center; padding: 28px 20px 24px; display: grid; justify-items: center; gap: 8px; }
.empty-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--chip); color: var(--accent-text); display: grid; place-items: center; margin-bottom: 4px; }
.empty-ic .ic { width: 30px; height: 30px; }
.empty h3 { font-size: 18px; font-weight: 800; }
.empty p { margin: 0; color: var(--muted); font-size: 15px; max-width: 320px; line-height: 1.45; }
.empty .sbtn { margin-top: 10px; }
.narrow > .empty { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* live bar and sheet */
.livebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px calc(20px + var(--safe-r)) calc(16px + var(--safe-b)) calc(20px + var(--safe-l));
  background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 24px rgba(7, 26, 51, 0.12); border-top: 1px solid var(--line);
}
.grab { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 9px; background: var(--line); }
.lb-title { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--accent); }
.lb-title b { color: var(--text); font-weight: 800; }
.lb-right { display: grid; justify-items: end; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-game { font-weight: 700; }
.lb-state { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 13, 28, 0.45); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 24px 16px calc(24px + var(--safe-b)); transform: translateY(100%); transition: transform 0.22s ease-out; max-width: 640px; margin: 0 auto;
}
#sheet-root.in .sheet { transform: none; }
#sheet-root.in .sheet-backdrop { opacity: 1; }
.sheet-handle { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 48px; height: 18px; }
.sheet-handle::after { content: ""; display: block; width: 40px; height: 5px; margin: 6px auto 0; border-radius: 9px; background: var(--line); }
.sheet-title { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin: 4px 4px 14px; }
.sheet-list { display: grid; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.sheet-item span:not(.tav) { flex: 1; display: grid; }
.sheet-item small { color: var(--muted); }
.sheet-item.on .ic { color: var(--accent); }
.gamelist { display: grid; grid-template-columns: 1fr; gap: 10px; }
.gcard { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; }
.gstate { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.gstate.live { color: var(--live); }
.gline { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; }
.gline b { font-size: 20px; font-variant-numeric: tabular-nums; }
.gline.lead { color: var(--text); }
.empty.small { padding: 20px 10px; }

#toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 60; max-width: calc(100% - 32px);
  background: var(--chip-on); color: var(--chip-on-text); padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* small phones */
@media (max-width: 370px) {
  .big { font-size: 34px; }
  .srow { grid-template-columns: 52px auto 1fr auto; gap: 10px; }
  .slot { min-width: 46px; }
  .wordmark { font-size: 22px; }
}

/* desktop */
@media (min-width: 900px) {
  .topbar, .sportrow, .tabs, .demo-flag { padding-left: max(16px, calc((100vw - 1120px) / 2)); padding-right: max(16px, calc((100vw - 1120px) / 2)); }
  .demo-flag { margin-left: auto; margin-right: auto; max-width: 1088px; padding: 8px 12px; }
  .home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1120px; margin: 0 auto; align-items: start; }
  .tabs { grid-template-columns: repeat(4, 160px); justify-content: start; }
  .teampage { max-width: 820px; margin: 0 auto; }
  .teampage .list, .teampage .vlist, .teampage .mhead, .teampage .weekbar { border-radius: 16px; margin-left: 16px; margin-right: 16px; border: 1px solid var(--line); overflow: hidden; }
  .livebar { max-width: 640px; margin: 0 auto; border: 1px solid var(--line); border-bottom: 0; }
  .rrow:hover, .strow:hover, .sheet-item:hover { background: var(--hl); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
