/* ==========================================================================
   İstatistik merkezi ek bileşenleri — önek: sh-  · stats.css'in (st-) üzerine; yalnızca tasarım değişkenleri.
   Koyu / açık tema değişkenlerden; 360 px → masaüstü.
   ========================================================================== */

.sh-hero { padding-block-end: 0; }

/* ---------------------------------------------------------------- KPI kutucukları */
.sh-kpis { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
@media (min-width: 720px) { .sh-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .sh-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.sh-kpi {
  --kc: var(--text); position: relative; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--elev1); min-width: 0; overflow: hidden;
}
.sh-kpi::before { content: ''; position: absolute; inset-inline-start: 0; inset-block: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--border-strong); }
.sh-kpi--primary { --kc: var(--primary-text); }
.sh-kpi--primary::before { background: var(--primary); }
.sh-kpi--accent { --kc: var(--accent); }
.sh-kpi--accent::before { background: var(--accent); }
.sh-kpi--live { --kc: var(--live-text); }
.sh-kpi--live::before { background: var(--live); }
.sh-kpi dt { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); min-width: 0; }
.sh-kpi dt .icon { color: var(--primary-text); flex: none; }
.sh-kpi dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); line-height: 1.1; letter-spacing: -0.02em; color: var(--kc); font-variant-numeric: tabular-nums; }
.sh-kpi .sh-kpi__sub { margin-top: 2px; font-family: var(--font-body); font-weight: 500; font-size: var(--fs-xs); color: var(--text-secondary); letter-spacing: 0; }

/* ---------------------------------------------------------------- Spor seçici */
.sh-sportbar { padding-block: 2px; }

