/* Shared flat-design tokens; legacy stylesheets are no longer loaded. */
:root {
  color-scheme: light;
  --background: #fff;
  --foreground: #111827;
  --primary: #3b82f6;
  --primary-action: #1d4ed8;
  --primary-hover: #1e40af;
  --secondary: #10b981;
  --accent: #f59e0b;
  --muted: #f3f4f6;
  --muted-foreground: #374151;
  --border: #e5e7eb;
  --actual: #2563eb;
  --optimal: #047857;
  --radius: 8px;
  --radius-control: 6px;
  --space: 24px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 16px/1.5 var(--font); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
h1 { font-size: 48px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }
button, input, select, summary { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--primary-action); outline-offset: 4px; }
[tabindex='-1']:focus { outline: none; }
button:disabled { color: var(--muted-foreground); background: var(--muted); cursor: not-allowed; }
button:disabled:hover { transform: none; }
.skip-link { position: absolute; z-index: 5; top: 12px; left: 12px; padding: 12px 20px; background: var(--foreground); color: var(--background); transform: translateY(-160%); border-radius: var(--radius-control); }
.skip-link:focus { transform: translateY(0); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.app-header, main, .app-footer { max-width: 1280px; margin: auto; }
.app-header { display: flex; align-items: center; gap: 20px; padding: 20px 32px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--foreground); text-decoration: none; font-size: 22px; font-weight: 800; min-height: 48px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-control); background: var(--foreground); color: var(--background); font-size: 16px; letter-spacing: -.04em; }
.season-label { margin-left: auto; color: var(--muted-foreground); font-size: 14px; font-weight: 600; white-space: nowrap; }
.header-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 12px 20px; border: 0; border-radius: var(--radius-control); font-weight: 600; transition: transform .2s, background-color .2s; }
.primary { background: var(--primary-action); color: var(--background); }
.primary:hover:not(:disabled) { background: var(--primary-hover); transform: scale(1.03); }
.secondary { background: var(--muted); color: var(--foreground); }
.secondary:hover:not(:disabled) { background: var(--border); transform: scale(1.03); }
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--primary); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; }
.hero::before, .hero::after { content: ''; position: absolute; z-index: -1; background: #ffffff14; pointer-events: none; }
.hero::before { width: 320px; height: 320px; right: 55px; top: -160px; border-radius: 50%; }
.hero::after { width: 130px; height: 130px; right: 240px; bottom: -86px; transform: rotate(24deg); }
.hero h1 { color: var(--background); }
.hero .subhead { margin-top: 12px; max-width: 650px; font-weight: 500; }
.hero-number { flex: 0 0 108px; display: grid; place-items: center; padding: 16px; background: var(--background); border-radius: var(--radius); }
.hero-number strong { font-size: 60px; line-height: 1; font-weight: 800; }
.hero-number span, .hero-number small { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.page-content { padding: 24px 32px 32px; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.segmented { display: flex; align-items: center; background: var(--muted); border-radius: var(--radius-control); }
.segmented button { border: 0; background: transparent; min-width: 52px; min-height: 52px; border-radius: var(--radius-control); font-size: 20px; color: var(--foreground); }
.segmented button:hover:not(:disabled) { background: var(--border); }
.segmented button:disabled { color: #6b7280; }
.segmented span { font-weight: 600; padding: 0 16px; white-space: nowrap; }
.view-label { font-size: 14px; color: var(--muted-foreground); font-weight: 600; }
.notice { display: flex; align-items: center; gap: 12px; padding: 16px 20px; margin-bottom: 24px; background: #fef3c7; border-radius: var(--radius); font-size: 14px; }
.notice > span { font-size: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head p:not(.eyebrow) { font-size: 14px; color: var(--muted-foreground); margin-top: 8px; }
.week-scoreboard { background: var(--muted); padding: var(--space); border-radius: var(--radius); }
.scoreboard-head h2 { font-size: 32px; }
.scoreboard-teams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.scoreboard-team { min-width: 0; padding: 20px; background: var(--background); border: 0; border-radius: var(--radius); color: var(--foreground); text-align: left; transition: background-color .2s, transform .2s; }
.scoreboard-team:hover { background: #dbeafe; transform: scale(1.02); }
.scoreboard-identity { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.scoreboard-logo, .team-logo, .team-highlight-logo { position: relative; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; font-size: 13px; font-weight: 700; background: var(--background); color: var(--foreground); }
.scoreboard-logo { width: 40px; height: 40px; flex-basis: 40px; border-radius: var(--radius-control); background: var(--muted); }
.logo-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.scoreboard-logo img, .team-logo img, .team-highlight-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: var(--background); }
.scoreboard-name { font-size: 17px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.scoreboard-name small { display: block; font-size: 14px; font-weight: 400; color: var(--muted-foreground); margin-top: 5px; }
.scoreboard-result { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.matchup-score { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.team-score { font-size: 25px; font-weight: 800; }
.score-separator, .opponent-score { font-weight: 400; font-size: 21px; }
.scoreboard-outcome { margin-left: auto; align-self: center; padding: 4px 8px; font-size: 12px; font-weight: 700; border-radius: 4px; background: var(--secondary); }
.scoreboard-outcome.l { background: var(--muted); }
.scoreboard-outcome.t { background: var(--accent); }
.scoreboard-action { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--primary-hover); }
.weekly-scores { margin: 32px 0; }
.chart-legend { font-size: 14px; color: var(--muted-foreground); white-space: nowrap; padding-top: 4px; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; background: var(--actual); border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-legend .opt { background: var(--optimal); margin-left: 20px; }
.player-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 16px; padding: 24px 20px; background: var(--muted); border-radius: var(--radius); }
.chart-group { text-align: center; min-width: 0; }
.bar-values { display: grid; gap: 2px; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.bar-values span { display: flex; gap: 6px; justify-content: center; align-items: center; }
.bar-values i { display: inline-block; width: 8px; height: 8px; flex-shrink: 0; border-radius: 2px; background: var(--actual); }
.bar-values i.opt { background: var(--optimal); }
.chart-bars { height: 174px; display: flex; align-items: end; justify-content: center; gap: 8px; }
.chart-bars i { display: block; width: 26px; border-radius: 3px 3px 0 0; }
.actual-bar { background: var(--actual); }
.optimal-bar { background: var(--optimal); }
.chart-group b { display: block; font-size: 14px; line-height: 1.2; min-height: 38px; margin-top: 16px; overflow-wrap: anywhere; font-weight: 600; }
.perfect-label { display: block; color: var(--foreground); font-size: 12px; font-weight: 600; margin-top: 5px; }
.league-summary-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px; align-items: start; }
.highlights { padding: var(--space); background: var(--secondary); border-radius: var(--radius); }
.highlights h2 { margin-bottom: 24px; }
.highlight { display: flex; align-items: start; gap: 12px; margin-top: 24px; }
.highlight-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; background: var(--background); color: var(--optimal); }
.highlight b { display: block; font-size: 16px; font-weight: 700; }
.highlight div > span { display: block; font-size: 14px; margin-top: 4px; }
.league-season { min-width: 0; background: var(--muted); border-radius: var(--radius); overflow: hidden; }
.season-heading { background: var(--accent); padding: var(--space); }
.season-heading p:last-child { font-size: 14px; margin-top: 8px; }
.season-content { padding: var(--space); }
.season-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.season-card { background: var(--background); padding: 16px; border-radius: var(--radius); min-width: 0; }
.season-card span { display: block; font-size: 12px; color: var(--muted-foreground); font-weight: 600; }
.season-card strong { display: block; font-size: 17px; line-height: 1.2; margin: 8px 0 6px; overflow-wrap: anywhere; }
.season-card small { font-size: 13px; color: var(--muted-foreground); }
.sort-picker, .team-picker { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; max-width: 100%; }
select { border: 0; border-radius: var(--radius-control); background: var(--background); min-height: 44px; padding: 8px 12px; color: var(--foreground); max-width: 100%; }
.season-comparison { margin-top: 24px; padding: var(--space); background: var(--muted); border-radius: var(--radius); }
.season-column-heads, .season-score-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(120px, 2fr) repeat(3, 104px); align-items: center; gap: 20px; padding: 16px 20px; }
.season-column-heads { padding-top: 0; font-size: 14px; font-weight: 600; color: var(--muted-foreground); }
.season-column-heads > span:nth-child(n+3) { text-align: right; }
.season-column-heads .chart-legend { padding-top: 0; font-weight: 400; }
.season-score-rows { display: grid; gap: 8px; }
.season-score-row { background: var(--background); border-radius: var(--radius-control); }
.season-score-row > strong { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.season-bar-pair { display: grid; gap: 8px; min-width: 0; }
.season-bar-pair i { display: block; height: 10px; border-radius: 2px; }
.season-value { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.season-value strong { display: block; font-size: 20px; font-weight: 700; line-height: 1.25; }
.season-value small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted-foreground); }
.season-actual strong { color: var(--actual); }
.season-optimal strong { color: var(--optimal); }
.season-value-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.profile-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.team-picker { gap: 12px; font-weight: 600; }
.team-picker select { background: var(--muted); }
.team-title { padding: 32px; background: var(--primary); border-radius: var(--radius); }
.team-identity { display: flex; align-items: center; gap: 20px; }
.team-identity > div:last-child { min-width: 0; }
.team-logo { width: 64px; height: 64px; flex-basis: 64px; border-radius: var(--radius); }
.team-title h1 { color: var(--background); font-size: 40px; overflow-wrap: anywhere; }
.team-title p:last-child { margin-top: 12px; font-weight: 500; }
.score-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0 32px; }
.score-block { padding: 20px; background: var(--muted); border-radius: var(--radius); }
.score-block.optimal { background: var(--secondary); }
.score-block.points-left { background: var(--accent); }
.score-block strong { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0; line-height: 1; font-variant-numeric: tabular-nums; }
.score-block > span { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.score-block small { display: block; font-size: 13px; }
.profile-content { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px; align-items: start; }
.lineup-panel { min-width: 0; }
.lineup-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 54px; gap: 12px; padding: 16px; background: var(--muted); border-radius: var(--radius-control); margin-top: 8px; align-items: start; }
.lineup-row:nth-child(odd) { background: var(--border); }
.lineup-labels { background: var(--foreground) !important; color: var(--background); font-size: 12px; font-weight: 600; }
.pos { font-size: 12px; font-weight: 700; }
.player { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.player small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted-foreground); font-weight: 400; }
.player strong { display: block; font-size: 16px; margin-top: 5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta { text-align: right; font-size: 13px; font-weight: 600; }
.gain-label { display: none; }
.empty-player, .unavailable-player { font-weight: 600; }
.performance { background: var(--accent); padding: 24px; border-radius: var(--radius); min-width: 0; }
.performance-copy { font-size: 14px; margin: 12px 0 20px; overflow-wrap: anywhere; }
.performance-stats > div { background: var(--background); padding: 16px; border-radius: var(--radius-control); margin-top: 12px; }
.performance-stats span { font-size: 13px; display: block; color: var(--muted-foreground); }
.performance-stats strong { font-size: 28px; display: block; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.app-footer { background: var(--foreground); color: var(--background); padding: 24px 32px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.app-footer span:last-child { margin-left: auto; font-size: 12px; }
dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 0; border-radius: var(--radius); padding: 0; background: var(--background); color: var(--foreground); }
dialog::backdrop { background: #11182799; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 28px; background: var(--primary); }
.modal-head h2 { color: var(--background); font-size: 38px; }
.close-modal { display: grid; place-items: center; background: var(--background); border: 0; border-radius: var(--radius-control); min-width: 44px; min-height: 44px; color: var(--foreground); font-size: 28px; line-height: 1; }
.modal-content { padding: 28px; }
.modal-intro { display: flex; gap: 12px; padding: 16px; background: var(--muted); border-radius: var(--radius-control); font-size: 14px; margin-bottom: 20px; }
.modal-intro span { font-size: 20px; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.modal-content label { display: block; font-size: 14px; font-weight: 600; }
.modal-content input:not([type=checkbox]) { width: 100%; height: 56px; background: var(--muted); border: 2px solid transparent; border-radius: var(--radius-control); padding: 12px; margin-top: 8px; font-size: 16px; color: var(--foreground); outline: 0; }
.modal-content input:focus { border-color: var(--primary-action); background: var(--background); }
.private-fields { margin-top: 20px; }
.private-fields summary { min-height: 44px; font-weight: 600; padding: 10px 0; }
.private-fields label { margin-top: 12px; }
.remember { display: flex !important; gap: 12px; align-items: start; margin-top: 20px; cursor: pointer; }
.remember input { width: 20px; height: 20px; accent-color: var(--primary-action); flex: 0 0 20px; margin: 2px 0 0; }
.remember small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted-foreground); font-weight: 400; }
.credential-note { font-size: 13px; color: var(--muted-foreground); margin-top: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
#forget-connection { font-size: 14px; margin-right: auto; }
@media (max-width: 1000px) {
  .season-label { display: none; }
  .header-actions { margin-left: auto; }
  .scoreboard-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-chart { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .league-summary-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .team-title h1 { font-size: 36px; }
}
@media (max-width: 900px) {
  .season-column-heads { display: block; padding: 0 0 16px; }
  .season-column-heads > span:not(.chart-legend) { display: none; }
  .season-score-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .season-score-row > strong, .season-bar-pair { grid-column: 1 / -1; }
  .season-value { text-align: left; }
  .season-value-label { position: static; width: auto; height: auto; clip-path: none; white-space: normal; display: block; font-size: 13px; color: var(--muted-foreground); margin-bottom: 6px; }
}
@media (max-width: 800px) {
  .app-header { gap: 14px; }
  .league-summary-grid, .profile-content { grid-template-columns: 1fr; }
  .score-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-chart { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 520px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .app-header { padding: 20px; flex-direction: column; align-items: start; }
  .header-actions { margin-left: 0; gap: 8px; width: 100%; }
  .header-actions .button { padding: 12px; flex: 1; font-size: 14px; }
  .hero { padding: 24px 20px; align-items: start; gap: 16px; }
  .hero-number { flex-basis: 72px; padding: 12px; }
  .hero-number strong { font-size: 42px; }
  .hero-number span, .hero-number small { font-size: 12px; }
  .page-content { padding: 24px 16px; }
  .controls { gap: 12px; flex-wrap: wrap; }
  .scoreboard-teams { grid-template-columns: 1fr; }
  .week-scoreboard, .highlights, .season-content, .season-heading, .season-comparison { padding: 20px; }
  .season-score-row { padding: 16px 12px; gap: 12px; }
  .season-value strong { font-size: 18px; }
  .scoreboard-head h2 { font-size: 28px; }
  .player-chart { padding: 20px 12px; gap: 24px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .season-cards { grid-template-columns: 1fr; }
  .team-title { padding: 24px; }
  .team-identity { align-items: start; gap: 12px; }
  .team-logo { width: 44px; height: 44px; flex-basis: 44px; }
  .team-title h1 { font-size: 32px; }
  .score-block { padding: 16px; }
  .score-block strong { font-size: 28px; }
  .lineup-row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); padding: 12px; gap: 8px; }
  .delta { grid-column: 2 / -1; text-align: left; }
  .lineup-labels .delta { display: none; }
  .delta.zero { display: none; }
  .gain-label { display: inline; }
  .player { font-size: 13px; }
  .app-footer { padding: 24px 20px; align-items: start; flex-direction: column; gap: 8px; }
  .app-footer span:last-child { margin-left: 0; }
  .field-row { grid-template-columns: 1fr; }
  .modal-head, .modal-content { padding: 24px; }
  .modal-head h2 { font-size: 30px; }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
  #forget-connection { margin-right: 0; }
  .team-picker { width: 100%; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none !important; transform: none !important; }
}
