.fesa-tournament-overview {
  --fesa-ink: #172033;
  --fesa-muted: #667085;
  --fesa-line: #d7deea;
  --fesa-surface: #ffffff;
  --fesa-soft: #f5f7fb;
  --fesa-blue: #164f91;
  --fesa-blue-dark: #0d376b;
  --fesa-gold: #dcae42;
  box-sizing: border-box;
  color: var(--fesa-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: 1280px;
  width: 100%;
}

.fesa-tournament-overview *,
.fesa-tournament-overview *::before,
.fesa-tournament-overview *::after {
  box-sizing: border-box;
}

.fesa-archive-notice {
  align-items: baseline;
  background: #eef4fb;
  border: 1px solid #cad8ea;
  border-left: 4px solid var(--fesa-blue);
  border-radius: 10px;
  color: var(--fesa-ink);
  display: grid;
  gap: 6px 14px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0 0 14px;
  padding: 10px 14px;
}

.fesa-archive-notice strong {
  color: var(--fesa-blue-dark);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fesa-archive-notice span {
  color: #475467;
  font-size: 0.9rem;
}

.fesa-archive-notice a {
  color: var(--fesa-blue);
  font-weight: 750;
  text-underline-offset: 0.15em;
}

.fesa-archive-notice a:hover,
.fesa-archive-notice a:focus-visible {
  color: var(--fesa-blue-dark);
}

.fesa-filter-bar {
  align-items: end;
  background: var(--fesa-soft);
  border: 1px solid var(--fesa-line);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(110px, 0.7fr) minmax(150px, 0.9fr) minmax(260px, 2fr) minmax(150px, 0.9fr);
  margin-bottom: 14px;
  padding: 16px;
}

.fesa-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.fesa-filter-bar label > span {
  color: var(--fesa-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fesa-filter-bar input,
.fesa-filter-bar select {
  appearance: none;
  background: var(--fesa-surface);
  border: 1px solid #bec9da;
  border-radius: 9px;
  color: var(--fesa-ink);
  font: inherit;
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}

.fesa-filter-bar select {
  background-image:
    linear-gradient(45deg, transparent 50%, #607089 50%),
    linear-gradient(135deg, #607089 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 19px,
    calc(100% - 11px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 32px;
}

.fesa-filter-bar input:focus,
.fesa-filter-bar select:focus {
  border-color: var(--fesa-blue);
  box-shadow: 0 0 0 3px rgba(22, 79, 145, 0.15);
  outline: none;
}

.fesa-overview-status {
  color: var(--fesa-muted);
  font-size: 0.9rem;
  margin: 10px 2px 16px;
  min-height: 1.5em;
}

.fesa-overview-status[data-state="error"],
.fesa-overview-status[data-state="empty"] {
  color: #9c341e;
}

.fesa-overview-status[data-state="ready"] {
  color: #24623d;
}

.fesa-tournament-group + .fesa-tournament-group {
  margin-top: 24px;
}

.fesa-group-heading {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 2px 9px;
}

.fesa-group-heading h3 {
  color: var(--fesa-blue-dark);
  font-size: 1.05rem;
  margin: 0;
}

.fesa-group-heading span {
  color: var(--fesa-muted);
  font-size: 0.82rem;
}

.fesa-table-scroll {
  border: 1px solid var(--fesa-line);
  border-radius: 12px;
  overflow-x: auto;
}

.fesa-tournament-table {
  background: var(--fesa-surface);
  border-collapse: collapse;
  min-width: 1020px;
  table-layout: fixed;
  width: 100%;
}

.fesa-column-name {
  width: 280px;
}

.fesa-column-date {
  width: 180px;
}

.fesa-column-time {
  width: 190px;
}

.fesa-column-country {
  width: 120px;
}

.fesa-column-city {
  width: 130px;
}

.fesa-column-participants {
  width: 120px;
}

.fesa-tournament-table th,
.fesa-tournament-table td {
  border-bottom: 1px solid #e5eaf2;
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

.fesa-tournament-table th {
  background: #edf2f8;
  color: #334155;
  font-size: 0.76rem;
  letter-spacing: 0.035em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}

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

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

.fesa-sort-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  padding: 0;
  text-align: left;
  text-transform: inherit;
}

.fesa-sort-button:hover,
.fesa-sort-button:focus-visible {
  color: var(--fesa-blue);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.fesa-sort-indicator {
  color: var(--fesa-blue);
}

.fesa-tournament-name {
  overflow-wrap: anywhere;
}

.fesa-tournament-link {
  color: var(--fesa-blue);
  font-weight: 750;
  text-decoration: none;
  text-underline-offset: 0.16em;
}

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

.fesa-participants-cell {
  white-space: nowrap;
}

.fesa-participant-summary {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  line-height: 1;
  vertical-align: middle;
}

.fesa-participant-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 20px;
}

.fesa-new-player-badge {
  align-items: center;
  background: #fff5d8;
  border: 1px solid #efcf78;
  border-radius: 999px;
  color: #724d00;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-height: 20px;
  padding: 2px 5px;
  white-space: nowrap;
}

.fesa-new-player-badge::before {
  content: attr(data-count);
  font-size: 0.72rem;
}

.fesa-result-preview {
  background: var(--fesa-surface);
  border: 1px solid #b9c6d8;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.24);
  display: flex;
  flex-direction: column;
  height: min(520px, calc(100vh - 24px));
  inset: auto;
  margin: 0;
  max-height: min(520px, calc(100vh - 24px));
  min-height: 280px;
  overflow: hidden;
  position: fixed;
  z-index: 100000;
}

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

.fesa-preview-loading,
.fesa-preview-message {
  align-items: center;
  color: var(--fesa-muted);
  display: flex;
  flex: 1;
  gap: 12px;
  justify-content: center;
  min-height: 118px;
  padding: 24px;
  text-align: center;
}

.fesa-preview-message {
  color: #9c341e;
}

.fesa-preview-spinner {
  animation: fesa-preview-spin 0.8s linear infinite;
  border: 3px solid #dce4ef;
  border-radius: 50%;
  border-top-color: var(--fesa-blue);
  display: inline-block;
  height: 24px;
  width: 24px;
}

.fesa-preview-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--fesa-line);
  flex: 0 0 auto;
  padding: 14px 16px 12px;
}

.fesa-preview-kicker {
  color: var(--fesa-blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.fesa-preview-title {
  color: var(--fesa-blue-dark);
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 0;
}

.fesa-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
}

.fesa-preview-meta-item {
  align-items: baseline;
  display: inline-flex;
  font-size: 0.95rem;
  gap: 4px;
  white-space: nowrap;
}

.fesa-preview-meta-label {
  color: var(--fesa-muted);
}

.fesa-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.fesa-preview-frame {
  border: 0;
  display: block;
  height: 100%;
  min-height: 0;
  width: 100%;
}

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

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

@media (max-width: 820px) {
  .fesa-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .fesa-filter-search {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 520px) {
  .fesa-archive-notice {
    grid-template-columns: 1fr;
  }

  .fesa-filter-bar {
    grid-template-columns: 1fr;
  }

  .fesa-filter-search {
    grid-column: auto;
  }

  .fesa-result-preview {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fesa-preview-spinner {
    animation-duration: 1.8s;
  }
}
