/* sections.css - Stats/Tools section tab strips, "Notable statistics", Trending and the side-by-side Feed.
   Kept apart from style.css so it doesn't collide with other open changes to that file. */
/* The tab strip never scrolls sideways: tabs wrap onto a second row when they don't fit. */
.section-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--border); margin: 0 0 18px; }
.section-tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; flex: 0 0 auto; margin-bottom: -1px; }
@media (max-width: 640px) { .section-tabs a { padding: 7px 9px; font-size: 14px; } }
.section-tabs a:hover { color: var(--text); text-decoration: none; }
.section-tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.oo-card { margin-bottom: 18px; }
.oo-card h2 { margin-top: 0; }
.oo-card h3 { font-size: .95rem; margin: 12px 0 6px; }
.oo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.oo-list { list-style: none; margin: 0; padding: 0; }
.oo-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.oo-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oo-num { text-align: right; display: flex; flex-direction: column; white-space: nowrap; }
.oo-up .oo-num b { color: var(--good, #3fb950); }
.oo-down .oo-num b { color: var(--bad, #f85149); }
.trend-card .eyebrow { display: block; margin-bottom: 4px; }
.trend-card h3 { font-size: 1rem; }

/* Lineup builder: let the roster column shrink on phones (it used to push the page wider than the screen). */
.lb-grid > * { min-width: 0; }
@media (max-width: 860px) { .lb-grid { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 720px) {
  .oo-cols { grid-template-columns: 1fr; gap: 4px; }
}

/* Feed: saved players | saved teams side by side on desktop; tabs on phones (Players first). Each card collapses. */
.feed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.feed-col > h2 { margin: 0 0 10px; }
.feed-col h3 { margin: 16px 0 8px; font-size: 1rem; }
.feed-col .prediction-feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.feed-tabs { display: none; }
.feed-prompt h3 { margin-top: 0; }
.perf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.perf-card { padding: 12px 14px; }
.perf-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.perf-rank { font-weight: 800; color: var(--muted); min-width: 1.2em; }
.perf-gs { margin-left: auto; }
.perf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.perf-tag { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
.perf-tag.career { outline: 1px solid var(--accent); }
.perf-tag.career.soft { outline-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.perf-tag.soft { background: var(--panel-2, rgba(127,127,127,.15)); color: var(--muted); }
.perf-text { margin: 8px 0 4px; }
@media (max-width: 900px) {
  .feed-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
  .feed-grid { grid-template-columns: minmax(0, 1fr); }
  .feed-grid[data-view="players"] #feed-teams, .feed-grid[data-view="teams"] #feed-players { display: none; }
  .feed-col > h2 { display: none; }
}

/* ---- Reports: "Interesting trends" carousel (3 boxes on desktop, 2 on tablets, 1 on phones) ----
   The arrows sit above the boxes (top right), so the boxes get the full width. */
.tcar { position: relative; }
.tcar-btn { position: absolute; top: -44px; }
.tcar-prev { right: 42px; }
.tcar-next { right: 0; }
.trends-section > h2 { padding-right: 90px; }
.tcar-viewport { overflow: hidden; }
.tcar-track { --gap: 12px; display: flex; gap: var(--gap); list-style: none; margin: 0; padding: 0; will-change: transform; }
.tcar-item { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); margin: 0; min-height: 112px; display: flex; align-items: center; }
@media (min-width: 721px) and (max-width: 1019px) { .tcar-item { flex-basis: calc((100% - var(--gap)) / 2); } }
.tcar-item p { margin: 0; line-height: 1.45; }
.tcar-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel, transparent); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.tcar-btn:hover { border-color: var(--accent); }
.tcar.tcar-static .tcar-btn { visibility: hidden; }
@media (max-width: 720px) { .tcar-item { flex-basis: 100%; } .tcar-btn { width: 30px; height: 30px; top: -40px; } .tcar-prev { right: 38px; } }
@media (prefers-reduced-motion: reduce) { .tcar-track { transition: none !important; } }
.report-foot { margin-top: 18px; }
.reports-head { justify-content: flex-start; }

/* ---- Predictions: "Show 5 more" and the experimental footnote ---- */
.tp-more { margin-top: 8px; width: 100%; }
.exp-footnote { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--border); }
.exp-footnote .experimental-note { font-size: 12px; margin: 0; color: var(--muted); }

/* ---- Team-color stripes: 3 diagonal bands (primary, secondary, primary) on the right part of a box.
   --stripe-w is how much of the box they cover. Without a team (.neutral or no variables) they use quiet theme greys. ---- */
.team-stripes { position: relative; overflow: hidden; isolation: isolate;
  --st1-n: color-mix(in srgb, var(--muted) 30%, transparent); --st2-n: color-mix(in srgb, var(--muted) 16%, transparent); }
.team-stripes::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: var(--stripe-w, 33.4%); z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 0 18%, var(--st1, var(--st1-n)) 18% 40%, transparent 40% 45%,
    var(--st2, var(--st2-n)) 45% 67%, transparent 67% 72%, var(--st3, var(--st1-n)) 72% 100%);
  opacity: .9; }
[data-theme="light"] .team-stripes::after { opacity: .85; }
.team-stripes.neutral::after { --st1: var(--st1-n); --st2: var(--st2-n); --st3: var(--st1-n); }
.tcar-item.team-stripes > p { position: relative; flex: 0 0 auto; width: calc(66.6% - 8px); }   /* text stays left of the stripes */

/* Player profile header: name and facts on the left, stripes on the right half, room kept for a future headshot. */
.profile-head.team-stripes { --stripe-w: 50%; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); padding: 16px 18px; align-items: flex-start; }
.profile-head .profile-main { min-width: 0; flex: 1 1 auto; position: relative; }
.profile-head .head-tools { position: relative; z-index: 1; }
.profile-head .headshot-slot { flex: 0 0 120px; height: 120px; }      /* empty on purpose: future headshot */
.measure-line { margin: 2px 0 6px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.measure-line b { color: var(--text); font-weight: 600; }
.measure-line .dot { opacity: .6; }
@media (max-width: 900px) { .profile-head .headshot-slot { flex-basis: 72px; height: 72px; } }
@media (max-width: 640px) { .profile-head .headshot-slot { display: none; } .profile-head.team-stripes { --stripe-w: 38%; padding: 12px; } }
/* Illustrated headshot in the reserved slot (right side). Hidden entirely if the image fails. */
.profile-head .headshot-slot { position: relative; z-index: 1; }
.profile-head .headshot { display: block; width: 100%; height: 100%; border-radius: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
@media (max-width: 640px) { .profile-head .headshot-slot { display: block; flex: 0 0 56px; height: 56px; margin-left: auto; } .profile-head .headshot { border-radius: 8px; } }
.profile-head .headshot-slot.no-shot { display: none; }
.profile-head .profile-name, .profile-head .sub, .profile-head .measure-line { text-shadow: 0 0 6px var(--panel), 0 0 2px var(--panel); }

/* Feed cards: header with name, team and a chevron; the body collapses. */
.feed-settings { margin-bottom: 16px; display: grid; gap: 12px; }
.feed-save > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.feed-save > summary::-webkit-details-marker { display: none; }
.feed-save > summary h2 { margin: 0; font-size: 1.1rem; }
.feed-save > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: auto; align-self: center; transition: transform .15s; }
.feed-save[open] > summary::after { transform: rotate(-135deg); }
.feed-save[open] > summary { margin-bottom: 10px; }
.feed-items { display: grid; gap: 12px; }
.feed-item { padding: 12px 14px; }
.fi-head { display: flex; align-items: center; gap: 8px; }
.fi-head h3 { margin: 0; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.fi-toggle { margin-left: auto; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fi-toggle:hover { border-color: var(--accent); }
.fi-toggle .chev { width: 8px; height: 8px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: rotate(-135deg) translate(-2px, -2px); transition: transform .15s; }
.fi-toggle[aria-expanded="false"] .chev { transform: rotate(45deg) translate(-2px, -2px); }
.fi-body { margin-top: 8px; }
.fi-sub { font-weight: 700; font-size: .9rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fi-avgs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: .92rem; }
.fi-insights { display: grid; gap: 8px; margin-top: 10px; }
.fi-insight { border-top: 1px solid var(--border); padding-top: 8px; }
.fi-insight .eyebrow { display: block; margin-bottom: 2px; }
.fi-insight p { margin: 4px 0; }
.feed-empty { margin: 0; }

/* Clickable stat rows (open the ranking of every player or team). */
.prow.clickable { cursor: pointer; border-radius: 6px; }
.prow.clickable:hover, .prow.clickable:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.stat-card.clickable:focus-visible { outline: 2px solid var(--accent); }
/* Top performers on Stats and Reports: the Feed's box cards, two or more per row on wide screens. */
#top-performers .perf-list, .report-section .perf-list { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
#top-performers .perf-card { background: var(--panel-2); }
/* Compare: one row per pick with its season (or range of seasons). */
.cmp-picks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.cmp-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cmp-season { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.cmp-add { min-width: min(320px, 100%); max-width: 100%; }
.cmp-when { font-weight: 500; }
