/* Independent v0.2 league page. Uses the existing Arena design tokens. */
#league-root { padding-bottom: 10px; }
.league-header { padding: 36px 0 23px; }
.league-header .eyebrow { margin-bottom: 10px; }
.league-header h1 { margin: 0 0 12px; color: var(--text,#eeeade); font-size: 31px; font-weight: 550; letter-spacing: -.035em; }
.league-header > p:last-child { max-width: 880px; margin: 0; color: #a9b39e; font-size: 13px; line-height: 1.9; }
.league-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 67px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.league-markets { display: flex; align-self: stretch; gap: 29px; }
.league-market { position: relative; display: flex; align-items: center; gap: 9px; padding: 10px 0; background: none; color: #8d9b82; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.league-market > span { color: #a5966b; font-size: 21px; }
.league-market small { margin-left: 1px; color: #849279; font-family: var(--font); font-size: 10px; }
.league-market.active { color: #e1cca0; }
.league-market.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--gold); content: ''; }
.league-refresh { font-size: 11px; }
.league-badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 17px 0; }
.league-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid #3b4633; border-radius: 3px; color: #a5b495; background: #172013; font-size: 9px; line-height: 1.5; white-space: nowrap; }
.league-badge.verified { border-color: #385846; color: #a7c6ac; background: #14251b; }
.league-badge.verified::before { width: 4px; height: 4px; border-radius: 50%; background: #7fb891; content: ''; }
.league-badge.neutral { border-color: #414331; color: #b4b79b; background: #202317; }
.league-badge.warning { border-color: #695737; color: #d2b981; background: #282416; }
.league-status { margin-bottom: 19px; padding: 18px 21px; border: 1px solid var(--line); border-radius: 7px; background: #141b13; }
.league-status-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.league-status-line > div { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }
.league-caption { margin: 4px 0 0; color: #93a184; font-size: 11px; line-height: 1.7; }
.league-time-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 17px; }
.league-time-item { min-width: 0; padding-right: 16px; border-right: 1px solid var(--line); }
.league-time-item:last-child { border-right: 0; }
.league-time-item > span { display: block; margin-bottom: 5px; color: #8d9d7e; font-size: 11px; }
.league-time-item strong { display: block; color: #c9d1b9; font-family: var(--mono); font-size: 11px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.league-status-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line); color: #8c9d7a; font-size: 11px; line-height: 1.8; }
.league-status-bottom b { color: #bfcaad; font-weight: 400; }
.league-run-errors { margin-top: 14px; color: #b8a27c; font-size: 11px; }
.league-run-errors summary { cursor: pointer; }
.league-run-errors p { margin: 10px 0 0; color: #b6aa91; overflow-wrap: anywhere; }
.league-run-errors time { color: #8c997d; }
.league-run-errors code { color: #d4b88d; font-size: 10px; }
.league-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(370px,1fr); align-items: stretch; gap: 19px; }
.league-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface,#121616); overflow: hidden; }
.league-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 21px 13px; }
.league-panel-title { margin: 0; color: #e0e3d1; font-size: 16px; font-weight: 550; }
.league-range { color: #b4b399; font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.league-overview-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; padding: 7px 21px 5px; }
.league-stat > span { display: block; margin-bottom: 6px; color: #96a687; font-size: 11px; }
.league-stat strong { color: #dce0ca; font-family: var(--mono); font-size: 24px; font-weight: 400; letter-spacing: -.045em; white-space: nowrap; }
.league-stat strong small { color: #91a27b; font-size: 11px; letter-spacing: 0; }
.league-chart { min-height: 286px; padding: 8px 12px 0; }
.league-chart > svg { display: block; width: 100%; height: auto; min-height: 240px; }
.league-chart svg text { fill: #8b9c7a; font-family: var(--mono); font-size: 10px; }
.league-grid-line { stroke: #2c3827; stroke-width: .7; }
.league-chart-baseline { stroke: #647054; stroke-width: .8; stroke-dasharray: 4 5; }
.league-single-point { margin: -10px 0 6px; text-align: center; }
.league-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 17px; padding: 5px 21px 16px; }
.league-legend-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: transparent; color: #acb99b; font-size: 10px; line-height: 1.6; }
.league-legend-button.muted { opacity: .5; }
.league-color-dot { display: inline-block; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--league-series-color,var(--gold)); }
.league-panel-note { margin: 0; padding: 13px 21px; border-top: 1px solid var(--line); color: #8a9d77; font-size: 10px; line-height: 1.9; }
.league-table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.league-rank-table { width: calc(100% - 34px); margin: 2px 17px 0; border-collapse: collapse; font-size: 11px; }
.league-rank-row th, .league-rank-row td { padding: 18px 4px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.league-rank-row th:nth-child(2) { text-align: left; }
.league-rank-row.heading th { padding-block: 10px; border-bottom-color: var(--line-strong); color: #8c9f78; font-size: 10px; font-weight: 400; white-space: nowrap; }
.league-rank-row:last-child td, .league-rank-row:last-child th { border-bottom: 0; }
.league-rank-row .league-rank-id { width: 25px; color: #959c7d; font-family: var(--mono); font-size: 10px; text-align: left; }
.league-rank-name { display: inline-flex; align-items: center; gap: 9px; padding: 0; background: none; color: #d1dac0; text-align: left; font-size: 12px; font-weight: 500; line-height: 1.6; }
.league-rank-name small { display: block; color: #849c71; font-family: var(--mono); font-size: 9px; font-weight: 400; }
.league-rank-name:hover { color: var(--gold-light); }
.league-number { color: #b8c3a5; font-family: var(--mono); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.league-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: #c8b580; font-size: 11px; line-height: 1.8; text-align: left; cursor: pointer; }
.league-link:hover { color: #ead6a2; text-decoration: underline; text-underline-offset: 3px; }
.league-section { margin: 25px 0 21px; }
.league-section > .league-panel-head { padding: 0 0 15px; }
.league-rules-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.league-rule-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #141c13; }
.league-rule-title { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.league-rule-title h3 { margin: 0; color: #d2dcc0; font-size: 14px; font-weight: 500; }
.league-rule-body { margin: 0 0 13px; color: #a5b595; font-size: 12px; line-height: 1.9; }
.league-recent { margin-bottom: 20px; }
.league-table { width: 100%; border-collapse: collapse; color: #acbc9b; font-size: 12px; text-align: left; }
.league-table th { padding: 12px 17px; border-bottom: 1px solid var(--line-strong); background: #172114; color: #a5b68e; font-size: 11px; font-weight: 500; white-space: nowrap; }
.league-table td { padding: 14px 17px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.8; }
.league-table tr:last-child td { border-bottom: 0; }
.league-table td small { display: block; margin-top: 4px; color: #8da179; font-family: var(--font); font-size: 10px; line-height: 1.7; }
.league-table .league-number { font-size: 11px; }
.league-table .league-reason { min-width: 260px; max-width: 560px; white-space: normal; }
.league-reason > p { margin: 0 0 8px; color: #b1c29f; font-size: 12px; line-height: 1.85; }
.league-reason details { max-width: 480px; }
.league-reason summary { color: #9baf84; font-size: 10px; cursor: pointer; }
.league-nowrap { white-space: nowrap; }
.league-action { display: inline-block; padding: 3px 7px; border: 1px solid #454e32; border-radius: 3px; color: #c2ba8d; background: #242919; font-size: 10px; line-height: 1.5; white-space: nowrap; }
.league-action.buy { border-color: #35583d; background: #172a1c; color: #9dc7a6; }
.league-action.sell { border-color: #624239; background: #2e211c; color: #d4a18e; }
.league-hash { display: block; max-width: 100%; padding: 10px 12px; margin: 8px 0; border: 1px solid #3d482e; border-radius: 4px; background: #111a0e; color: #a5ba8c; font-family: var(--mono); font-size: 11px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.league-method { padding: 19px 21px; }
.league-method > summary { color: #cdd8bb; font-size: 13px; cursor: pointer; }
.league-method-body { padding-top: 18px; margin-top: 16px; border-top: 1px solid var(--line); }
.league-source-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 6px; background: #172113; }
.league-source-card h3 { margin: 0 0 11px; color: #d0dcbc; font-size: 14px; font-weight: 500; }
.league-source-card h4 { margin: 16px 0 6px; color: #afc397; font-size: 11px; font-weight: 500; }
.league-source-card p { margin-bottom: 10px; color: #adbd9c; font-size: 12px; line-height: 1.9; white-space: pre-line; }
.league-source-card .league-caption { color: #8fa67a; font-size: 11px; }
.league-source-links { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 18px; margin-bottom: 12px; }
.league-source-list { margin: 18px 0 0; padding-left: 20px; }
.league-source-list li { padding-left: 3px; margin-bottom: 10px; color: #a6b996; font-size: 12px; line-height: 1.9; }
.league-note { margin: 0 0 20px; padding: 13px 16px; border: 1px solid rgba(195,173,120,.2); border-radius: 5px; background: rgba(195,173,120,.045); color: #bcb495; font-size: 12px; line-height: 1.9; }
.league-protocol { margin-bottom: 20px; padding: 14px 18px; border: 1px solid rgba(195,173,120,.15); border-radius: 6px; background: rgba(195,173,120,.025); }
.league-protocol > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; color: #9cab8a; font-size: 10px; }
.league-protocol code, .league-protocol b { margin-left: 4px; color: #cfbf93; font-family: var(--mono); font-size: 10px; font-weight: 400; }
.league-protocol > p { margin: 10px 0 0; color: #a8b596; font-size: 12px; line-height: 1.85; }
.league-method-body > .league-note:last-child { margin-top: 19px; margin-bottom: 0; }
.league-detail { margin-top: 28px; scroll-margin-top: 20px; }
.league-detail:focus { outline: none; }
.league-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; border-bottom: 1px solid var(--line); background: #182114; }
.league-detail-head .league-caption { margin: 0 0 5px; font-size: 10px; letter-spacing: .05em; }
.league-detail-head h2 { margin: 0; color: #dde4cf; font-size: 22px; font-weight: 500; }
.league-back { padding: 6px 0; background: none; color: #bdc2a5; font-size: 11px; white-space: nowrap; }
.league-back:hover { color: var(--gold-light); }
.league-detail-tabs { display: flex; gap: 27px; padding: 0 22px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; }
.league-detail-tab { position: relative; padding: 15px 0; border: 0; background: none; color: #91a57c; font-size: 12px; white-space: nowrap; }
.league-detail-tab.active { color: var(--gold-light); }
.league-detail-tab.active::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--gold); content: ''; }
.league-ledger { padding: 22px; }
.league-ledger > .league-caption { margin: 0 0 15px; }
.league-detail-overview { display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; gap: 20px; margin-bottom: 18px; }
.league-rule-text { white-space: pre-line; }
.league-key-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.league-key-value { padding: 13px 15px; border: 1px solid var(--line); border-radius: 5px; background: #172113; }
.league-key-value span { display: block; margin-bottom: 5px; color: #96ab80; font-size: 10px; }
.league-key-value strong { color: #d3dfc0; font-family: var(--mono); font-size: 17px; font-weight: 400; overflow-wrap: anywhere; }
.league-pager { display: flex; align-items: center; justify-content: space-between; gap: 17px; padding: 17px 0 0; color: #93a67e; font-size: 11px; }
.league-pager > div { display: flex; align-items: center; gap: 11px; }
.league-pager .button { font-size: 10px; }
.league-empty, .league-series-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 270px; padding: 32px 22px; color: #9aac88; text-align: center; }
.league-empty { border: 1px solid var(--line); border-radius: 8px; background: #141d12; }
.league-empty.compact { min-height: 150px; border: 0; background: transparent; }
.league-empty h2, .league-series-empty h3 { margin: 0 0 10px; color: #c6d3b2; font-size: 18px; font-weight: 500; }
.league-empty p, .league-series-empty p { max-width: 540px; margin: 0; color: #96aa82; font-size: 12px; line-height: 1.9; }
.league-empty-icon { display: block; margin-bottom: 20px; color: #b7a673; font-size: 35px; line-height: 1; }
.league-loading .league-empty-icon { animation: league-breathe 1.8s ease-in-out infinite; }
@keyframes league-breathe { 50% { opacity: .35; } }
.league-error { margin-bottom: 18px; padding: 16px 18px; border: 1px solid #62483a; border-radius: 6px; background: #281f18; color: #d0ae97; }
.league-error strong { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 500; }
.league-error p { margin: 0 0 7px; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.league-error p:last-child { margin-bottom: 0; }
.league-snapshot-panel { margin-top: 24px; scroll-margin-top: 20px; }
.league-snapshot-panel:focus { outline: none; }
.league-snapshot-label { margin: 19px 0 7px; color: #bccba5; font-size: 12px; font-weight: 500; }
.league-snapshot-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px 17px; margin: 16px 0; }
.league-snapshot-actions .league-caption { margin: 0; }
.league-json-details { margin: 18px 0; }
.league-json-details summary { color: #b6c7a0; font-size: 12px; cursor: pointer; }
.league-json { max-height: 360px; margin: 13px 0 0; padding: 15px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0d150a; color: #a5b98e; font-family: var(--mono); font-size: 11px; line-height: 1.8; white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; word-break: break-all; }
@media (max-width:1100px) {
  .league-grid { grid-template-columns: minmax(0,1.35fr) minmax(340px,1fr); gap: 15px; }
  .league-panel-head { padding-inline: 18px; }
  .league-stat strong { font-size: 21px; }
  .league-overview-metrics { padding-inline: 18px; gap: 10px; }
  .league-time-grid { gap: 13px; }
  .league-time-item { padding-right: 12px; }
  .league-time-item strong { font-size: 10px; }
}
@media (max-width:950px) {
  .league-grid { grid-template-columns: minmax(0,1fr); }
  .league-chart > svg { max-height: 320px; }
  .league-rank-row td, .league-rank-row th { padding-block: 17px; }
  .league-rank-row .league-number { font-size: 12px; }
  .league-rank-row th:nth-child(2) { width: 40%; }
  .league-rules-grid { gap: 12px; }
  .league-rule-card { padding: 17px; }
  .league-detail-overview { grid-template-columns: minmax(0,1fr); }
}
@media (max-width:767px) {
  .league-header { padding-top: 28px; padding-bottom: 21px; }
  .league-header h1 { font-size: 26px; }
  .league-header > p:last-child { font-size: 12px; }
  .league-topbar { min-height: 62px; gap: 13px; }
  .league-markets { gap: 22px; }
  .league-market { gap: 6px; font-size: 12px; }
  .league-market small { display: none; }
  .league-market > span { font-size: 19px; }
  .league-refresh { min-height: 31px; padding-inline: 9px; font-size: 10px; }
  .league-badges { gap: 6px; padding-block: 13px; }
  .league-badge { font-size: 8px; padding: 4px 6px; }
  .league-status { padding: 15px; }
  .league-status-line { flex-direction: column; align-items: flex-start; gap: 10px; }
  .league-status-line > .league-caption { font-size: 9px; }
  .league-time-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 12px; }
  .league-time-item:nth-child(2) { border-right: 0; }
  .league-time-item > span { font-size: 10px; }
  .league-time-item strong { font-size: 10px; }
  .league-status-bottom { flex-direction: column; align-items: flex-start; gap: 5px; font-size: 10px; }
  .league-panel-head { padding: 17px 16px 13px; }
  .league-panel-title { font-size: 14px; }
  .league-caption { font-size: 10px; }
  .league-overview-metrics { padding-inline: 16px; gap: 9px; }
  .league-stat > span { font-size: 9px; }
  .league-stat strong { font-size: 19px; }
  .league-stat strong small { font-size: 9px; }
  .league-chart { min-height: 220px; padding-inline: 6px; }
  .league-chart > svg { min-height: 200px; }
  .league-chart svg text { font-size: 11px; }
  .league-single-point { margin-top: 0; font-size: 9px; }
  .league-legend { gap: 8px 13px; padding-inline: 16px; }
  .league-legend-button { font-size: 9px; }
  .league-panel-note { padding: 12px 16px; font-size: 10px; }
  .league-rank-table { width: calc(100% - 28px); margin-inline: 14px; }
  .league-rank-row .league-optional { display: none; }
  .league-rank-row th:nth-child(2) { width: auto; }
  .league-rank-name { font-size: 12px; }
  .league-rank-row.heading th { font-size: 10px; }
  .league-rank-row td, .league-rank-row th { padding-block: 17px; }
  .league-rank-row .league-number { font-size: 12px; }
  .league-rules-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .league-rule-title { margin-bottom: 9px; }
  .league-rule-card { padding: 18px; }
  .league-rule-body { font-size: 12px; }
  .league-method { padding: 17px; }
  .league-method > summary { font-size: 12px; }
  .league-source-card { padding: 16px; }
  .league-source-card h3 { font-size: 13px; }
  .league-source-card p, .league-source-list li { font-size: 12px; }
  .league-note { padding: 12px 14px; font-size: 12px; }
  .league-hash { padding: 9px 10px; font-size: 10px; }
  .league-detail { margin-top: 22px; }
  .league-detail-head { padding: 17px; gap: 12px; }
  .league-detail-head h2 { font-size: 19px; }
  .league-detail-head .league-caption { font-size: 9px; }
  .league-back { font-size: 10px; }
  .league-detail-tabs { gap: 23px; padding-inline: 17px; }
  .league-detail-tab { padding-block: 13px; font-size: 11px; }
  .league-ledger { padding: 17px; }
  .league-key-values { gap: 10px; }
  .league-key-value { padding: 12px; }
  .league-key-value span { font-size: 9px; }
  .league-key-value strong { font-size: 16px; }
  .league-pager { flex-wrap: wrap; gap: 11px; font-size: 10px; }
  .league-pager > div { margin-left: auto; gap: 9px; }
  .league-pager .button { font-size: 9px; }
  .league-table th { padding-inline: 13px; font-size: 10px; }
  .league-table td { padding-inline: 13px; font-size: 11px; }
  .league-table .league-reason { min-width: 255px; }
  .league-reason p { font-size: 12px; }
  .league-empty, .league-series-empty { padding: 28px 18px; }
}
@media (max-width:380px) {
  .league-markets { gap: 15px; }
  .league-market { font-size: 11px; }
  .league-refresh { padding-inline: 7px; font-size: 9px; }
  .league-overview-metrics { gap: 7px; }
  .league-stat strong { font-size: 17px; }
  .league-stat > span { font-size: 8px; }
}
@media (prefers-reduced-motion:reduce) { .league-loading .league-empty-icon { animation: none; } }
