/* Omni Transfer page (2026-10-28). Built on the site tokens so every theme applies.
   Layout: hero with live counts -> sticky filter bar -> card grid -> slide-over player panel. */

/* On :root because the player panel is appended to <body>, outside .tr-page. */
:root {
  --tr-gk: #e0a33b;
  --tr-df: #3b8fd6;
  --tr-mf: #3fb27f;
  --tr-fw: #e05a5a;
  --tr-free: #f0b429;
  --tr-radius: 16px;
}

.tr-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px max(16px, 2vw) 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- main tabs */
.tr-tabs-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 560px;
}
.tr-tabs-main button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--trans-fast, .15s), color var(--trans-fast, .15s);
}
.tr-tabs-main button svg { width: 20px; height: 20px; }
.tr-tabs-main button:hover { color: var(--ink); }
.tr-tabs-main button[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--ink) 30%));
  color: var(--bg);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}
.tr-tabs-main button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* free-period toggle (contracts tab) */
.tr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tr-toggle .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.tr-toggle[aria-pressed="true"] {
  border-color: var(--tr-free);
  color: var(--tr-free);
  background: color-mix(in srgb, var(--tr-free) 12%, var(--surface2));
}
.tr-toggle[aria-pressed="true"] .dot { background: currentColor; }
.tr-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- hero */
.tr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 26px 28px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 70%, var(--bg)) 100%);
  overflow: hidden;
  position: relative;
}
.tr-hero::after {
  /* faint pitch lines */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), color-mix(in srgb, var(--ink) 6%, transparent) calc(50% - 0.5px), color-mix(in srgb, var(--ink) 6%, transparent) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    radial-gradient(circle at 50% 50%, transparent 58px, color-mix(in srgb, var(--ink) 6%, transparent) 59px, color-mix(in srgb, var(--ink) 6%, transparent) 60px, transparent 61px);
  pointer-events: none;
}
.tr-hero > * { position: relative; z-index: 1; }
.tr-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 8px;
}
.tr-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
}
.tr-hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}
.tr-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, auto));
  gap: 10px;
}
.tr-kpi {
  background: color-mix(in srgb, var(--surface2) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
}
.tr-kpi b {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tr-kpi span { font-size: 11px; color: var(--ink-muted); font-weight: 600; }

/* ---------- filters */
.tr-filters {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--tr-radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.tr-search {
  flex: 1 1 220px;
  min-width: 0;
  position: relative;
}
.tr-search input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.tr-search svg {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  stroke: var(--ink-muted);
}
.tr-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.tr-seg button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.tr-seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
}
.tr-seg button:focus-visible,
.tr-select:focus-visible,
.tr-search input:focus-visible,
.tr-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tr-select {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.tr-age {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 700;
}
.tr-step {
  display: inline-flex;
  align-items: center;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  overflow: hidden;
  direction: ltr;
}
.tr-step:focus-within { border-color: var(--accent); }
.tr-step button {
  width: 28px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color var(--trans-fast, .15s), background var(--trans-fast, .15s);
}
.tr-step button:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tr-step button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tr-age input {
  width: 40px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.tr-age input:focus { outline: none; }
.tr-age input::placeholder { color: var(--ink-muted); font-weight: 700; }
.tr-age input::-webkit-outer-spin-button,
.tr-age input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tr-result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-muted);
}
.tr-result-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tr-result-end { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.tr-view button { display: inline-grid; place-items: center; padding: 6px 9px; }

/* ---------- list view: one player per row */
.tr-grid.is-list { grid-template-columns: 1fr; gap: 8px; }
.tr-grid.is-list .tr-card {
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) minmax(280px, 1.4fr) minmax(170px, 0.8fr);
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
}
.tr-grid.is-list .tr-card::before {
  inset: 0 auto;
  inset-inline-start: 0;
  inset-inline-end: auto;
  width: 4px;
  height: auto;
  background: var(--pos);
  opacity: 0.85;
}
.tr-grid.is-list .tr-card:hover { transform: none; }
.tr-grid.is-list .tr-card-top { grid-template-columns: 52px minmax(0, 1fr); }
.tr-grid.is-list .tr-card.has-fit .tr-card-top { grid-template-columns: 52px minmax(0, 1fr) auto; }
.tr-grid.is-list .tr-photo { width: 52px; height: 52px; }
.tr-grid.is-list .tr-fact { padding: 6px 8px; }
.tr-grid.is-list .tr-card-foot {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding-top: 0;
  border-top: 0;
  text-align: end;
  min-width: 0;
}
.tr-grid.is-list .tr-card-foot .tr-club { max-width: 100%; }
@media (max-width: 860px) {
  .tr-grid.is-list .tr-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tr-grid.is-list .tr-card-foot { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- grid + cards */
.tr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.tr-card {
  --pos: var(--tr-mf);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--tr-radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: inherit;
  transition: transform var(--trans-fast, .15s), border-color var(--trans-fast, .15s), box-shadow var(--trans-fast, .15s);
  overflow: hidden;
}
.tr-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 64px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pos) 16%, transparent), transparent);
  pointer-events: none;
}
.tr-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--pos) 60%, var(--border)); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22); }
.tr-card[data-group="gk"] { --pos: var(--tr-gk); }
.tr-card[data-group="df"] { --pos: var(--tr-df); }
.tr-card[data-group="mf"] { --pos: var(--tr-mf); }
.tr-card[data-group="fw"] { --pos: var(--tr-fw); }
.tr-card-top {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.tr-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--pos), color-mix(in srgb, var(--pos) 30%, transparent), var(--pos));
  flex-shrink: 0;
}
.tr-photo img,
.tr-photo .tr-photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  display: block;
}
.tr-photo-fallback { display: grid !important; place-items: center; color: var(--ink-muted); font-weight: 800; font-size: 18px; }
.tr-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tr-sub {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-muted);
}
.tr-pos {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--pos);
  background: color-mix(in srgb, var(--pos) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--pos) 34%, transparent);
}
.tr-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.tr-fact {
  background: var(--surface2);
  border-radius: 10px;
  padding: 7px 8px;
  min-width: 0;
}
.tr-fact b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tr-fact span { font-size: 10.5px; color: var(--ink-muted); font-weight: 600; }
.tr-fact.na b { color: var(--ink-muted); font-size: 11px; font-weight: 700; }
.tr-alt {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.tr-select-pos { min-width: 170px; }
.tr-card[data-group="other"], .tr-panel[data-group="other"] { --pos: #8a97a3; }
.tr-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.tr-card-foot .tr-club { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-free {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--accent);
}
.tr-contract {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tr-badge {
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  color: #1a1204;
  background: var(--tr-free);
}
.tr-card.is-free-period { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tr-free) 55%, transparent); }
.tr-foot-ico { display: inline-flex; gap: 2px; align-items: center; }
.tr-foot-ico svg { width: 10px; height: 14px; }
.tr-foot-ico .on { fill: var(--accent); }
.tr-foot-ico .off { fill: none; stroke: var(--ink-muted); stroke-width: 1.6; opacity: 0.55; }

.tr-more {
  align-self: center;
  height: 40px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tr-more:hover { border-color: var(--accent); color: var(--accent); }

.tr-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-muted);
  border: 1px dashed var(--border);
  border-radius: var(--tr-radius);
  font-size: 14px;
}
.tr-skel { height: 196px; border-radius: var(--tr-radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: tr-shimmer 1.4s infinite; }
@keyframes tr-shimmer { to { background-position: -200% 0; } }

/* ---------- player panel */
.tr-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}
.tr-panel {
  --pos: var(--tr-mf);
  position: fixed;
  z-index: 61;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(560px, 100vw);
  background: var(--bg);
  border-right: 1px solid var(--border);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  animation: tr-slide 0.22s ease-out;
}
.tr-panel[data-group="gk"] { --pos: var(--tr-gk); }
.tr-panel[data-group="df"] { --pos: var(--tr-df); }
.tr-panel[data-group="fw"] { --pos: var(--tr-fw); }
@keyframes tr-slide { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.tr-panel-head {
  position: relative;
  padding: 22px 22px 18px;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--pos) 24%, transparent), transparent 60%), var(--surface);
  border-bottom: 1px solid var(--border);
}
.tr-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.tr-panel-id {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.tr-panel-id .tr-photo { width: 96px; height: 96px; }
.tr-panel-id h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.tr-panel-body { padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 18px; }
.tr-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tr-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tr-section h3::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--pos); }
.tr-two {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.tr-pitch svg { width: 100%; height: auto; display: block; border-radius: 12px; }
.tr-pos-list { display: flex; flex-direction: column; gap: 6px; }
.tr-pos-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
}
.tr-pos-row .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.tr-pos-row .bar i { display: block; height: 100%; background: var(--pos); border-radius: 3px; }
.tr-pos-row small { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tr-foot-big { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--ink-muted); }
.tr-foot-big svg { width: 20px; height: 28px; }
.tr-foot-big .on { fill: var(--accent); }
.tr-foot-big .off { fill: none; stroke: var(--ink-muted); stroke-width: 1.4; opacity: 0.55; }
.tr-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tr-tabs button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.tr-tabs button[aria-pressed="true"] { border-color: var(--pos); color: var(--ink); background: color-mix(in srgb, var(--pos) 14%, var(--surface)); }
.tr-season-meta { font-size: 12px; color: var(--ink-muted); margin-bottom: 10px; }
.tr-season-meta b { color: var(--ink); }
.tr-stat-group { margin-bottom: 12px; }
.tr-stat-group h4 { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-muted); }
.tr-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tr-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-width: 0;
}
.tr-stat b { display: block; font-size: 16px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.tr-stat span { display: block; font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.tr-stat small { display: block; font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.tr-stat.na b { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.tr-note { font-size: 11.5px; color: var(--ink-muted); line-height: 1.6; }

@media (max-width: 760px) {
  .tr-hero { grid-template-columns: 1fr; padding: 20px; }
  .tr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tr-kpi { padding: 10px 6px; }
  .tr-kpi b { font-size: 16px; white-space: nowrap; }
  .tr-filters { position: static; }
  .tr-tabs-main { max-width: none; }
  .tr-tabs-main button { font-size: 13px; height: 44px; gap: 6px; }
  .tr-two { grid-template-columns: 1fr; }
  .tr-pitch { max-width: 200px; margin: 0 auto; }
  .tr-info, .tr-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .tr-card, .tr-panel { transition: none; animation: none; }
  .tr-skel { animation: none; }
}

/* ---------- export */
.tr-export {
  position: absolute;
  top: 14px;
  left: 56px;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface2));
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tr-export svg { width: 16px; height: 16px; }
.tr-export:disabled { opacity: 0.6; cursor: progress; }
.tr-export:focus-visible, .tr-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The sheet that becomes the image: fixed width, off-screen, no animation. */
.tr-export-sheet {
  position: fixed !important;
  top: 0 !important;
  left: -12000px !important;
  bottom: auto !important;
  width: 1080px !important;
  overflow: visible !important;
  animation: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
.tr-export-sheet .tr-panel-head { padding: 34px 40px 26px; }
.tr-export-sheet .tr-panel-id { grid-template-columns: 120px minmax(0, 1fr); }
.tr-export-sheet .tr-panel-id .tr-photo { width: 120px; height: 120px; }
.tr-export-sheet .tr-panel-id h2 { font-size: 30px; }
.tr-export-sheet .tr-panel-body { padding: 26px 40px 34px; gap: 24px; }
.tr-export-sheet .tr-two { grid-template-columns: 220px minmax(0, 1fr); }
.tr-export-sheet .tr-stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tr-season-block + .tr-season-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.tr-season-title { font-size: 15px; font-weight: 900; color: var(--ink); margin-bottom: 4px; }
.tr-export-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  direction: ltr;
}
.tr-export-brand { display: inline-flex; align-items: center; gap: 10px; }
.tr-export-brand b { font-size: 22px; font-weight: 900; color: var(--ink); }
.tr-export-brand i { font-style: normal; color: var(--accent); }
.tr-export-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface2);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.tr-export-logo svg { width: 24px; height: 24px; }
.tr-export-logo rect { fill: var(--accent); }
.tr-export-domain { font-size: 16px; font-weight: 900; color: var(--ink); }
.tr-save-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.tr-save-sheet img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; }
.tr-save-actions { display: flex; gap: 10px; }
@media (max-width: 760px) {
  .tr-export span { display: none; }
}
/* The image renderer draws letter by letter whenever letter-spacing is not 0,
   which breaks joined Arabic script; keep it 0 everywhere in the export. */
.tr-export-sheet, .tr-export-sheet * { letter-spacing: 0 !important; word-spacing: normal !important; }
.tr-club-note { padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-size: 13px; color: var(--ink-muted); line-height: 1.6; }
.tr-club-note b { color: var(--ink); }

/* ---------- 16:9 export slide (1600x900) */
.tr-export-sheet.tr-slide-sheet { width: 1600px !important; height: 900px !important; max-height: none !important; overflow: hidden !important; padding: 0 !important; }
.tr-slide { width: 1600px; height: 900px; box-sizing: border-box; padding: 34px 44px 26px; display: flex; flex-direction: column; gap: 22px; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--pos) 14%, transparent), transparent 55%), var(--bg); color: var(--ink); }
.tr-slide-head { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.tr-slide-photo { width: 132px !important; height: 132px !important; padding: 4px; }
.tr-slide-photo .tr-photo-fallback { font-size: 40px; }
.tr-slide-id h2 { margin: 0; font-size: 44px; font-weight: 900; line-height: 1.1; color: var(--ink); }
.tr-slide-sub { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 18px; color: var(--ink-muted); }
.tr-slide-sub .tr-pos { font-size: 16px; padding: 4px 12px; }
.tr-slide-chips { display: grid; grid-template-columns: repeat(4, minmax(110px, auto)); gap: 10px; }
.tr-slide-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; min-width: 0; }
.tr-slide-chip b { display: block; font-size: 20px; font-weight: 900; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.tr-slide-chip span { font-size: 13px; color: var(--ink-muted); font-weight: 700; }
.tr-slide-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 400px; gap: 26px; }
.tr-slide-col { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.tr-slide-col h3 { margin: 0; font-size: 19px; font-weight: 900; color: var(--ink); display: flex; gap: 6px; align-items: baseline; }
.tr-slide-pitch { width: 100%; max-width: 230px; align-self: center; }
.tr-slide-pitch svg { width: 100%; height: auto; display: block; border-radius: 12px; }
.tr-slide-poslist { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.tr-slide-poslist div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--surface2); }
.tr-slide-poslist small { color: var(--ink-muted); font-size: 13px; }
.tr-slide-nums .tr-season-meta { font-size: 15px; color: var(--ink-muted); }
.tr-slide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px; }
.tr-slide-grid .tr-stat { padding: 14px 14px 12px; }
.tr-slide-grid .tr-stat b { font-size: 28px; }
.tr-slide-grid .tr-stat span { font-size: 14px; }
.tr-slide-grid .tr-stat small { font-size: 12.5px; }
.tr-slide-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tr-slide-kpis .tr-fact b { font-size: 22px; }
.tr-slide-career .tr-table { font-size: 14px; }
.tr-slide-career .tr-table td, .tr-slide-career .tr-table th { padding: 7px 10px; }
.tr-slide-career .tr-table-wrap { overflow: hidden; }
.tr-slide-nat { font-size: 14px; color: var(--ink-muted); display: flex; gap: 4px; flex-wrap: wrap; }
.tr-slide-nat b { color: var(--ink); }
.tr-slide .tr-export-foot { padding-top: 14px; }
/* Feet always read left foot | right foot, whatever the page direction. */
.tr-foot-pair { display: inline-flex; gap: 2px; align-items: center; direction: ltr; }
.tr-foot-big .tr-foot-pair { gap: 4px; }
/* Season title/meta are separate pieces so mixed Arabic/Latin text keeps its order. */
.tr-season-title, .tr-season-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.tr-season-title .sep, .tr-season-meta .sep { color: var(--ink-muted); }

