:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color-scheme: dark;
}

body {
  margin: 0;
  background: #0b0d10;
  color: #e7e7e7;
}

/* Ensure hidden works even when other rules set display:grid/flex */
[hidden] { display: none !important; }


.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #222833;
  position: sticky;
  top: 0;
  background: #0b0d10;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.nav a {
  color: #b8c0cc;
  text-decoration: none;
  margin-left: 12px;
}

.nav a.active { color: #fff; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.season-picker {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #b8c0cc;
}

.season-picker select {
  background: #0f1319;
  color: #e7e7e7;
  border: 1px solid #232a35;
  border-radius: 10px;
  padding: 8px 10px;
}

.page {
  max-width: 1150px;
  margin: 0 auto;
  padding: 18px;
}

h1 {
  margin: 10px 0 12px;
  font-size: 28px;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin: 10px 0 12px;
}

.controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #b8c0cc;
}

.controls select, .controls input {
  background: #0f1319;
  color: #e7e7e7;
  border: 1px solid #232a35;
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
}

.controls input { min-width: 260px; }

.status {
  padding: 12px 14px;
  border: 1px solid #232a35;
  border-radius: 12px;
  background: #0f1319;
}

.footnote {
  margin-top: 12px;
  color: #b8c0cc;
  font-size: 12px;
}
/* --- Team page layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 950px) {
  .two-col { grid-template-columns: 1fr; }
}

.card {
  border: 1px solid #232a35;
  border-radius: 12px;
  background: #0f1319;
  padding: 12px;
}

.card-title {
  font-size: 20px;
  font-weight: 750;
  margin: 4px 0 10px;
}

.card-subtitle {
  font-size: 12px;
  color: #b8c0cc;
  font-weight: 600;
  margin-left: 8px;
}

.table-spacer { height: 12px; }

/* --- Team hero --- */
.team-hero {
  border: 1px solid #232a35;
  border-radius: 12px;
  padding: 16px;
  background: #0f1319;
  padding: 22px;
}

.team-hero.team-themed {
  background: var(--team-bg, #0f1319);
  color: var(--team-fg, #e7e7e7);
}

.team-hero-left {
  display: flex;
  align-items: center;
  gap: 22px;
}

.team-hero-logo {
  width: 128px;
  height: 128px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(0,0,0,0.15);
  padding: 10px;
}

.team-hero-name {
  margin: 0;
  font-size: 48px;
  line-height: 1.05;
  font-weight: 800;
}

.team-hero-meta {
  margin-top: 12px;
  font-size: 24px;
  font-weight: 600;
  opacity: 0.95;
}

/* Team links that should inherit themed colors */
.team-link-inherit {
  color: inherit;
  text-decoration: none;
}

.team-link-inherit:hover {
  text-decoration: underline;
}

/* Force player hero team link to inherit team colors */
.team-hero .team-link-inherit,
.team-hero .team-link-inherit:visited {
  color: inherit !important;
  text-decoration: none;
}

.team-hero .team-link-inherit:hover {
  text-decoration: underline;
}

.league-logo {
  height: 64px;
  width: auto;
  display: block;
}

/* Player page: team-colored outline around hero card */
#playerHero.team-themed{
  border: 2px solid color-mix(
    in srgb,
    var(--team-bg, #2a3340) 70%,
    #ffffff
  );
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.35),
    0 8px 24px rgba(0,0,0,0.45);
}

/* Team page: team-colored outline around hero card */
#teamHero.team-themed{
  border: 2px solid color-mix(
    in srgb,
    var(--team-bg, #2a3340) 70%,
    #ffffff
  );
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.35),
    0 8px 24px rgba(0,0,0,0.45);
}

/* Inline header controls (Player page) */
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Match Players page control look */
.stats-header .control {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  gap: 0.15rem;
}

.stats-header .control select {
  background: #0f1319;
  color: #e7e7e7;
  border: 1px solid #232a35;
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
}

/* Slightly tighter than page-level filters */
.stats-header .control.compact span {
  opacity: 0.8;
}

/* Body stays neutral */
body.team-page .card .card-body{
  background: #0f1319;
  color: #d7dde6;
}

/* Tables stay neutral/readable */
body.team-page .card .data-table th,
body.team-page .card .data-table td{
  color: inherit;
}