/* ---------------------------------------------------------------- Lider panoları / sıralı liste */
.sh-boards { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 228px), 1fr)); }
.sh-board__title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 var(--space-2); }
.sh-board__title--pad { padding: var(--space-4) var(--space-4) 0; }
.sh-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sh-rank > li { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; }
.sh-rank > li + li { border-block-start: 1px solid var(--border); }
.sh-rank--compact > li { padding: 7px 0; }
.sh-rank__pos { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.sh-rank > li:first-child .sh-rank__pos { color: var(--primary-text); }
.sh-rank__who { display: flex; flex-direction: column; min-width: 0; }
.sh-rank__who a, .sh-rank__who > span { font-weight: 600; font-size: var(--fs-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-rank__who a:hover { color: var(--link); }
.sh-rank__who small { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-rank__val { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 56px; }
.sh-rank__val strong { font-family: var(--font-display); font-size: var(--fs-md); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-rank__bar { display: block; width: 56px; height: 4px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.sh-rank__bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

/* ---------------------------------------------------------------- 1 / X / 2 çubuğu */
.sh-split-wrap { display: inline-flex; flex-direction: column; gap: 4px; min-width: 120px; width: 100%; }
.sh-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface3); width: 100%; }
.sh-split i { display: block; height: 100%; }
.sh-split__h { background: var(--primary); }
.sh-split__d { background: var(--text-muted); opacity: 0.7; }
.sh-split__a { background: var(--accent); }
.sh-split__legend { display: flex; justify-content: space-between; gap: 6px; font-size: 10px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sh-split__legend span { display: inline-flex; align-items: center; gap: 3px; }
.sh-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.sh-dot--h { background: var(--primary); }
.sh-dot--d { background: var(--text-muted); }
.sh-dot--a { background: var(--accent); }

/* ---------------------------------------------------------------- Tablolar */
.sh-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.sh-table td.team-cell, .sh-table th.team-cell { min-width: 170px; max-width: 260px; }
.sh-table .team-cell .truncate { min-width: 0; }
.sh-table .team-cell > a.row { min-width: 0; max-width: 260px; overflow: hidden; flex-wrap: nowrap; }
.sh-table .team-cell > a.row > .truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-table .sh-col-split { min-width: 140px; width: 160px; }
.sh-table .sh-col-bar { min-width: 120px; }
.sh-table abbr { text-decoration: none; }
.sh-wide { position: relative; }
.sh-maxw { max-width: 180px; }
.sh-pct { display: grid; grid-template-columns: 44px minmax(40px, 1fr); align-items: center; gap: 8px; }
.sh-pct strong { font-family: var(--font-display); font-size: var(--fs-sm); text-align: end; font-variant-numeric: tabular-nums; }
.sh-form { display: inline-flex; gap: 3px; }
.sh-form i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; }
.sh-form__w { background: var(--success); }
.sh-form__d { background: var(--text-muted); }
.sh-form__l { background: var(--danger); }
:root[data-theme="light"] .sh-form i { color: #fff; }

/* ---------------------------------------------------------------- İki sütun */
.sh-split2 { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .sh-split2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); } }
.sh-split2 > .section + .section { margin-block-start: 0; }
.sh-split2 > :only-child { grid-column: 1 / -1; }
.sh-split2--flush { gap: var(--space-4); }
.sh-split2--flush > .card + .card, .sh-split2--flush > section + section { margin: 0; }

/* ---------------------------------------------------------------- Hakem köşesi */
.sh-refs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.sh-ref {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av who cards" "av who delta"; align-items: center; column-gap: 12px; row-gap: 4px;
  padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color var(--motion-fast), transform var(--motion-base) var(--ease);
}
.sh-ref:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.sh-ref__avatar { grid-area: av; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); color: var(--text-secondary); flex: none; }
.sh-ref__avatar--sm { width: 24px; height: 24px; }
.sh-ref__who { grid-area: who; display: flex; flex-direction: column; min-width: 0; }
.sh-ref__who strong { font-size: var(--fs-sm); }
.sh-ref__who small { font-size: var(--fs-xs); color: var(--muted); }
.sh-ref__cards { grid-area: cards; display: inline-flex; gap: 6px; justify-self: end; }
.sh-ref .sh-delta { grid-area: delta; justify-self: end; }
.sh-delta { display: inline-flex; align-items: center; height: 20px; padding-inline: 7px; border-radius: 999px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-delta--up { background: var(--warning-soft); color: var(--warning-text); }
.sh-delta--down { background: var(--success-soft); color: var(--success-text); }

/* Öne çıkanlar (hakemler sayfası) */
.sh-highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .sh-highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sh-hl {
  --hc: var(--primary); display: flex; flex-direction: column; gap: 4px; height: 100%; padding: var(--space-4); border-radius: var(--radius-lg); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); box-shadow: inset 0 3px 0 var(--hc), var(--elev1); color: var(--text);
}
.sh-hl:hover { color: var(--text); border-color: var(--border-strong); }
.sh-hl--strict { --hc: var(--warning); }
.sh-hl--lenient { --hc: var(--success); }
.sh-hl--busy { --hc: var(--info); }
.sh-hl--home { --hc: var(--accent); }
.sh-hl__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.sh-hl__name { font-family: var(--font-display); font-size: var(--fs-lg); }
.sh-hl__value { font-weight: 700; color: var(--hc); font-size: var(--fs-sm); }
:root[data-theme="light"] .sh-hl--strict .sh-hl__value { color: var(--warning-text); }
.sh-hl small { font-size: var(--fs-xs); color: var(--muted); }
.sh-filters .field { flex: 1 1 160px; }
.st-filters .input.sh-input--sm { height: 36px; min-height: 36px; padding-block: 0; font-size: var(--fs-sm); }

/* Hakem sayfası: ortalamaya göre karşılaştırma (dar ekranda sapma çubuğu gizlenir, yalnızca yüzde rozeti) */
.sh-cmp-wrap { overflow-x: auto; }
.sh-cmp { width: 100%; }
@media (max-width: 560px) { .sh-cmp .sh-diverge { display: none; } .sh-cmp .sh-col-bar { min-width: 0; } }
.sh-cmp th[scope="row"] { font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.sh-cmp .sh-col-bar { display: flex; align-items: center; gap: 8px; }
.sh-diverge { position: relative; flex: 1 1 auto; height: 8px; min-width: 60px; border-radius: 999px; background: var(--surface3); }
.sh-diverge::before { content: ''; position: absolute; inset-block: -3px; inset-inline-start: 50%; width: 2px; background: var(--border-strong); }
.sh-diverge i { position: absolute; inset-block: 0; border-radius: 999px; }
.sh-diverge.is-up i { inset-inline-start: 50%; background: var(--warning); }
.sh-diverge.is-down i { inset-inline-end: 50%; background: var(--success); }
.sh-strict { display: flex; align-items: center; gap: 8px; margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.sh-strict .icon { color: var(--warning-text); }

/* ---------------------------------------------------------------- Oranlar */
.sh-odds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.sh-oddrow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.sh-oddrow:hover { color: var(--text); border-color: var(--border-strong); }
.sh-oddrow__main { display: flex; flex-direction: column; min-width: 0; }
.sh-oddrow__main strong { font-size: var(--fs-sm); }
.sh-oddrow__main small { font-size: var(--fs-xs); color: var(--muted); }
.sh-oddrow__odds { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; max-width: 120px; }
.sh-oddrow__odds small { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sh-oddrow__odds strong { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--accent); font-variant-numeric: tabular-nums; }
.sh-oddrow__dir { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.sh-oddrow__dir.is-down { background: var(--success-soft); color: var(--success-text); }
.sh-oddrow__dir.is-up { background: var(--warning-soft); color: var(--warning-text); }

/* ---------------------------------------------------------------- Rekorlar */
.sh-records { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .sh-records { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.league-block--flat { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.sh-mms { display: flex; flex-direction: column; }
.sh-mm { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; color: var(--text); min-width: 0; }
.sh-mm + .sh-mm { border-block-start: 1px solid var(--border); }
.sh-mm:hover { color: var(--text); }
.sh-mm:hover .sh-mm__score { background: var(--primary-soft); }
.sh-mm__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.sh-mm__team { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.sh-mm__team--away { justify-content: flex-start; }
.sh-mm__team.is-winner { color: var(--text); font-weight: 600; }
.sh-mm__score { padding: 2px 8px; border-radius: 6px; background: var(--surface2); font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; transition: background var(--motion-fast); }
.sh-mm__sub { text-align: center; font-size: var(--fs-xs); color: var(--muted); }

/* ---------------------------------------------------------------- Spor kartları */
.sh-sports { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.sh-sport {
  display: flex; flex-direction: column; gap: var(--space-3); height: 100%; padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--elev1);
  transition: border-color var(--motion-fast), transform var(--motion-base) var(--ease), box-shadow var(--motion-base);
}
.sh-sport:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--elev2); }
.sh-sport--live { border-color: color-mix(in srgb, var(--live) 35%, var(--border)); }
.sh-sport__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sh-sport__head strong { flex: 1 1 auto; min-width: 0; }
.sh-sport__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); }
.sh-sport__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.sh-sport__nums > span { display: flex; flex-direction: column; min-width: 0; }
.sh-sport__nums strong { font-family: var(--font-display); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.sh-sport__nums small { font-size: 11px; color: var(--muted); }
.sh-sport__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: var(--fs-xs); color: var(--link); font-weight: 600; }

/* ---------------------------------------------------------------- Grafik */
.sh-hist { margin: 0; }
.sh-hist__bar rect { fill: var(--primary); opacity: 0.85; transition: opacity var(--motion-fast); }
.sh-hist__bar:hover rect, .sh-hist__bar:focus rect { opacity: 1; }
.sh-hist__bar:focus { outline: none; }
.sh-hist__bar:focus-visible rect { stroke: var(--text); stroke-width: 2; }
.sh-hist__val { fill: var(--text-secondary); font-size: 12px; font-weight: 700; font-family: var(--font-display); }

/* ---------------------------------------------------------------- Puan durumu özetleri */
.sh-standings { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.sh-stand__head { margin-block-end: var(--space-3); color: var(--text); }
.sh-stand__head:hover { color: var(--link); }
.sh-stand__rows { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sh-stand__rows > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; }
.sh-stand__rows dt { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.sh-stand__rows dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; font-size: var(--fs-sm); font-weight: 600; }
.sh-stand__rows dd a { min-width: 0; color: var(--text); }
.sh-stand__rows dd a:hover { color: var(--link); }
.sh-stand__rows dd small { flex: none; font-family: var(--font-display); color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Dar ekran: yatay kaydırmalı şerit (panolar, yarışlar, rekorlar — sayfa boyu kısalır) */
@media (max-width: 719px) {
  .sh-rail, .st-races.sh-rail, .sh-split2.sh-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84%, 1fr); grid-template-columns: none; gap: var(--space-3);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); scroll-padding-inline: var(--space-4); padding-block-end: 4px;
  }
  .sh-rail::-webkit-scrollbar { display: none; }
  .sh-rail > * { scroll-snap-align: start; min-width: 0; }
}

/* Araçlar: altı kutucuk */
@media (min-width: 1100px) { .sh-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  .sh-ref, .sh-sport { transition: none; }
  .sh-ref:hover, .sh-sport:hover { transform: none; }
}
