/* ============================================================
   FantasyGM — static site stylesheet.
   Mobile-first. CSS variables for theming. Tabular numerals.
   See DESIGN.md §0 for project palette + content rules.
   ============================================================ */

:root {
  /* Type stacks (system only — no web fonts). */
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
                "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Charter", "Source Serif 4", "Source Serif Pro",
                "Iowan Old Style", "Apple Garamond", "Palatino", "Georgia",
                "Times New Roman", serif;
  --font-mono:  ui-monospace, "SF Mono", "JetBrains Mono", Menlo,
                Consolas, monospace;

  /* Surface tokens — light theme. */
  --bg:           #f6f5f1;
  --surface:     #ffffff;
  --surface-2:   #ecebe5;
  --border:      #d9d6cc;
  --text:        #18171a;
  --text-muted:  #5d5a52;
  --accent:      #1f5fa1;
  --accent-soft: rgba(31, 95, 161, 0.09);

  /* Semantic tokens. */
  --bucket-guard:    #2563eb;
  --bucket-forward:  #d97706;
  --bucket-center:   #9d3b8b;
  --gap-strong:      #2e7d32;
  --gap-weak:        #c0392b;
  --gap-neutral:     var(--text-muted);
  --txn-add:         var(--gap-strong);
  --txn-drop:        var(--gap-weak);
  --txn-lineup:      var(--text-muted);
  --txn-trade:       #6f42c1;
  --txn-trade-fg:    #ffffff;

  font-feature-settings: "tnum", "ss01";
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg:           #0f0e10;
  --surface:     #1a1a1c;
  --surface-2:   #232326;
  --border:      #2e2e33;
  --text:        #f3f1eb;
  --text-muted:  #9e9a90;
  --accent:      #6aa3e0;
  --accent-soft: rgba(106, 163, 224, 0.14);

  --bucket-guard:    #60a5fa;
  --bucket-forward:  #fbbf24;
  --bucket-center:   #e879c7;
  --gap-strong:      #6dba71;
  --gap-weak:        #ef6f63;
  --txn-trade:       #b89bf0;

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 12px;
  border-radius: 6px; z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Topbar ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 0;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding-bottom: 10px;
}

.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-mark {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 24px; letter-spacing: -0.02em;
  color: var(--accent);
}
.brand-mark span { color: var(--text-muted); margin: 0 1px; }
.brand-tag {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}

.theme-toggle {
  background: transparent; border: 1px solid var(--border);
  width: 44px; height: 44px; border-radius: 8px;
  color: var(--text); font-size: 20px; line-height: 1;
  cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--surface-2); }

.meta-strip {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 8px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.meta-item { display: inline-flex; gap: 6px; align-items: baseline; }
.meta-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.meta-value { color: var(--text); font-weight: 600; }
.meta-captured { margin-left: auto; }

/* ---------- Main layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 64px;
  display: grid;
  gap: 16px;
  align-content: start;
}

/* Tab strip — primary navigation between Waivers / Team Needs / News /
   Transactions. Mobile-first: horizontal scroll if needed at narrow widths. */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent;
  border: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  min-height: 44px;
  flex-shrink: 0;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
@media (max-width: 420px) {
  .tab { padding-inline: 8px; }
}
.tab-panel { /* defaults; hidden attribute does the hiding */ }
.tab-panel[hidden] { display: none; }

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
[data-theme="dark"] .surface { box-shadow: 0 1px 3px rgba(0,0,0,0.4); }

.surface-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
}
.surface-sub {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ---------- Waiver list ---------- */

.waiver-list, .txn-list { list-style: none; padding: 0; margin: 0; }
.waiver-list { display: grid; gap: 8px; }

.waiver-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  grid-template-areas:
    "rank body schedule"
    "rank summary summary";
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  min-height: 44px;
}
.waiver-rank { grid-area: rank; align-self: center; }
.waiver-body { grid-area: body; }
.waiver-schedule { grid-area: schedule; }
.waiver-summary { grid-area: summary; }

/* AI "why pick them up" take on each waiver card. Clamped to 2 lines so
   the 30-deep list stays scannable; the modal shows the full text. */
