/* The Run — styles. Dark slate, royal blue, amber accents, team colors on tags. */
:root {
  --bg: #10151D; --card: #1A222E; --raised: #222C3A; --deep: #0B0F15;
  --line: #2A3443; --line2: #3A4658;
  --ink: #E8ECF2; --soft: #C3CBD7; --muted: #9AA5B5; --faint: #6B7686;
  --blue: #2E5BBA; --blue-2: #4F7BE0; --blue-ink: #8CAEF5; --blue-tint: rgba(46, 91, 186, .16); --blue-tint2: rgba(46, 91, 186, .30);
  --amber: #F5B33D; --amber-tint: rgba(245, 179, 61, .18);
  --red: #F87171; --red-tint: rgba(239, 68, 68, .16);
  --green: #34D399; --green-tint: rgba(34, 197, 94, .16);
  --cond: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: Barlow, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--body); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
a { color: var(--blue-ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.shell { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(env(safe-area-inset-bottom, 0px) + 110px); display: flex; flex-direction: column; gap: 16px; }
.shell.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); }

.lab { font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.disp { font-family: var(--cond); font-weight: 700; line-height: 1.05; }
h1.disp { margin: 0; font-size: 34px; }
h2.disp { margin: 0; font-size: 20px; }
.muted { color: var(--muted); } .soft { color: var(--soft); } .small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.pad { padding: 14px 16px; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line2); border-radius: 12px; }

