/* Run to Cup 3.9.7 — profile/team readability + complete theme consistency */

/* Profile hero is always photographic/dark, so its foreground must stay light in both themes. */
.profile-hero,
.profile-hero .profile-head,
.profile-hero .profile-title,
.profile-hero .profile-title h2,
.profile-hero .profile-title p,
.profile-hero .profile-title strong,
.profile-hero .profile-title span,
.profile-hero .profile-title .team-link,
.profile-hero .profile-title .inline-link{
  color:#f7f9fb!important;
}
.profile-hero .profile-title p{color:#d8dde3!important}
.profile-hero .profile-crest{
  color:#fff!important;
  background:rgba(16,20,24,.88)!important;
  border-color:rgba(235,241,245,.62)!important;
}
.profile-hero .player-number{color:rgba(245,248,250,.11)!important}

/* Team/player information cells used hard-coded dark backgrounds from the old UI. */
.info-item{
  background:var(--rtc-surface-2)!important;
  border-color:var(--rtc-line)!important;
  color:var(--rtc-text)!important;
}
.info-item span{
  color:var(--rtc-muted)!important;
}
.info-item strong,
.info-item strong *,
.info-item .value-big,
.info-item .inline-link,
.info-item .team-link{
  color:var(--rtc-text)!important;
}
.info-item .inline-link:hover,
.info-item .team-link:hover{
  color:var(--rtc-accent-strong)!important;
}

/* Recent results had the same inherited hard-coded dark surface. */
.recent-row{
  background:var(--rtc-surface-2)!important;
  border-color:var(--rtc-line)!important;
  color:var(--rtc-text)!important;
}
.recent-row b{
  background:var(--rtc-surface-3)!important;
  color:var(--rtc-text)!important;
}
.recent-row .inline-link{
  color:var(--rtc-text)!important;
}

/* Squad / profile tables. */
.player-table td,
.player-table th{
  color:var(--rtc-text)!important;
  border-color:var(--rtc-line)!important;
}
.player-table th{color:var(--rtc-muted)!important}
.player-link{color:var(--rtc-text)!important}
.player-link:hover{color:var(--rtc-accent-strong)!important}
.player-avatar{
  background:var(--rtc-surface-3)!important;
  color:var(--rtc-text)!important;
  border-color:var(--rtc-line)!important;
}
.position-badge{
  background:var(--rtc-surface-3)!important;
  color:var(--rtc-text)!important;
}

/* Keep cards/surfaces consistent across both themes. */
#teamProfileContent .card,
#playerProfileContent .card{
  background:var(--rtc-surface)!important;
  color:var(--rtc-text)!important;
  border-color:var(--rtc-line)!important;
}
#teamProfileContent .card-head,
#playerProfileContent .card-head{
  background:var(--rtc-surface-2)!important;
  color:var(--rtc-text)!important;
  border-color:var(--rtc-line)!important;
}
#teamProfileContent .card-head h2,
#playerProfileContent .card-head h2{
  color:var(--rtc-text)!important;
}

/* Light theme explicit contrast guarantees. */
html[data-theme="light"] #teamProfileContent,
html[data-theme="light"] #playerProfileContent{
  color:#111417!important;
}
html[data-theme="light"] .info-item{
  background:#f5f7f8!important;
  border-color:#cbd2d8!important;
  color:#111417!important;
}
html[data-theme="light"] .info-item span{color:#626c75!important}
html[data-theme="light"] .info-item strong,
html[data-theme="light"] .info-item strong *,
html[data-theme="light"] .info-item .inline-link,
html[data-theme="light"] .info-item .team-link,
html[data-theme="light"] .info-item .value-big{color:#111417!important}
html[data-theme="light"] .recent-row{
  background:#f5f7f8!important;
  border-color:#cbd2d8!important;
  color:#111417!important;
}
html[data-theme="light"] .recent-row b{
  background:#e9edf0!important;
  color:#111417!important;
}
html[data-theme="light"] .player-table td{color:#111417!important}
html[data-theme="light"] .player-table th{color:#626c75!important}
html[data-theme="light"] .player-link{color:#111417!important}
html[data-theme="light"] .position-badge{
  background:#e9edf0!important;
  color:#111417!important;
}

/* Dark theme explicit contrast guarantees. */
html[data-theme="dark"] .info-item{
  background:#181d22!important;
  color:#f5f7f8!important;
}
html[data-theme="dark"] .info-item span{color:#929ba4!important}
html[data-theme="dark"] .info-item strong,
html[data-theme="dark"] .info-item strong *,
html[data-theme="dark"] .info-item .inline-link,
html[data-theme="dark"] .info-item .team-link,
html[data-theme="dark"] .info-item .value-big{color:#f5f7f8!important}