/* ---------- full career */
.tr-career-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 4px; }
.tr-sub-h { margin: 14px 0 6px; font-size: 12px; font-weight: 800; color: var(--ink-muted); }
.tr-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tr-table th, .tr-table td { padding: 8px 10px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--ink); }
.tr-table th { font-size: 11px; font-weight: 800; color: var(--ink-muted); background: var(--surface2); white-space: nowrap; }
.tr-table tr:last-child td { border-bottom: 0; }
.tr-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-table td b { font-weight: 800; }
.tr-comps { margin-top: 3px; font-size: 11px; color: var(--ink-muted); line-height: 1.5; }
.tr-loan { margin-inline-start: 6px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--surface2); color: var(--ink-muted); border: 1px solid var(--border); }
@media (max-width: 760px) {
  .tr-career-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- team fit meter (third column of the card's top row) */
.tr-card.has-fit .tr-card-top { grid-template-columns: 64px minmax(0, 1fr) auto; }
.tr-fit {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 52px;
  padding: 6px 7px 7px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
  line-height: 1;
}
.tr-fit b { font-size: 15px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; direction: ltr; }
.tr-fit span { font-size: 9.5px; font-weight: 800; color: var(--ink-muted); }
.tr-fit-bar { display: block; width: 100%; height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--ink-muted) 22%, transparent); overflow: hidden; }
.tr-fit-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* ---------- team need */
.tr-fit-box { padding: 14px; border-radius: var(--tr-radius); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.tr-fit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12.5px; color: var(--ink-muted); }
.tr-fit-head b { color: var(--ink); font-size: 13.5px; }
.tr-fit-head .tr-more { height: 32px; padding: 0 14px; margin-inline-start: auto; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip { border: 1px solid var(--border); background: var(--surface2); color: var(--ink-muted); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.tr-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--bg); background: var(--accent); }
.tr-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- data status (owner) */
.tr-link { border: 0; background: none; padding: 0; margin-inline-start: 10px; font: inherit; font-size: 12px; font-weight: 800; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tr-status { padding: 14px; border-radius: var(--tr-radius); border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.tr-status-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tr-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-muted); }
.tr-status-line b { color: var(--ink); }
.tr-status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); }
.tr-status-line .dot.on { background: #2fb36a; box-shadow: 0 0 0 3px color-mix(in srgb, #2fb36a 25%, transparent); }
@media (max-width: 760px) {
  .tr-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tr-toggle[hidden], .tr-status[hidden], .tr-fit-box[hidden] { display: none !important; }