.waiver-summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.waiver-summary-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.waiver-summary-badge {
  flex: none;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-soft, rgba(31, 95, 161, 0.12));
  color: var(--accent);
  text-transform: uppercase;
}
.waiver-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* Narrow screens: the two-block schedule eats the width and clips the
   player name. Drop it to its own row — rank spans both rows on the left,
   name + meta get the full width up top, schedule sits below left-aligned. */
@media (max-width: 480px) {
  .waiver-card {
    grid-template-columns: 24px 1fr;
    grid-template-areas:
      "rank body"
      "rank schedule"
      "summary summary";
    align-items: start;
    column-gap: 10px;
    row-gap: 10px;
  }
  .waiver-rank { align-self: center; }
  .waiver-schedule { justify-content: flex-start; }
  .waiver-schedule .week-block:first-child { padding-left: 0; }
}
.waiver-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.waiver-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}
button.waiver-name-text {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.waiver-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  display: inline-flex; gap: 8px; flex-wrap: wrap;
}
.waiver-sub .own-change { font-variant-numeric: tabular-nums; }
.own-pos { color: var(--gap-strong); }
.own-neg { color: var(--gap-weak); }
.waiver-schedule {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.week-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 0 8px;
  border-left: 1px solid var(--border);
  min-width: 56px;
}
.week-block:first-child { border-left: none; padding-left: 0; }
.week-pts {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}
.week-meta {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.week-meta.games-bye  { color: var(--text-muted); }
.week-meta.games-low  { color: var(--gap-weak); }
.week-meta.games-mid  { color: var(--text-muted); }
.week-meta.games-heavy { color: var(--gap-strong); }

/* ---------- Pills ---------- */

.pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex; align-items: center;
  white-space: nowrap;
}
.pill.outline { background: transparent; border: 1px solid currentColor; }
.pill.bucket-G { color: var(--bucket-guard); }
.pill.bucket-F { color: var(--bucket-forward); }
.pill.bucket-C { color: var(--bucket-center); }
.pill.team-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.fit-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  margin-left: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fit-pill.need {
  background: var(--gap-weak);
}
.fit-pill.returning {
  background: #b45309;
}

/* Footnote at the bottom of the Team Needs tab — explains the math. */
.surface-footnote {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.surface-footnote h3 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
}
.surface-footnote p { margin: 0 0 8px; }
.surface-footnote p:last-child { margin-bottom: 0; }
.surface-footnote em { font-style: italic; color: var(--text); }
.surface-footnote strong { color: var(--text); }
.surface-footnote .muted { color: var(--text-muted); font-size: 12px; }

/* Games-per-week chip — colored by tier so a glance tells you a player's
   opportunity floor. Heavy 4+ games is green; 1–2 is red; 3 is neutral. */
.games-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.games-pill.games-heavy { color: var(--gap-strong); border-color: var(--gap-strong); }
.games-pill.games-mid   { color: var(--text-muted); border-color: var(--border); }
.games-pill.games-low   { color: var(--gap-weak); border-color: var(--gap-weak); }
.games-pill.games-bye   { color: #fff; background: var(--text-muted); }

/* ---------- Team grid ---------- */

.team-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 14px;
  cursor: pointer;
  transition: border-color 90ms ease, transform 90ms ease;
  position: relative;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.team-card:hover { border-color: var(--accent); }
.team-card[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(31, 95, 161, 0.15);
}
@media (min-width: 640px) {
  .team-card[aria-expanded="true"] {
    grid-column: 1 / -1;
  }
}

.team-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 4px;
}
.team-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.team-abbr {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 4px;
  flex-shrink: 0;
}
.team-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex; gap: 10px; flex-wrap: wrap;
}