/* wordmark */
.wordmark { display: inline-flex; flex-direction: column; transform: skewX(-8deg); }
.wordmark .the { font-family: var(--cond); font-weight: 700; font-size: 20px; letter-spacing: .42em; color: var(--amber); line-height: 1; padding-left: 4px; }
.wordmark .run { font-family: var(--cond); font-weight: 700; font-size: 82px; line-height: .82; letter-spacing: -.01em; color: var(--ink); }
.tagline { font-family: var(--cond); font-weight: 600; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.brand-sm { font-family: var(--cond); font-weight: 700; font-style: italic; color: var(--amber); letter-spacing: .04em; }

/* buttons + inputs */
.btn { height: 52px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: 700 17px var(--body); display: flex; align-items: center; justify-content: center; text-decoration: none; width: 100%; padding: 0 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--blue-ink); height: 44px; font-weight: 600; font-size: 15px; }
.btn.venmo { background: #008CFF; }
.sm { height: 40px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); color: var(--ink); font: 600 14px var(--body); display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.sm.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.sm.danger { color: var(--red); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--soft); }
.input { height: 50px; border-radius: 10px; border: 1px solid var(--line2); background: var(--deep); color: var(--ink); font: 500 17px var(--body); padding: 0 14px; outline: none; width: 100%; min-width: 0; }
.input:focus { border-color: var(--blue-2); }
.input::placeholder { color: var(--faint); }
.error { color: var(--red); font-size: 14px; }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 22px); background: linear-gradient(180deg, rgba(16, 21, 29, 0) 0%, var(--bg) 28%); z-index: 4; }
.bottom-bar > div { max-width: 488px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.back { width: 44px; height: 44px; margin-left: -10px; display: flex; align-items: center; justify-content: center; color: var(--ink); background: none; border: 0; }

/* team tags */
.tm { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 20px; padding: 0 6px; border-radius: 4px; font-family: var(--cond); font-weight: 700; font-size: 12px; letter-spacing: .03em; color: #fff; vertical-align: 1px; box-shadow: inset 0 -3px 0 var(--s, transparent); background: var(--p, #444); flex: 0 0 auto; }
.chip-tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-weight: 700; font-size: 11px; letter-spacing: .06em; }
.you { background: var(--blue); color: #fff; }
.bye { background: var(--amber-tint); color: var(--amber); }
.outtag { background: var(--red-tint); color: var(--red); }
.paid { background: var(--green-tint); color: var(--green); }
.live { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 4px; background: var(--red-tint); color: var(--red); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.live::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }

/* tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 8px); }
.tabs > div { max-width: 520px; margin: 0 auto; display: flex; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 6px; min-height: 48px; color: var(--muted); text-decoration: none; font: 600 11px var(--body); background: none; border: 0; }
.tab.on { color: var(--blue-ink); }
.tab svg { width: 24px; height: 24px; }

/* home */
.hero-rank { font-family: var(--cond); font-weight: 700; font-size: 64px; line-height: .85; }
.pips { display: flex; gap: 3px; }
.pip { width: 22px; height: 6px; border-radius: 3px; background: var(--green); }
.pip.out { background: var(--line); }
.bug { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; text-decoration: none; color: var(--ink); }
.bugrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; height: 36px; padding-right: 12px; }
.bugrow .ab { height: 36px; display: flex; align-items: center; justify-content: center; font-family: var(--cond); font-weight: 700; font-size: 15px; color: #fff; background: var(--p); box-shadow: inset 5px 0 0 var(--s); }
.bugrow .sc { font-family: var(--cond); font-weight: 700; font-size: 22px; }
.bugrow.lost { color: var(--muted); }
.bug .side { padding: 0 12px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 4px; border-left: 1px solid var(--line); min-width: 84px; }
.yp { font-size: 14px; color: var(--soft); padding: 8px 12px 10px; border-top: 1px solid var(--line); grid-column: 1 / -1; }
.yp b { color: var(--ink); }

/* build lineup */
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.slot { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 9px; display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; color: var(--ink); }
.slot .pos { font-weight: 700; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.slot .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.empty { background: transparent; border: 1.5px dashed var(--line2); }
.slot.empty .nm { color: var(--faint); font-weight: 500; }
.slot.active { border: 1.5px solid var(--blue-2); background: var(--blue-tint); }
.slot.active .nm, .slot.active .pos { color: var(--blue-ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: 0 0 auto; height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 17px; background: var(--card); color: var(--soft); font: 600 14px var(--body); display: flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prow .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prow .nm { font-weight: 600; font-size: 16px; }
.prow .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.add { width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--blue-2); background: var(--card); color: var(--blue-ink); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.add.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* review + lineup lists */
.lrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .pos { font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.lrow .nm { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lrow .nm span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* live */
.seg { display: flex; gap: 2px; background: var(--deep); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 13px var(--body); white-space: nowrap; padding: 0 4px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.teambar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; height: 48px; padding: 0 16px 0 20px; color: #fff; background: var(--p); box-shadow: inset 6px 0 0 var(--s); }
.teambar .nm { font-family: var(--cond); font-weight: 700; font-size: 21px; }
.teambar .sc { font-family: var(--cond); font-weight: 700; font-size: 32px; }
.teambar.lost { opacity: .55; }
.statusbar { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; height: 32px; background: var(--raised); color: var(--soft); font-family: var(--cond); font-weight: 600; font-size: 15px; }
.fphead { display: grid; grid-template-columns: minmax(0, 1fr) 58px 40px; gap: 8px; padding: 10px 14px 6px; }
.fp { display: grid; grid-template-columns: minmax(0, 1fr) 58px 40px; gap: 8px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.fp .nm { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fp .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fp .who { font-size: 12px; color: var(--muted); text-align: right; }
.fp .pts { font-family: var(--cond); font-weight: 700; font-size: 22px; text-align: right; }
.fp.me { background: var(--blue-tint); box-shadow: inset 4px 0 0 var(--blue-2); }
.fp.me .pts { color: var(--blue-ink); }

/* standings */
.st { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 54px; padding-right: 12px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.st .rk { font-family: var(--cond); font-weight: 700; font-size: 20px; color: var(--muted); text-align: center; }
.st .nm { font-weight: 600; font-size: 16px; }
.st .pp { display: flex; gap: 2px; margin-top: 5px; }
.st .pp span { width: 12px; height: 4px; border-radius: 2px; background: var(--green); }
.st .pp span.o { background: var(--line); }
.st .pt { font-family: var(--cond); font-weight: 700; font-size: 24px; text-align: right; line-height: 1; }
.st .mv { display: block; font-weight: 600; font-size: 12px; text-align: right; color: var(--muted); margin-top: 2px; }
.st .up { color: var(--green); } .st .dn { color: var(--red); }
.st.top .rk { color: var(--amber); }
.st.me { background: var(--blue-tint2); border-radius: 10px; border-bottom-color: transparent; box-shadow: inset 4px 0 0 var(--blue-2); }
.st.me .rk { color: var(--blue-ink); }

/* lineup detail */
.lg { display: grid; grid-template-columns: 38px minmax(0, 1fr) repeat(var(--cols, 1), 30px) 40px; gap: 6px; align-items: center; }
.lg.head { padding-bottom: 6px; } .lg.head span:nth-child(n+3) { text-align: right; }
.lg.ln { padding: 8px 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; color: var(--ink); text-align: left; }
.lg .pos { font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.lg .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg .stt { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.lg .n { font-family: var(--cond); font-weight: 600; font-size: 17px; text-align: right; color: var(--soft); }
.lg .t { font-family: var(--cond); font-weight: 700; font-size: 22px; text-align: right; }
.lg .lv { color: var(--red); }
.lg.out { opacity: .5; } .lg.out .nm { text-decoration: line-through; }
.why { grid-column: 2 / -1; font-size: 12px; color: var(--muted); padding-top: 4px; }

/* league */
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stats3 .panel { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.stats3 .v { font-family: var(--cond); font-weight: 700; font-size: 28px; line-height: 1; }
.pay { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay:last-child { border-bottom: 0; }
.teamgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.teamgrid button { height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: var(--deep); color: var(--muted); font: 700 13px var(--cond); }
.teamgrid button[aria-pressed="true"] { background: var(--p); color: #fff; border-color: transparent; box-shadow: inset 0 -3px 0 var(--s); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 10; max-width: calc(100% - 32px); }
.check { width: 56px; height: 56px; border-radius: 28px; background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
