.fesa-tournament-result {
  --fesa-result-ink: #172033;
  --fesa-result-muted: #667085;
  --fesa-result-line: #d8e0eb;
  --fesa-result-surface: #ffffff;
  --fesa-result-soft: #f5f7fb;
  --fesa-result-blue: #164f91;
  --fesa-result-blue-dark: #0d376b;
  --fesa-result-green: #137a4b;
  --fesa-result-green-soft: #e9f7f0;
  --fesa-result-red: #b33a46;
  --fesa-result-red-soft: #fff0f1;
  box-sizing: border-box;
  color: var(--fesa-result-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-tournament-result *,
.fesa-tournament-result *::before,
.fesa-tournament-result *::after {
  box-sizing: border-box;
}

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

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

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

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

.fesa-result-header {
  background: #ffffff;
  border: 1px solid #ced9e8;
  border-radius: 18px 18px 0 0;
  padding: 22px 30px 24px;
}

.fesa-result-header-main {
  margin: 20px auto 0;
  min-width: 0;
  text-align: center;
}

.fesa-result-navigation {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 38px;
}

.fesa-result-nav-link {
  align-items: center;
  background: #164f91;
  border: 1px solid #164f91;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.78em;
  font-weight: 800;
  min-height: 36px;
  padding: 7px 13px;
  text-decoration: none;
}

.fesa-result-nav-link:hover,
.fesa-result-nav-link:focus-visible {
  background: #0d376b;
  border-color: #0d376b;
  color: #ffffff;
  outline: 3px solid rgba(22, 79, 145, 0.2);
  outline-offset: 2px;
}

.fesa-result-nav-link.is-disabled {
  background: #eef2f7;
  border-color: #d8e0eb;
  color: #9aa5b4;
  cursor: default;
}

.fesa-result-title {
  color: #102a50;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2em, 4vw, 3.2em);
  line-height: 1.06;
  margin: 0;
  overflow-wrap: anywhere;
}

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

.fesa-result-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: center;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.fesa-result-meta-item {
  align-items: baseline;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.fesa-result-meta-item strong {
  color: #20344f;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.fesa-result-meta-label {
  color: var(--fesa-result-muted);
  font-size: 0.69em;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.fesa-result-table-scroll {
  background: var(--fesa-result-surface);
  border: 1px solid var(--fesa-result-line);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 18px 45px rgba(26, 47, 79, 0.08);
  overflow: auto;
  overscroll-behavior-x: contain;
  position: relative;
  scrollbar-color: #9cadc2 #edf2f7;
  scrollbar-width: thin;
}

.fesa-result-table {
  background: var(--fesa-result-surface);
  border-collapse: separate;
  border-spacing: 0;
  min-width: max(100%, 1040px);
  width: max-content;
}

.fesa-result-table th,
.fesa-result-table td {
  border-bottom: 1px solid #e6ebf2;
  color: #233249;
  padding: 12px 11px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.fesa-result-table th {
  background: #123f78;
  border-bottom-color: #0d315f;
  color: #ffffff;
  font-size: 0.78em;
  font-weight: 850;
  letter-spacing: 0.06em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 5;
}

.fesa-result-table th:first-child,
.fesa-result-table td:first-child {
  padding-left: 18px;
}

.fesa-result-table th:last-child,
.fesa-result-table td:last-child {
  padding-right: 18px;
}

.fesa-result-table tbody tr:last-child td {
  border-bottom: 0;
}

.fesa-result-table tbody tr:hover {
  background: #f8fafc;
}

.fesa-result-table tbody tr:focus-within {
  background: #f2f7fc;
}

.fesa-result-table tbody tr.fesa-player-row--new {
  background: #fffaf0;
}

.fesa-result-table tbody tr.fesa-player-row--new:hover,
.fesa-result-table tbody tr.fesa-player-row--new:focus-within {
  background: #fff4d6;
}

.fesa-rank-cell,
.fesa-points-cell,
.fesa-delta-cell,
.fesa-elo-cell {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.fesa-rank-cell {
  color: var(--fesa-result-muted) !important;
  min-width: 62px;
}

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

.fesa-result-player-link,
.fesa-hover-player-link {
  color: var(--fesa-result-blue);
  font-weight: 760;
  text-decoration: underline;
  text-decoration-color: rgba(22, 79, 145, 0.34);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.fesa-result-player-link[aria-disabled="true"] {
  color: inherit;
  text-decoration: none;
}

.fesa-new-player-mark {
  background: #f9d96a;
  border: 1px solid #d5a91b;
  border-radius: 999px;
  color: #76540c;
  display: inline-flex;
  font-size: 0.67em;
  font-weight: 850;
  letter-spacing: 0.04em;
  margin-left: 8px;
  padding: 2px 6px;
  text-transform: uppercase;
  vertical-align: 0.08em;
}

.fesa-new-player-mark::before {
  content: "★";
  margin-right: 4px;
}

.fesa-grade-cell {
  color: #35445a;
}

.fesa-inline-promotion {
  background: #e8f1ff;
  border: 1px solid #bfd3f0;
  border-radius: 999px;
  color: #164f91;
  display: inline-flex;
  font-size: 0.7em;
  font-weight: 850;
  margin-left: 7px;
  padding: 3px 7px;
}

.fesa-round-heading,
.fesa-round-cell {
  min-width: 58px;
  text-align: center !important;
}

.fesa-round-reference {
  border-radius: 999px;
  cursor: help;
  display: inline-flex;
  outline: none;
}

.fesa-round-reference:focus-visible {
  box-shadow: 0 0 0 3px rgba(22, 79, 145, 0.2);
}

.fesa-round-token {
  align-items: center;
  border: 1px solid #ccd5e2;
  border-radius: 999px;
  display: inline-flex;
  font-size: 1em;
  font-weight: 820;
  justify-content: center;
  line-height: 1;
  min-height: 34px;
  min-width: 46px;
  padding: 7px 9px;
}

.fesa-round-token--win {
  background: var(--fesa-result-green-soft);
  border-color: #a9dbc3;
  color: var(--fesa-result-green);
}

.fesa-round-token--loss {
  background: var(--fesa-result-red-soft);
  border-color: #efc4c9;
  color: var(--fesa-result-red);
}

.fesa-round-token--none,
.fesa-round-token--draw {
  background: #f3f5f8;
  border-color: #d9dfe8;
  color: #788397;
}

.fesa-result-hover-card {
  background: #ffffff;
  border: 1px solid #cbd6e4;
  border-radius: 13px;
  box-shadow: 0 18px 48px rgba(22, 40, 68, 0.2);
  color: var(--fesa-result-ink);
  inset: unset;
  margin: 0;
  max-height: min(440px, calc(100vh - 24px));
  max-width: calc(100vw - 24px);
  overflow: auto;
  padding: 14px;
  position: fixed;
  width: min(390px, calc(100vw - 24px));
  z-index: 2147483646;
}

.fesa-result-hover-card[hidden] {
  display: none;
}

.fesa-player-history-card,
.fesa-result-opponent-card {
  display: grid;
  gap: 5px;
}

.fesa-hover-title {
  color: #172b4a;
  font-size: 1em;
}

.fesa-hover-subtitle {
  color: var(--fesa-result-blue);
  font-size: 0.7em;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fesa-hover-detail,
.fesa-hover-empty {
  color: var(--fesa-result-muted);
  font-size: 0.84em;
}

.fesa-opponent-history-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.fesa-opponent-history-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e3e9f1;
  border-radius: 9px;
  display: grid;
  gap: 9px;
  grid-template-columns: 32px minmax(130px, 1fr) auto;
  padding: 7px 8px;
}

.fesa-opponent-round {
  color: var(--fesa-result-muted);
  font-weight: 800;
}

.fesa-opponent-name {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.fesa-opponent-name strong,
.fesa-opponent-name a {
  overflow: hidden;
  text-overflow: ellipsis;
}

.fesa-opponent-name small {
  color: var(--fesa-result-muted);
}

.fesa-opponent-history-item .fesa-round-token {
  min-height: 26px;
}

.fesa-promotions {
  background: #ffffff;
  border: 1px solid var(--fesa-result-line);
  border-radius: 14px;
  margin-top: 22px;
  padding: 22px 24px;
}

.fesa-promotions-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.fesa-promotions-heading h3 {
  color: #102a50;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6em;
  margin: 0;
}

.fesa-promotions-count {
  align-items: center;
  background: #164f91;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.72em;
  font-weight: 850;
  height: 25px;
  justify-content: center;
  min-width: 25px;
  padding: 0 7px;
}

.fesa-promotions-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.fesa-promotion-item {
  align-items: center;
  border-bottom: 1px solid #e5eaf1;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-width: 0;
  padding: 9px 2px;
}

.fesa-promotion-item .fesa-result-player-link,
.fesa-promotion-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fesa-promotion-arrow {
  color: var(--fesa-result-muted);
}

.fesa-promotion-grade {
  color: #164f91;
  white-space: nowrap;
}

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

.fesa-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-example-result-panel {
  overflow: visible;
  padding: 0;
}

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

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

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

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

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

@media (max-width: 640px) {
  .fesa-result-header {
    border-radius: 13px 13px 0 0;
    padding: 21px 18px;
  }

  .fesa-result-title {
    font-size: 2em;
  }

  .fesa-result-meta {
    gap: 8px 16px;
  }

  .fesa-result-nav-link {
    font-size: 0.69em;
    min-height: 34px;
    padding: 6px 10px;
  }

  .fesa-result-table th,
  .fesa-result-table td {
    padding-bottom: 10px;
    padding-top: 10px;
  }

  .fesa-promotions {
    padding: 18px;
  }

  .fesa-promotions-list {
    grid-template-columns: 1fr;
  }
}

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