.bucket-rows { display: grid; gap: 4px; }
.bucket-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.bucket-row .pill { padding: 1px 6px; }
.bucket-bar {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bucket-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  border-radius: 999px;
}
.bucket-fill.top-need { background: var(--gap-weak); }
.bucket-fill.strong   { background: var(--gap-strong); }
.bucket-gap {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.bucket-gap.pos { color: var(--gap-strong); }
.bucket-gap.neg { color: var(--gap-weak); }
.bucket-gap.zero { color: var(--gap-neutral); }

.team-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
@media (min-width: 1024px) {
  .team-card[aria-expanded="true"] .team-detail {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 0 32px;
    align-items: start;
  }
}
.team-detail h4,
.team-detail-head {
  margin: 14px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.team-detail h4:first-child,
.team-summary h4 { margin-top: 0; }

/* Auto-generated summary block — accent left-border per DESIGN.md §11. */
.team-summary {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 10px 12px 10px 14px;
  margin-bottom: 8px;
}
.team-summary h4 {
  margin: 0 0 6px;
  font-size: 10px;
  color: var(--accent);
}
.team-summary-list {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.team-summary-list li { margin: 2px 0; }

/* Full-roster table inside the team pop-out. */
.roster-table {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}
.roster-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.roster-row.is-bench { color: var(--text-muted); }
.roster-row.is-bench .roster-name { font-weight: 400; }
.roster-row .roster-body {
  display: grid; gap: 2px; min-width: 0;
}
.roster-row .roster-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  font-weight: 500;
}
.roster-row .roster-sub {
  display: inline-flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}
.roster-row .roster-pts {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.slot-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  min-width: 36px;
  justify-content: center;
}
.slot-chip.slot-active {
  border-color: var(--accent);
  color: var(--accent);
}
.slot-chip.slot-bench {
  color: var(--text-muted);
  background: var(--surface-2);
}

/* Compact transaction list (in-pop-out variant). */
.txn-list.compact { gap: 6px; }
.txn-list.compact .txn-card { padding: 8px 10px; }
.txn-list.compact .txn-items { font-size: 12.5px; }
.team-targets { display: grid; gap: 4px; }
.team-target-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  grid-template-areas:
    "rank body bucket"
    "rank schedule schedule";
  gap: 4px 8px;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
}
.team-target-row .target-rank { grid-area: rank; align-self: start; padding-top: 2px; }
.team-target-row .target-body { grid-area: body; }
.team-target-row > .pill { grid-area: bucket; }
.team-target-row .target-schedule { grid-area: schedule; justify-content: flex-start; }
.team-target-row .target-schedule .week-block:first-child { padding-left: 0; border-left: none; }
.team-target-row .target-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.team-target-row .target-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.team-target-row .target-name {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
}
.team-target-row button.target-name-text {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-target-row .target-sub {
  display: inline-flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}
.team-target-row .target-schedule {
  gap: 6px;
}
.team-target-row .target-schedule .week-block {
  min-width: 44px;
  padding: 0 6px;
}
.team-target-row .target-schedule .week-pts {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* News cards — editorial layout: headline as a serif link, then meta + tags. */
.news-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid; gap: 4px;
}
.news-headline {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
}
.news-headline:hover { color: var(--accent); text-decoration: underline; }
.news-desc {
  margin: 0; color: var(--text-muted);
  font-size: 13px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.news-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px;
}
.news-player {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* ---------- Transactions ---------- */

.txn-list { display: grid; gap: 8px; }
.txn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.txn-head {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
  font-size: 12px;
  color: var(--text-muted);
}
.txn-type {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.txn-type.add    { color: var(--txn-add);    border: 1px solid var(--txn-add); }
.txn-type.drop   { color: var(--txn-drop);   border: 1px solid var(--txn-drop); }
.txn-type.lineup { color: var(--txn-lineup); border: 1px solid var(--border); }
.txn-type.trade  { color: var(--txn-trade);  border: 1px solid var(--txn-trade); }

.txn-time { font-variant-numeric: tabular-nums; }
.txn-items { display: grid; gap: 2px; font-size: 13px; }
.txn-item { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.txn-arrow { color: var(--text-muted); font-weight: 600; }

/* ---------- Loading / empty ---------- */

.loading, .muted-cell, .empty {
  font-style: italic;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.footer p { margin: 0; max-width: 1280px; margin-inline: auto; }
.footer code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--text); color: var(--bg);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 50;
  max-width: 90%;
}
.toast.visible { opacity: 1; }

/* ---------- Player-name button (modal trigger) ---------- */

/* The button looks like inline text by default; subtle underline-on-hover
   cues that it's actionable. Used inside waiver cards, roster rows,
   per-team targets, transaction items, and news tag pills. */
.player-name-btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 2px;
  text-decoration: none;
  text-underline-offset: 2px;
  text-decoration-color: transparent;
  transition: text-decoration-color 90ms ease, color 90ms ease;
}
.player-name-btn:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  color: var(--accent);
}
.player-name-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* News-player pills double as triggers; keep the pill chrome. */
.news-player.player-name-btn {
  cursor: pointer;
}
.news-player.player-name-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
/* Inside the transaction txn-item, the strong wrapper provides the bold; the
   button just supplies the click target. */
.txn-item strong .player-name-btn { font: inherit; color: inherit; }

/* ---------- Player detail modal ---------- */

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.player-modal[hidden] { display: none; }
.player-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
[data-theme="dark"] .player-modal-backdrop { background: rgba(0, 0, 0, 0.65); }
body.modal-open { overflow: hidden; }

.player-modal-panel {
  position: relative;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 18px 18px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 16px;
}
@media (min-width: 640px) {
  .player-modal-panel { padding: 22px 24px 20px; }
}

.player-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.player-modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.player-modal-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
}
.player-modal-photo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-modal-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-2);
}
.player-modal-photo.is-fallback {
  /* Use ::after via wrap for fallback glyph when img fails. */
  width: 0; height: 0;
}
.player-modal-photo-wrap::before {
  content: "—";
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 28px;
  position: absolute;
  opacity: 0;
}
.player-modal-photo.is-fallback ~ ::before,
.player-modal-photo-wrap:has(.player-modal-photo.is-fallback)::before {
  opacity: 1;
  position: static;
}

