: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;

  z-index: 9999;
  isolation: isolate; /* helps prevent weird stacking-context surprises */
}

.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: 1250px;
  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;
}

/* Make Team page wider only */
body.team-page .page {
  max-width: 1300px;   /* try 1350–1500 */
}

/* Tables stay neutral/readable */
body.team-page .card .data-table th,
body.team-page .card .data-table td{
  color: inherit;
}

/* Override wide default for Min GP */
#minGP {
  min-width: 0;      /* remove the 260px floor */
  width: 70px;
  flex: 0 0 70px;    /* prevent flex growth */
}

#perfChart .plotly .draglayer * {
  cursor: default !important;
}

/* Performance chart "card" */
#perfChart {
  border-radius: 14px;
  overflow: hidden; /* critical for rounding Plotly’s canvas */
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Player analytics bars (match perf chart styling) */
#playerBarsChart {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Keep Plotly canvas rounded */
#playerBarsChart .plot-container {
  border-radius: 14px;
}

/* Optional: a little breathing room inside the card */
#perfChart .plot-container {
  border-radius: 14px;
}

/* Team analytics radar "card" (match player perf chart styling) */
body.team-page .analytics-frame{
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);

  display: grid;
  grid-template-rows: 40px 1fr 40px;   /* ↑ more vertical space */
  height: 520px;
}

/* Keep Plotly canvas rounded too */
body.team-page .analytics-frame .plot-container{
  border-radius: 14px;
}

/* Plot area fills middle row */
body.team-page .analytics-plot{
  width: 100%;
  height: 100%;
}

/* Header/footer live INSIDE the bordered frame */
body.team-page .analytics-cap{
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.65);
}

.team-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-hero-right {
  display: flex;
  align-items: center;
}

.team-schedule-btn {
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 14px; /* more rounded */
  text-decoration: none;
  display: inline-block;

  border: 2px solid color-mix(
    in srgb,
    var(--team-bg, #2a3340) 75%,
    #000000
  );

  transition: all 0.18s ease;
}

.team-schedule-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* Team page: keep roster title + filters on one line */
.stats-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Keep the two selects side-by-side, not stacked */
.stats-header .control.compact{
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-header .control.compact { 
  flex-direction: row !important;
}

