.player-page .header-history-link.active {
  color: #ffffff;
}

.player-hero {
  padding: 58px 0 42px;
}

.player-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: end;
  gap: 64px;
}

.player-hero h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
}

.player-hero p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted-light);
  line-height: 1.65;
}

.player-picker {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 31, 50, 0.72);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.player-picker > label {
  color: #8fb7df;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.player-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.player-picker select {
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: #0b192a;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

.player-picker select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(83, 168, 255, 0.11);
}

.player-picker-row button {
  min-width: 96px;
  padding-inline: 15px;
  border: 1px solid rgba(83, 168, 255, 0.4);
  border-radius: 11px;
  background: rgba(36, 140, 255, 0.16);
  color: #dceeff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.player-picker-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.comparison-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comparison-chip {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.comparison-chip.active {
  border-color: var(--series-color);
  background: color-mix(in srgb, var(--series-color) 11%, transparent);
}

.comparison-chip-focus,
.comparison-chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted-light);
  cursor: pointer;
}

.comparison-chip-focus {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px 6px 9px;
  font-size: 0.68rem;
  font-weight: 750;
}

.comparison-chip-focus img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.comparison-chip-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--series-color);
}

.comparison-chip-remove {
  width: 27px;
  align-self: stretch;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.comparison-chip button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.045);
}

.comparison-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.comparison-help.limit {
  color: #ffe49a;
}

.player-content-section {
  min-height: 520px;
  padding: 8px 0 90px;
}

.player-content-section > .container > .site-message {
  margin-inline: 0;
}

.player-empty {
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 40px;
  border: 1px dashed rgba(83, 168, 255, 0.26);
  border-radius: 22px;
  background: rgba(16, 31, 50, 0.35);
  text-align: center;
}

.player-empty > span {
  width: 54px;
  height: 54px;
  display: grid;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(83, 168, 255, 0.12);
  color: var(--blue);
  font-size: 1.4rem;
}

.player-empty h2 {
  margin-bottom: 8px;
}

.player-empty p {
  margin-bottom: 0;
  color: var(--muted);
}

.player-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(20, 42, 67, 0.9), rgba(13, 28, 46, 0.85));
}

.player-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.player-team-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.3));
}

.player-profile-header .eyebrow {
  margin-bottom: 6px;
}

.player-profile-header h2 {
  margin-bottom: 5px;
  overflow: hidden;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
}

.player-profile-header p:last-child {
  margin-bottom: 0;
  color: var(--muted-light);
  font-size: 0.85rem;
}

.profile-ranking-link {
  min-height: 42px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(83, 168, 255, 0.3);
  border-radius: 999px;
  background: rgba(36, 140, 255, 0.1);
  color: #dceeff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.player-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.player-metrics div {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 31, 50, 0.68);
}

.player-metrics dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.player-metrics dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 820;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card,
.history-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(13, 28, 46, 0.88);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.history-card {
  margin-top: 18px;
}

.chart-card > header,
.history-card > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 24px;
  border-bottom: 1px solid var(--line);
}

.chart-card header .eyebrow,
.history-card header .eyebrow {
  margin-bottom: 6px;
}

.chart-card h2,
.history-card h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.chart-card header > p,
.history-card header > p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.chart-header-actions {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.chart-header-actions > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.chart-mode-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 17, 31, 0.55);
}

.chart-mode-toggle button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
}

.chart-mode-toggle button.active {
  background: rgba(83, 168, 255, 0.17);
  color: #dceeff;
}

.chart-shell {
  padding: 20px 18px 6px;
  background: radial-gradient(circle at 70% 20%, rgba(83, 168, 255, 0.08), transparent 45%);
}

#history-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.075);
  stroke-width: 1;
}

.chart-axis-label {
  fill: #8295ad;
  font-family: inherit;
  font-size: 20px;
}

.chart-area {
  fill: url(#chart-area-gradient);
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
  filter: drop-shadow(0 4px 8px rgba(36, 140, 255, 0.3));
}

.chart-point {
  fill: #07111f;
  stroke-width: 4;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
  padding: 4px 24px 20px;
  color: var(--muted);
  font-size: 0.7rem;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-light);
}

.chart-legend-item span {
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: var(--series-color);
}

.comparison-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
  margin: 12px 0 18px;
}

.comparison-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--series-color);
  border-radius: 13px;
  background: rgba(16, 31, 50, 0.68);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.comparison-card.active {
  border-color: var(--series-color);
  background: color-mix(in srgb, var(--series-color) 8%, rgba(16, 31, 50, 0.88));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--series-color) 16%, transparent);
}

.comparison-card header {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comparison-card header img {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  object-fit: contain;
}

.comparison-card header .comparison-chip-dot {
  width: 9px;
  height: 9px;
  flex-basis: 9px;
}

.comparison-card header strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 0;
}

.comparison-card dl div {
  min-width: 0;
}

.comparison-card dt {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.comparison-card dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-days-column {
  width: 90px;
}

.history-days-note {
  display: none;
}

.positive-value {
  color: #7fe0d8;
  font-weight: 760;
}

.first-record {
  color: var(--muted);
}

@media (max-width: 900px) {
  .player-hero-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .player-picker {
    max-width: 620px;
  }

  .player-picker-row {
    grid-template-columns: 1fr;
  }

  .player-picker-row button {
    min-height: 42px;
  }
}

@media (max-width: 680px) {
  .player-hero {
    padding: 30px 0 24px;
  }

  .player-hero h1 {
    max-width: 370px;
    font-size: clamp(2.15rem, 11vw, 2.8rem);
  }

  .player-hero p:not(.eyebrow) {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .player-picker {
    padding: 13px;
    border-radius: 14px;
  }

  .player-content-section {
    padding-bottom: 54px;
  }

  .player-empty {
    min-height: 280px;
    padding: 28px;
    border-radius: 18px;
  }

  .player-profile-header {
    align-items: flex-start;
    padding: 18px;
    border-radius: 17px;
  }

  .player-title-row {
    gap: 11px;
  }

  .player-team-icon {
    width: 45px;
    height: 45px;
    flex-basis: 45px;
  }

  .player-profile-header h2 {
    font-size: 1.55rem;
  }

  .profile-ranking-link {
    display: none;
  }

  .player-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .player-metrics div {
    padding: 13px;
    border-radius: 13px;
  }

  .player-metrics dt {
    min-height: 2.3em;
    margin-bottom: 5px;
    font-size: 0.55rem;
  }

  .player-metrics dd {
    font-size: 1rem;
  }

  .chart-card,
  .history-card {
    border-radius: 17px;
  }

  .chart-card > header,
  .history-card > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 16px 14px;
  }

  .chart-header-actions {
    width: 100%;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .chart-shell {
    overflow-x: auto;
    padding: 14px 8px 2px;
  }

  #history-chart {
    min-width: 620px;
  }

  .chart-legend {
    padding: 7px 14px 16px;
  }

  .comparison-cards {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .comparison-card {
    padding: 10px;
  }

  .history-card th,
  .history-card td {
    padding-inline: 8px;
  }

  .history-average-column {
    display: table-cell;
    width: 88px;
  }

  .history-days-column {
    display: none;
  }

  .history-days-note {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.56rem;
    font-weight: 600;
  }
}

@media (max-width: 390px) {
  .player-page .header-history-link {
    display: none;
  }
}

@media (max-width: 340px) {
  .comparison-cards {
    grid-template-columns: 1fr;
  }
}