.player-modal-id { min-width: 0; }
.player-modal-name {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.player-modal-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.player-modal-pos { font-size: 11px; color: var(--text-muted); }
.player-modal-injury { font-size: 11px; }
.player-modal-status-line {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
}
.player-modal-status-fa { color: var(--accent); font-weight: 600; }

.player-modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px;
}
.player-modal-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}
.player-modal-stat-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.player-modal-stat-value {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.player-modal-stat-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* AI GM take — accented call-out panel above the news section. */
.player-modal-gmtake {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--accent-soft, rgba(31, 95, 161, 0.08));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
.player-modal-gmtake[hidden] { display: none; }
.player-modal-gmtake-h {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-modal-gmtake-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}
.player-modal-gmtake-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.gm-take-date {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}
.gm-take-date[hidden] { display: none; }
.gm-take-date--stale { color: var(--gap-weak, #c46b00); opacity: 1; }

/* Stale summary on waiver card: dim the whole row slightly */
.waiver-summary--stale .waiver-summary-text { opacity: 0.65; }
.waiver-summary--stale .waiver-summary-badge {
  background: var(--border);
  color: var(--text-muted);
}
/* Small date label on the waiver card next to the AI badge */
.waiver-summary-date {
  flex: none;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  margin-left: auto;
  white-space: nowrap;
}

.player-modal-section { display: grid; gap: 6px; }
.player-modal-section-h {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.recent-games-hint {
  margin-left: 6px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
  opacity: 0.7;
}

.player-modal-section-source {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: 6px;
}

.player-modal-news,
/* Recent games row */
.player-modal-recent-section { gap: 8px; }
.player-modal-recent-games {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.recent-game {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
}
.recent-game-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.recent-game-pill--high {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.recent-game-date {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
}
.recent-game-avg {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  /* Align with the number row, not the date caption below it. */
  margin: 5px 0 0 4px;
}

/* Unified social feed */
.player-modal-social {
  list-style: none;
  padding: 0;
  margin: 0;
}
.social-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.social-item:last-child { border-bottom: 0; }
.social-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.social-badge--reddit     { background: #ff4500; color: #fff; }
.social-badge--twitter    { background: #000; color: #fff; }
.social-badge--bluesky    { background: #0085ff; color: #fff; }
.social-badge--instagram  { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.social-title {
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.social-title:hover { color: var(--accent); text-decoration: underline; }
.social-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Compact news (no description, single-row layout) */
.player-modal-txns {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.player-modal-news {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}
.player-modal-news-item {
  padding: 5px 8px;
  border-left: 2px solid var(--border);
}
.player-modal-news-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.player-modal-news-headline {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.player-modal-news-headline:hover { color: var(--accent); text-decoration: underline; }
.player-modal-news-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.player-modal-news-team-tag {
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
}
.player-modal-news-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.player-modal-txn-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}
.player-modal-txn-head {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}
.player-modal-txn-body {
  font-size: 12.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.player-modal-reddit-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.player-modal-reddit-item:last-child { border-bottom: 0; }
.player-modal-reddit-title {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.player-modal-reddit-title:hover { color: var(--accent); text-decoration: underline; }
.player-modal-reddit-time {
  font-size: 11px;
  color: var(--text-muted);
}

.player-modal-twitter-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.player-modal-twitter-item:last-child { border-bottom: 0; }
.player-modal-twitter-title {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.player-modal-twitter-title:hover { color: var(--accent); text-decoration: underline; }
.player-modal-twitter-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.player-modal-twitter-handle {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.player-modal-twitter-time {
  font-size: 11px;
  color: var(--text-muted);
}

.player-modal-reddit-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.player-modal-reddit-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-modal-bluesky-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.player-modal-bluesky-item:last-child { border-bottom: 0; }
.player-modal-bluesky-title {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.player-modal-bluesky-title:hover { color: var(--accent); text-decoration: underline; }
.player-modal-bluesky-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.player-modal-bluesky-handle {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.player-modal-bluesky-time {
  font-size: 11px;
  color: var(--text-muted);
}

.player-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  gap: 8px;
  flex-wrap: wrap;
}
.player-modal-social-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.player-modal-social-link {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}
.player-modal-social-link--twitter    { background: #000; color: #fff; }
.player-modal-social-link--instagram  { background: #e1306c; color: #fff; }
.player-modal-social-link:hover { opacity: 0.82; }
.player-modal-espn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.player-modal-espn:hover { text-decoration: underline; }

/* ===== Trade Calculator ===== */

.trade-calc {
  padding: 0 0 4px;
}

.trade-calc-h {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  padding: 0 0 0 2px;
}

.trade-calc-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  padding: 0 2px;
}

.trade-calc-form {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 620px) {
  .trade-calc-form {
    grid-template-columns: 1fr;
  }
  .trade-calc-divider-col { display: none; }
}

.trade-calc-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-calc-team-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.trade-calc-team-sel {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.trade-calc-team-sel:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.trade-calc-players {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.trade-calc-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 10px 12px;
  margin: 0;
  font-style: italic;
}

.trade-calc-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 4px;
  transition: background 80ms ease;
}

.trade-calc-player:hover { background: var(--surface-2); }

.trade-calc-check-area {
  display: flex;
  align-items: center;
  min-width: 32px;
  min-height: 44px;
  cursor: pointer;
  flex: none;
}

.trade-calc-check { flex: none; cursor: pointer; }

.trade-calc-player-name {
  flex: 1;
  font-size: 0.84rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-calc-player-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--text-muted);
  flex: none;
}

.trade-calc-bench {
  font-size: 0.65rem;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

.trade-calc-divider-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 28px;
  font-size: 1.1rem;
  color: var(--text-muted);
  user-select: none;
}

.trade-calc-actions {
  display: flex;
  justify-content: center;
  padding: 14px 0 8px;
}

.trade-calc-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 28px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 120ms ease;
}

.trade-calc-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.trade-calc-btn:not(:disabled):hover { opacity: 0.86; }
.trade-calc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ===== Trade Calculator Result ===== */

.trade-calc-result { margin-top: 16px; }

.trade-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 620px) {
  .trade-result-grid { grid-template-columns: 1fr; }
}

.trade-result-side {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}

.trade-result-side--win  { border-color: var(--gap-strong); }
.trade-result-side--lose { border-color: var(--gap-weak);   }
.trade-result-side--even { border-color: var(--border);     }

.trade-result-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.trade-result-team {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.trade-result-verdict {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.trade-result-verdict--win  { background: var(--gap-strong); color: #fff; }
.trade-result-verdict--lose { background: var(--gap-weak);   color: #fff; }
.trade-result-verdict--even { background: var(--border);     color: var(--text-muted); }

.trade-result-movement {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.trade-result-player-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.trade-result-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trade-result-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex: none;
}

.trade-result-tag--out { background: var(--gap-weak);   color: #fff; }
.trade-result-tag--in  { background: var(--gap-strong); color: #fff; }

.trade-result-ppg {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trade-result-stats {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.trade-result-stat-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
}

.trade-result-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 76px;
  flex: none;
}

.trade-result-stat-before { color: var(--text-muted); }
.trade-result-stat-sep    { color: var(--text-muted); font-size: 0.75rem; }
.trade-result-stat-after  { font-weight: 600; }

.trade-result-delta {
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: auto;
}
.trade-result-delta--pos { color: var(--gap-strong); }
.trade-result-delta--neg { color: var(--gap-weak);   }
.trade-result-delta--zero{ color: var(--text-muted); }

.trade-result-ros-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 12px 10px;
  font-style: italic;
  border-bottom: 1px solid var(--border);
}

.trade-result-lineup {
  padding: 8px 12px 10px;
}

.trade-result-lineup-h {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.trade-result-lineup-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 0.82rem;
  border-radius: 4px;
}

.trade-result-lineup-row--new {
  background: color-mix(in srgb, var(--gap-strong) 10%, transparent);
  padding: 3px 4px;
  margin: 0 -4px;
}

.trade-result-slot {
  width: 36px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  flex: none;
}

.trade-result-bench-sep {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 6px 0 2px;
}

/* ===== Section separator ===== */

.trade-section-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.trade-section-sep::before,
.trade-section-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== Trade Scenarios ===== */

.trades-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px;
}

.trade-scenario {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

/* ----- Scenario header (always visible) ----- */
.trade-scenario-head {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 8px;
  cursor: default;
}

.trade-scenario-head-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.trade-scenario-team {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex: none;
}

.trade-scenario-title {
  font-size: 0.88rem;
  font-weight: 600;
  flex: 1;
}

.trade-best-ppg {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 3px;
}

.trade-scenario-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-basis: 100%;
  margin-top: 2px;
}

/* Toggle button (▶ / ▼) */
.trade-scenario-toggle {
  flex: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.trade-scenario-toggle:hover { background: var(--surface); }
.trade-scenario-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- Collapsible body ----- */
.trade-scenario-body {
  display: none;
  border-top: 1px solid var(--border);
}
.trade-scenario--open .trade-scenario-body {
  display: block;
}

/* ----- Offer list ----- */
.trade-offer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each offer is a column: summary row + collapsible detail panel */
.trade-offer {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.trade-offer:last-child { border-bottom: none; }
.trade-offer:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }

.trade-offer-summary {
  display: flex;
  gap: 10px;
  padding: 9px 14px;
  align-items: flex-start;
}

.trade-offer-rank {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  margin-top: 1px;
}

.trade-offer--rank1 .trade-offer-rank { background: #c9a227; color: #fff; }
.trade-offer--rank2 .trade-offer-rank { background: #9e9e9e; color: #fff; }
.trade-offer--rank3 .trade-offer-rank { background: #b87333; color: #fff; }

.trade-offer-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Chevron on the right of each offer row */
.trade-offer-chevron {
  flex: none;
  font-size: 0.65rem;
  color: var(--text-muted);
  align-self: center;
  padding-left: 4px;
}

/* ----- Offer detail panel (expanded) ----- */
.trade-offer-detail {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Per-player projection rows inside the detail */
.trade-offer-detail-players {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.trade-offer-player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  flex-wrap: wrap;
}

.trade-offer-stat {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.trade-offer-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  margin-right: 2px;
}

/* Impact grid inside the detail (reuses .trade-result-* styles) */
.trade-offer-detail-impact .trade-result-grid {
  margin-top: 0;
}

.trade-offer-detail-impact .trade-result-side {
  padding: 10px 12px;
}

.trade-offer-from {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trade-offer-pkg {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.88rem;
}

.trade-pkg-player {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.trade-pkg-ppg {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trade-pkg-plus {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 1px;
}

.trade-offer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.73rem;
}

.trade-pkg-total {
  font-weight: 600;
  color: var(--text-muted);
}

.trade-fair-badge {
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trade-fair-badge--even    { background: var(--gap-strong); color: #fff; }
.trade-fair-badge--slight  { background: var(--gap-neutral, var(--text-muted)); color: var(--surface); }
.trade-fair-badge--lean    { background: var(--border); color: var(--text-muted); }

.trade-fit-score {
  color: var(--text-muted);
}

.trade-no-offers {
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-style: italic;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
