:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #10141b;
  --panel-2: #151b24;
  --line: #29313d;
  --text: #f5f7fa;
  --muted: #9ba6b5;
  --red: #e30613;
  --target: #f2c94c;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 85% 0%, #3b0b12 0, transparent 28rem), var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select, input { font: inherit; }
.shell { width: min(1440px, 100%); margin: 0 auto; padding: 32px clamp(16px, 4vw, 64px) 48px; }
.masthead { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: #ff6470; font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
h1, h2 { margin: 0; letter-spacing: -.045em; line-height: .98; }
h1 { max-width: 820px; font-size: clamp(2.25rem, 6vw, 5.4rem); }
h1 span { color: #ff3442; }
.intro { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.masthead-stats { display: grid; grid-template-columns: minmax(220px, 1fr) 170px; gap: 10px; }
.standing-card { display: grid; grid-template-columns: 1fr auto; align-items: center; min-width: 230px; padding: 15px 18px; border: 1px solid #8f2c3555; border-radius: 18px; background: linear-gradient(145deg, #2a1217, #12151b); }
.standing-card span, .standing-card small { color: var(--muted); }
.standing-card > div:first-child span { display: block; font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.standing-card > div:first-child strong { display: block; margin-top: 3px; color: #ff5965; font-size: 2rem; line-height: 1; }
.standing-points { text-align: right; }
.standing-points strong, .standing-points span { display: block; }
.standing-points strong { color: #fff; font-size: 1.65rem; line-height: 1; }
.standing-points span { margin-top: 3px; font-size: .72rem; }
.standing-card > small { grid-column: 1 / -1; margin-top: 10px; padding-top: 9px; border-top: 1px solid #ffffff12; font-size: .72rem; }
.target-card { min-width: 170px; padding: 20px 22px; border: 1px solid #564916; background: linear-gradient(145deg, #26220f, #11130f); border-radius: 18px; }
.target-card strong { display: block; color: var(--target); font-size: 3rem; line-height: .9; }
.target-card span, .target-card small { display: block; }
.target-card span { margin-top: 9px; font-weight: 750; }
.target-card small { margin-top: 4px; color: #c9bb7f; }
.dashboard, .detail-panel { border: 1px solid #202733; border-radius: 22px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 26px 90px #0008; overflow: hidden; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 240px) minmax(180px, 220px) auto; align-items: end; gap: 20px; padding: 18px 22px; border-bottom: 1px solid #202733; }
.toolbar-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter, .reset { border: 1px solid #354050; border-radius: 999px; color: var(--text); background: #151b24; cursor: pointer; transition: .18s ease; }
.filter { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; }
.filter::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--season); box-shadow: 0 0 0 3px color-mix(in srgb, var(--season) 20%, transparent); }
.filter[aria-pressed="false"] { opacity: .42; filter: grayscale(.75); }
.filter:hover, .filter:focus-visible, .reset:hover, .reset:focus-visible { border-color: #6d7b8f; transform: translateY(-1px); }
.reset { padding: 8px 13px; color: #c8d0dc; white-space: nowrap; }
.cutoff-control { min-width: 0; }
.cutoff-row { display: grid; grid-template-columns: minmax(120px, 1fr) 48px; align-items: center; gap: 12px; }
.cutoff-row input { width: 100%; accent-color: #ff3442; cursor: pointer; }
.cutoff-row output { display: grid; place-items: center; min-height: 34px; border: 1px solid #4d596b; border-radius: 8px; background: #171e28; color: #fff; font-weight: 850; }
.chart-wrap { position: relative; min-height: 540px; padding: 10px 12px 0; }
#chart { display: block; width: 100%; height: 540px; overflow: visible; }
.grid-line { stroke: #222a35; stroke-width: 1; }
.axis-line { stroke: #475365; stroke-width: 1; }
.axis-label { fill: #8793a3; font-size: 12px; }
.axis-title { fill: #b4bdc9; font-size: 12px; font-weight: 700; }
.target-line { stroke: var(--target); stroke-width: 2.2; stroke-dasharray: 8 7; opacity: .95; }
.target-label { fill: var(--target); font-size: 12px; font-weight: 800; }
.cutoff-line { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 3 5; opacity: .55; }
.cutoff-label { fill: #e8edf4; font-size: 11px; font-weight: 850; }
.season-segment { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s; }
.season-hit { fill: none; stroke: transparent; stroke-width: 18; cursor: crosshair; }
.point { stroke: var(--bg); stroke-width: 2; cursor: pointer; }
.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid #202733; }
.summary-card { padding: 18px; border-right: 1px solid #202733; }
.summary-card:last-child { border-right: 0; }
.summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.summary-top strong { font-size: 1.08rem; }
.summary-cutoff { display: block; margin-top: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.summary-points { font-size: 1.8rem; font-weight: 850; }
.summary-points small { color: var(--muted); font-size: .72rem; font-weight: 650; }
.coach-list { display: grid; gap: 7px; margin-top: 12px; }
.coach-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; }
.coach-swatch { width: 16px; height: 3px; border-radius: 4px; flex: none; }
.coach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-record { color: #e8edf4; font-weight: 800; white-space: nowrap; }
.coach-empty { color: var(--muted); font-size: .75rem; }
.tooltip { position: absolute; display: none; z-index: 5; min-width: 220px; max-width: 290px; padding: 13px 14px; border: 1px solid #465268; border-radius: 12px; background: #090c11ed; box-shadow: 0 14px 35px #000b; pointer-events: none; backdrop-filter: blur(10px); }
.tooltip.visible { display: block; }
.tooltip-kicker { color: #aeb8c6; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.tooltip-score { margin: 5px 0 7px; font-size: 1.12rem; font-weight: 800; }
.tooltip-meta { color: #aeb8c6; font-size: .82rem; line-height: 1.5; }
.tooltip-total { color: var(--target); font-weight: 850; }
.detail-panel { margin-top: 24px; }
.detail-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 22px; }
.detail-heading h2 { font-size: 2rem; }
.detail-heading label { color: var(--muted); font-size: .8rem; font-weight: 700; }
.section-note { max-width: 680px; margin: 10px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.equivalents-heading { align-items: center; }
.equivalents-reference { flex: 0 0 auto; min-width: 190px; padding: 14px 18px; border: 1px solid #ff586555; border-radius: 12px; background: linear-gradient(135deg, #35151b, #171820); }
.equivalents-reference span, .equivalents-reference small { display: block; color: var(--muted); }
.equivalents-reference span { font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.equivalents-reference strong { display: block; margin: 3px 0; color: #fff; font-size: 1.75rem; }
.equivalents-reference small { font-size: .74rem; }
.equivalents-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #202733; }
.equivalent-card { min-width: 0; border-right: 1px solid #202733; }
.equivalent-card:last-child { border-right: 0; }
.equivalent-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 18px; border-bottom: 1px solid #202733; background: #ffffff04; }
.equivalent-card-head strong, .equivalent-card-head small { display: block; }
.equivalent-card-head > div > strong { font-size: 1rem; }
.equivalent-card-head > div > small { margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.equivalent-card-head > span { flex: 0 0 auto; font-size: 1.65rem; font-weight: 900; }
.equivalent-card-head > span small { display: inline; font-size: .7rem; }
.equivalent-list { padding: 5px 0; }
.equivalent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 49px; padding: 8px 18px; border-bottom: 1px solid #20273399; }
.equivalent-row:last-child { border-bottom: 0; }
.equivalent-row strong, .equivalent-row small { display: block; }
.equivalent-row strong { font-size: .82rem; }
.equivalent-row small { margin-top: 2px; color: var(--muted); font-size: .75rem; text-transform: capitalize; }
.equivalent-points { min-width: 31px; text-align: right; font-size: .88rem; font-weight: 900; }
.equivalent-points.win { color: #63da88; } .equivalent-points.draw { color: #f2c94c; } .equivalent-points.loss { color: #ff707a; }
.equivalent-row.unavailable { background: repeating-linear-gradient(135deg, #ffffff02 0, #ffffff02 6px, transparent 6px, transparent 12px); }
.equivalent-row.unavailable strong { color: #8792a2; }
.equivalent-row.unavailable em { max-width: 126px; color: #697585; font-size: .75rem; line-height: 1.35; text-align: right; }
.rivalry-heading { align-items: flex-end; }
.rivalry-selectors { display: flex; align-items: flex-end; gap: 12px; }
.rivalry-selectors select { min-width: 210px; }
.rivalry-result { border-top: 1px solid #202733; }
.rivalry-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; background: linear-gradient(110deg, #191119, #111822); }
.rivalry-summary strong, .rivalry-summary small { display: block; }
.rivalry-summary strong { margin-top: 3px; font-size: clamp(1.45rem, 3vw, 2.2rem); }
.rivalry-summary small { margin-top: 5px; color: var(--muted); }
.rivalry-kicker { color: #ff6b76; font-size: .72rem; font-weight: 850; letter-spacing: .12em; }
.record-pills { display: flex; gap: 7px; }
.pill { min-width: 44px; padding: 7px 9px; border-radius: 999px; text-align: center; font-size: .78rem; font-weight: 850; background: #202733; }
.pill.win { color: #63da88; } .pill.draw { color: #f2c94c; } .pill.loss { color: #ff707a; }
.h2h-chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.h2h-item { position: relative; min-height: 126px; padding: 18px 22px; border-right: 1px solid #202733; border-top: 3px solid transparent; }
.h2h-item.win { border-top-color: #3fb96a; } .h2h-item.draw { border-top-color: #c9a927; } .h2h-item.loss { border-top-color: #d84f59; }
.h2h-item.scheduled { border-top-color: #6d7b8e; background: linear-gradient(180deg, #ffffff06, transparent); }
.h2h-item.current { background: #ffffff08; }
.h2h-season { color: #aab4c2; font-size: .74rem; font-weight: 850; letter-spacing: .05em; }
.h2h-score { margin-top: 10px; font-weight: 850; line-height: 1.25; }
.h2h-meta { margin-top: 7px; color: var(--muted); font-size: .74rem; }
.h2h-coach { margin-top: 5px; color: #dfe6ef; font-size: .78rem; font-weight: 750; }
.chain-arrow { position: absolute; z-index: 2; top: 50%; right: -8px; display: grid; place-items: center; width: 16px; height: 24px; border-radius: 8px; background: #2a3442; color: #fff; transform: translateY(-50%); }
.history-button { border: 1px solid #3c495c; border-radius: 7px; padding: 6px 9px; color: #dce3ec; background: #18202a; cursor: pointer; }
.history-button:hover, .history-button:focus-visible { border-color: #ff5d69; color: #fff; }
.empty-state { margin: 0; padding: 22px; color: var(--muted); }
select { display: block; min-width: 150px; margin-top: 7px; padding: 9px 36px 9px 11px; border: 1px solid #3a4658; border-radius: 9px; color: var(--text); background: #151b24; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 16px; border-top: 1px solid #202733; text-align: left; white-space: nowrap; }
th { color: #8e9aaa; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
td:nth-last-child(-n+2), th:nth-last-child(-n+2) { text-align: right; }
.result-w { color: #63da88; } .result-d { color: #f2c94c; } .result-l { color: #ff707a; }
.scheduled-row { background: #ffffff05; }
.result-pending { color: #b8c2cf; font-weight: 750; }
.muted-cell { color: #778292; }
footer { display: flex; justify-content: space-between; gap: 24px; padding: 18px 4px 0; color: #778292; font-size: .75rem; line-height: 1.5; }
footer p { margin: 0; }

@media (max-width: 900px) {
  .masthead { grid-template-columns: 1fr; align-items: start; }
  .masthead-stats { width: min(100%, 450px); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-card { border-bottom: 1px solid #202733; }
  .chart-wrap, #chart { min-height: 470px; height: 470px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .reset { grid-column: 1 / -1; }
  .rivalry-heading { align-items: stretch; flex-direction: column; }
  .equivalents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equivalent-card:nth-child(2) { border-right: 0; }
  .equivalent-card:nth-child(-n+2) { border-bottom: 1px solid #202733; }
}
@media (max-width: 600px) {
  .shell { padding-top: 22px; }
  .masthead-stats { grid-template-columns: 1fr; width: 100%; }
  .standing-card, .target-card { min-width: 0; }
  .toolbar { display: flex; align-items: stretch; flex-direction: column; }
  .detail-heading { align-items: stretch; flex-direction: column; }
  .reset { align-self: flex-start; }
  .chart-wrap { padding-inline: 0; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { border-right: 0; }
  .equivalents-heading { align-items: stretch; }
  .equivalents-reference { min-width: 0; }
  .equivalents-grid { grid-template-columns: 1fr; }
  .equivalent-card, .equivalent-card:nth-child(2) { border-right: 0; border-bottom: 1px solid #202733; }
  .equivalent-card:last-child { border-bottom: 0; }
  .rivalry-selectors { flex-direction: column; align-items: stretch; }
  .rivalry-selectors select { width: 100%; min-width: 0; }
  .rivalry-summary { align-items: flex-start; flex-direction: column; }
  .h2h-chain { grid-template-columns: 1fr; }
  .h2h-item { border-right: 0; border-bottom: 1px solid #202733; }
  .chain-arrow { top: auto; right: 50%; bottom: -13px; transform: translateX(50%) rotate(90deg); }
  footer { flex-direction: column; }
}

/* Referencias lineales de puntos al cierre de la jornada 38. */
.target-line.target-conference { stroke: #e2e8f0; stroke-dasharray: 3 6; }
.target-label.target-conference { fill: #e2e8f0; }
.target-line.target-uel { stroke: #39e4e9; stroke-dasharray: 12 5 3 5; }
.target-label.target-uel { fill: #39e4e9; }
.reference-note { margin: 0 22px 18px; color: var(--muted, #a5a9b4); font-size: .85rem; line-height: 1.5; }
@media (max-width: 640px) { .target-label { font-size: 10px; } }

.reference-control { display: grid; gap: 8px; }
.reference-control select { max-width: 100%; }
.target-line.target-salvation { stroke: #a7d780; stroke-dasharray: 5 6; }
.target-label.target-salvation { fill: #a7d780; }
