.fesa-player-profile {
  --fesa-player-blue: #164f91;
  --fesa-player-blue-dark: #0d376b;
  --fesa-player-ink: #172033;
  --fesa-player-muted: #667085;
  --fesa-player-line: #d8e0eb;
  --fesa-player-soft: #f5f7fb;
  --fesa-player-positive: #137a4b;
  --fesa-player-negative: #b33a46;
  box-sizing: border-box;
  color: var(--fesa-player-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 1440px;
  width: 100%;
}

.fesa-player-profile *,
.fesa-player-profile *::before,
.fesa-player-profile *::after {
  box-sizing: border-box;
}

.fesa-player-status {
  align-items: center;
  background: #eef4fb;
  border: 1px solid #cad8ea;
  border-left: 4px solid var(--fesa-player-blue);
  border-radius: 10px;
  color: var(--fesa-player-blue-dark);
  display: flex;
  min-height: 48px;
  padding: 11px 14px;
}

.fesa-player-status[hidden] {
  display: none;
}

.fesa-player-status[data-state="loading"]::before {
  animation: fesa-player-spin 0.8s linear infinite;
  border: 2px solid #b8c8dc;
  border-radius: 50%;
  border-top-color: var(--fesa-player-blue);
  content: "";
  flex: 0 0 auto;
  height: 18px;
  margin-right: 10px;
  width: 18px;
}

.fesa-player-status[data-state="error"] {
  background: #fff5f3;
  border-color: #edc6bd;
  border-left-color: #b54730;
  color: #8f2f1d;
}

.fesa-player-header,
.fesa-player-section {
  background: #ffffff;
  border: 1px solid var(--fesa-player-line);
}

.fesa-player-header {
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(26, 47, 79, 0.08);
  overflow: hidden;
}

.fesa-player-identity {
  padding: 30px 34px 28px;
  text-align: center;
}

.fesa-player-id {
  color: var(--fesa-player-blue);
  display: block;
  font-size: 0.72em;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fesa-player-name {
  color: #102a50;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4em, 5vw, 3.5em);
  line-height: 1.03;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.fesa-player-updated {
  color: var(--fesa-player-muted);
  font-size: 0.82em;
  margin: 10px 0 0;
}

.fesa-player-metrics {
  background: var(--fesa-player-line);
  border-top: 1px solid var(--fesa-player-line);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.fesa-player-metric {
  align-content: start;
  background: #ffffff;
  display: grid;
  gap: 4px;
  min-height: 116px;
  padding: 18px 20px;
}

.fesa-player-metric-label {
  color: var(--fesa-player-muted);
  font-size: 0.7em;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fesa-player-metric-value {
  color: #102a50;
  font-size: 1.3em;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.fesa-player-metric-detail {
  color: var(--fesa-player-muted);
  font-size: 0.78em;
  min-height: 1.5em;
}

.fesa-player-activity {
  background: #f4f7fb;
  border-top: 1px solid var(--fesa-player-line);
  padding: 20px 22px 22px;
}

.fesa-player-activity-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 0 2px 13px;
}

.fesa-player-activity-heading h3 {
  color: #102a50;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35em;
  line-height: 1.15;
  margin: 0;
}

.fesa-player-activity-heading p {
  color: var(--fesa-player-muted);
  font-size: 0.8em;
  margin: 0;
  text-align: right;
}

.fesa-player-activity-metrics {
  background: var(--fesa-player-line);
  border: 1px solid var(--fesa-player-line);
  border-radius: 12px;
  display: grid;
  gap: 1px;
  grid-template-columns: 1.05fr 1fr 1fr 1fr 1.45fr;
  overflow: hidden;
}

.fesa-player-activity-metrics .fesa-player-metric {
  background: #ffffff;
  min-height: 104px;
  padding: 16px 18px;
}

.fesa-player-metric[data-player-metric="activity-status"] .fesa-player-metric-value {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.fesa-player-metric[data-player-metric="activity-status"] .fesa-player-metric-value::before {
  background: #8390a3;
  border-radius: 50%;
  content: "";
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.fesa-player-metric[data-activity-state="active"] .fesa-player-metric-value {
  color: var(--fesa-player-positive);
}

.fesa-player-metric[data-activity-state="active"] .fesa-player-metric-value::before {
  background: var(--fesa-player-positive);
  box-shadow: 0 0 0 4px rgba(19, 122, 75, 0.12);
}

.fesa-player-metric[data-activity-state="inactive"] .fesa-player-metric-value {
  color: #9a5d00;
}

.fesa-player-metric[data-activity-state="inactive"] .fesa-player-metric-value::before {
  background: #c47a0b;
  box-shadow: 0 0 0 4px rgba(196, 122, 11, 0.12);
}

.fesa-player-section {
  border-radius: 16px;
  margin-top: 22px;
  overflow: hidden;
}

.fesa-player-section-heading {
  align-items: end;
  border-bottom: 1px solid var(--fesa-player-line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 24px;
}

.fesa-player-section-heading h3 {
  color: #102a50;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65em;
  line-height: 1.1;
  margin: 0;
}

.fesa-player-section-heading p {
  color: var(--fesa-player-muted);
  font-size: 0.86em;
  margin: 0;
  text-align: right;
}

.fesa-player-chart-shell {
  background: #fbfcfe;
  min-width: 0;
  position: relative;
}

.fesa-player-chart-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #9cadc2 #edf2f7;
  scrollbar-width: thin;
}

.fesa-player-chart {
  display: block;
  height: auto;
  min-width: 980px;
  width: 100%;
}

.fesa-player-rank-band--even {
  fill: #f5f8fc;
}

.fesa-player-rank-band--odd {
  fill: #edf3fa;
}

.fesa-player-chart-grid {
  stroke: #cfd9e7;
  stroke-width: 1;
}

.fesa-player-chart-axis-title {
  fill: #405168;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fesa-player-rank-label {
  fill: #173c6b;
  font-size: 10.5px;
  font-weight: 800;
}

.fesa-player-rank-range {
  fill: #667085;
  font-size: 9.5px;
}

.fesa-player-elo-label,
.fesa-player-chart-date {
  fill: #526177;
  font-size: 10px;
}

.fesa-player-rating-line-shadow {
  stroke: rgba(13, 55, 107, 0.15);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8;
}

.fesa-player-rating-line {
  stroke: var(--fesa-player-blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
}

.fesa-player-rating-point {
  fill: #ffffff;
  stroke: var(--fesa-player-blue);
  stroke-width: 3;
}

.fesa-player-rating-point:hover,
.fesa-player-rating-point:focus {
  fill: #f5c451;
  outline: none;
  r: 7;
}

.fesa-player-chart-tooltip {
  background: #102a50;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(16, 42, 80, 0.24);
  color: #ffffff;
  display: grid;
  gap: 2px;
  max-width: min(300px, calc(100% - 24px));
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  width: max-content;
  z-index: 6;
}

.fesa-player-chart-tooltip[hidden] {
  display: none;
}

.fesa-player-chart-tooltip span,
.fesa-player-chart-tooltip small {
  color: #dbe7f5;
  overflow-wrap: anywhere;
}

.fesa-player-history-scroll {
  max-height: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #9cadc2 #edf2f7;
  scrollbar-width: thin;
}

.fesa-player-history-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 940px;
  width: 100%;
}

.fesa-player-history-table th,
.fesa-player-history-table td {
  border-bottom: 1px solid #e5ebf2;
  color: #233249;
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

.fesa-player-history-table th {
  background: #123f78;
  border-bottom-color: #0d315f;
  color: #ffffff;
  font-size: 0.78em;
  font-weight: 850;
  letter-spacing: 0.055em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  white-space: nowrap;
  z-index: 4;
}

.fesa-player-history-table tbody tr:hover:not(.fesa-player-legacy-row) {
  background: #f7faff;
}

.fesa-player-event-cell {
  min-width: 330px;
}

.fesa-player-event-link,
.fesa-player-legacy-link {
  color: var(--fesa-player-blue);
  font-weight: 760;
  text-decoration-color: rgba(22, 79, 145, 0.35);
  text-underline-offset: 0.18em;
}

.fesa-player-event-link:hover,
.fesa-player-event-link:focus-visible,
.fesa-player-legacy-link:hover,
.fesa-player-legacy-link:focus-visible {
  color: var(--fesa-player-blue-dark);
  text-decoration-color: currentColor;
}

.fesa-player-delta {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.fesa-player-delta.is-positive {
  color: var(--fesa-player-positive);
}

.fesa-player-delta.is-negative {
  color: var(--fesa-player-negative);
}

.fesa-player-games-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fesa-player-promotion {
  background: #e8f1ff;
  border: 1px solid #bfd3f0;
  border-radius: 999px;
  color: var(--fesa-player-blue);
  display: inline-flex;
  font-size: 0.78em;
  font-weight: 850;
  padding: 4px 8px;
  white-space: nowrap;
}

.fesa-player-history-empty {
  color: var(--fesa-player-muted) !important;
  padding: 24px !important;
  text-align: center !important;
}

.fesa-player-legacy-row td {
  background: #fff8e8;
  border-bottom: 0;
  color: #5e4a1c;
  padding: 18px 20px;
  white-space: normal;
}

.fesa-player-analysis-note {
  color: var(--fesa-player-muted);
  font-size: 0.82em;
  margin: 10px 4px 0;
  text-align: right;
}

.fesa-player-empty {
  color: var(--fesa-player-muted);
  margin: 0;
  padding: 24px;
}

.fesa-player-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.fesa-player-example-page-title {
  background: #1c38aa;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding: 42px clamp(20px, 6vw, 70px);
}

.fesa-player-example-panel {
  overflow: visible;
  padding: 0;
}

.fesa-player-example-stage {
  background: #ffffff;
  padding: clamp(18px, 4vw, 42px);
}

.fesa-player-example-stack {
  grid-template-columns: minmax(0, 1fr);
}

.fesa-player-example-stack > * {
  max-width: 100%;
  min-width: 0;
}

.fesa-player-example-integration code {
  overflow-wrap: anywhere;
  white-space: normal;
}

@keyframes fesa-player-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .fesa-player-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fesa-player-activity-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fesa-player-activity-metrics [data-player-metric="strongest-opponent"] {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .fesa-player-identity {
    padding: 24px 18px;
  }

  .fesa-player-name {
    font-size: 2.35em;
  }

  .fesa-player-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fesa-player-metric {
    min-height: 104px;
    padding: 15px;
  }

  .fesa-player-activity {
    padding: 17px 14px 18px;
  }

  .fesa-player-activity-heading {
    align-items: start;
    display: grid;
    gap: 5px;
  }

  .fesa-player-activity-heading p {
    text-align: left;
  }

  .fesa-player-activity-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fesa-player-activity-metrics [data-player-metric="activity-status"],
  .fesa-player-activity-metrics [data-player-metric="strongest-opponent"] {
    grid-column: 1 / -1;
  }

  .fesa-player-section-heading {
    align-items: start;
    display: grid;
    padding: 17px 18px;
  }

  .fesa-player-section-heading p {
    text-align: left;
  }

}

@media (prefers-reduced-motion: reduce) {
  .fesa-player-status[data-state="loading"]::before {
    animation: none;
  }
}
