/* League pages, on top of the Gazette's styles.css. */
:root { --bg: var(--paper); --panel: transparent; --line: var(--rule); --accent: var(--ink); --champ: rgba(156, 124, 27, 0.16); }
.league-page h2 { margin-top: 24px; }
.league-page button { padding: 8px 14px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); cursor: pointer; }
.note { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.champ td { font-weight: 600; background: var(--champ); }
main details { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; padding: 8px 12px; }
main details .scroll { border: 0; margin-top: 8px; }
main summary { cursor: pointer; font-weight: 600; }
.games { list-style: none; padding: 0; margin: 8px 0 0; font-size: 15px; }
.games li { padding: 4px 0; border-top: 1px solid var(--line); }
.win { font-weight: 700; }
.weeks { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.weeks a { min-width: 32px; padding: 4px 6px; text-align: center; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.weeks a.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.stack label { font-weight: 600; }
input, textarea, .stack input, .callout input { padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); width: 100%; }
button { padding: 8px 14px; background: var(--accent); color: var(--bg); border: 1px solid var(--accent); border-radius: 4px; cursor: pointer; }
button.small { padding: 4px 10px; font-size: 14px; }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.4; cursor: default; }
.links { padding-left: 20px; }
.callout { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin-bottom: 12px; background: var(--champ); border-radius: 6px; }
.writer { display: grid; gap: 16px; align-items: start; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rank-list > li { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.rank-list > li.active { border-color: var(--accent); }
.rank-row { display: flex; align-items: center; gap: 8px; }
.handle { cursor: grab; touch-action: none; font-size: 22px; line-height: 1; padding: 8px 6px; color: var(--muted); user-select: none; }
.rank { width: 22px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.team-name { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); text-align: left; font-weight: 600; padding: 6px 4px; overflow-wrap: anywhere; }
.rank-row .small { background: transparent; color: var(--accent); padding: 4px 8px; }
.preview { margin: 2px 0 0 44px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview.empty { font-style: italic; }
.editor textarea { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); resize: vertical; }
.facts-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; min-width: 0; }
.slot-for-facts .facts-panel { margin-top: 8px; padding: 8px; border: 0; background: transparent; }
.facts-panel h2 { margin-top: 0; }
.facts-panel h3, .published h3 { font-size: 15px; margin: 16px 0 6px; }
.facts-panel table { font-size: 14px; }
.facts-panel th, .facts-panel td { padding: 5px 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--accent); }
td.down { color: #b3432f; }
main details.trade-card { margin: 0 0 8px; padding: 0; background: none; border: 0; border-radius: 0; }
.trade-card > summary { list-style: none; font-weight: 400; }
.trade-card > summary::-webkit-details-marker { display: none; }
.trade-fold { display: grid; grid-template-columns: repeat(var(--teams, 2), minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.trade-fold > * { padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
.trade-fold > h2 + h2, .trade-fold > .trade-pieces + .trade-pieces { border-left: 1px solid var(--line); }
.trade-card > summary .trade-fold h2 { margin: 0; font-size: 18px; border-bottom: 1px solid var(--line); }
.trade-fold h2:first-child::before { content: "\25B8\00A0"; }
.trade-card[open] .trade-fold h2:first-child::before { content: "\25BE\00A0"; }
/* An open trade becomes one framed block with a dark header, so it's clear where it starts and ends. */
main details.trade-card[open] { margin: 14px 0 22px; padding: 0 14px 16px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.trade-card[open] > summary { margin: 0 -14px 12px; }
.trade-card[open] .trade-fold { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.trade-card[open] > summary .trade-fold h2 { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.trade-pieces { font-size: 15px; }
main .trade-card .scroll { border: 1px solid var(--line); margin-top: 0; }
main .trade-card details .scroll { border: 0; margin-top: 8px; }
.league-page .head-to-head { table-layout: fixed; min-width: 0; }
.head-to-head th:first-child { width: 26%; }
.head-to-head th, .head-to-head td { white-space: normal; overflow-wrap: anywhere; padding: 7px 6px; }
.career-table { font-size: 14px; }
.career-table th, .career-table td { padding: 6px 6px; }
.career-table th.n { white-space: normal; }
.trade-sides { display: grid; gap: 0 20px; }
.trade-detail { min-width: 0; }
.trade-detail h3 { font-size: 16px; margin: 14px 0 6px; }
.trade-detail table { font-size: 14px; }
.trade-detail th, .trade-detail td { padding: 6px 7px; }
.trade-detail details { margin-top: 8px; padding: 8px; }
td.result { white-space: nowrap; }
@media (min-width: 900px) {
  main:has(.trade-sides) { max-width: 1320px; }
  /* Both teams share rows, so their games tables start level however many players each got. */
  .trade-sides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .trade-detail { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
}
td.flipped { color: #b3432f; font-weight: 600; }
@media (prefers-color-scheme: dark) { td.flipped { color: #ef8f7c; } }
.pick-trades { padding-left: 18px; font-size: 14px; }
.pick-trades li { margin-bottom: 6px; }
.move-title { font-weight: 700; font-size: 14px; margin: 10px 0 4px; }
.trade-side { font-size: 14px; margin: 8px 0 2px; }
.trade { border-top: 1px solid var(--line); margin-top: 8px; }
.what-if { font-size: 14px; margin: 4px 0 10px; overflow-wrap: anywhere; }
.what-if.flipped strong { color: #b3432f; }
@media (prefers-color-scheme: dark) { .what-if.flipped strong { color: #ef8f7c; } }
.savebar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
.savebar .note { flex: 1; min-width: 140px; margin: 0; }
.published { list-style: none; padding: 0; }
.published li { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px; margin-bottom: 6px; }
.blurb { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  main:has(.writer) { max-width: 1240px; }
  .writer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .facts-panel { position: sticky; top: 12px; max-height: calc(100vh - 90px); overflow-y: auto; }
}
@media (prefers-color-scheme: dark) { td.down { color: #ef8f7c; } }
.league-page .team-name { background: none; border: 0; color: var(--ink); padding: 6px 4px; }
.league-page .rank-row .small { background: transparent; color: var(--ink); border-color: var(--rule); padding: 4px 8px; }
.league-page tr.in-playoffs td { background: var(--champ); }
.league-page tr.playoff-line td { padding: 5px 10px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-align: left; }
.account-message { max-width: 620px; margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--ink); }
.account-message.error { border-left-color: var(--shame); color: var(--shame); }
.account-rows { max-width: 620px; margin: 0; border-top: 1px solid var(--rule); }
.account-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.account-row dt { color: var(--muted); font-size: 15px; }
.account-row dd { margin: 0; overflow-wrap: anywhere; }
.account-tools { display: flex; flex-direction: column; gap: 6px; }
.league-page .account-edit { margin: 6px 0 0; padding: 0; border: 0; background: none; }
.account-edit summary { font-size: 15px; font-weight: 400; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.account-edit .stack { margin-top: 12px; }
.account-logout { max-width: 620px; margin-top: 14px; }
.league-page button.link-button { padding: 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 520px) { .account-row { grid-template-columns: minmax(0, 1fr); } }
