:root {
  --slate: #364A61;
  --slate-light: #6F8298;
  --slate-50: #F2F5F7;
  --burgundy: #6F1D2A;
  --off-white: #F7F5F1;
  --gold: #B8955A;
  --charcoal: #222222;
  --muted: #666666;
  --border: #D9D4CC;
  --white: #ffffff;
  --shadow: 0 4px 16px rgba(64, 85, 110, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--off-white);
  color: var(--charcoal);
  font-size: 16px;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: "Merriweather", Georgia, serif;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header / brand */

.site-header {
  background:
    radial-gradient(circle at 18% 42%, rgba(111, 130, 152, 0.24), transparent 30rem),
    linear-gradient(135deg, var(--slate) 0%, #2F4053 100%);
  color: var(--off-white);
  border-bottom: 4px solid var(--burgundy);
}

.header-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1rem, 2.1vw, 1.9rem) 0;
}

.site-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.85rem, 1.9vw, 1.35rem);
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.site-brand-mark {
  display: block;
  width: clamp(76px, 9vw, 122px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.22));
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-title {
  font-family: "Source Serif 4", "Merriweather", Georgia, serif;
  font-size: clamp(2.1rem, 5.2vw, 4.25rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--off-white);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  white-space: nowrap;
}

.site-tagline {
  margin-top: clamp(0.22rem, 0.6vw, 0.45rem);
  font-family: "Inter", "Source Sans 3", system-ui, sans-serif;
  font-size: clamp(0.76rem, 1.35vw, 1.08rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--border);
  white-space: nowrap;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2F4053;
  color: var(--white);
  border-bottom: 4px solid var(--burgundy);
  box-shadow: var(--shadow);
}

.nav-inner,
.page-content {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 1rem;
}

.brand {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.9);
}

.nav-links a:hover {
  background: rgba(111, 29, 42, 0.28);
}

.header-tools {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.65rem 0 0;
  display: flex;
  justify-content: flex-end;
}

.date-format-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.date-format-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 650;
}

.date-format-btn {
  border: 1px solid #cfcfcf;
  background: #f7f7f7;
  color: #444;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.date-format-btn:hover {
  background: #ececec;
  border-color: #b5b5b5;
}

.date-format-btn.active {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--white);
}

.page-content {
  padding: 1.75rem 0 4rem;
}

.page-hero,
.home-hero {
  margin-bottom: 1.75rem;
}

.page-hero h1,
.home-hero h1 {
  color: var(--slate);
  font-size: clamp(2rem, 4.6vw, 3.35rem);
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 0.6rem;
}

.eyebrow {
  margin-bottom: 0.45rem;
  color: var(--burgundy);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.hero-intro {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
}

.event-meta,
.event-country {
  color: var(--muted);
  font-size: 0.98rem;
}

.search-panel {
  background: linear-gradient(135deg, var(--slate), var(--slate-light));
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--burgundy);
}

.search-panel h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.search-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.98rem;
}

.home-search {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.home-search input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 1rem;
  font-size: 1rem;
  font-family: inherit;
}

.home-search button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 1.2rem;
  background: var(--burgundy);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.home-search button:hover {
  background: #5d1824;
}

.home-feature-row,
.recent-events-section,
.search-results-section,
.events-section,
.event-tournaments {
  margin-top: 1.85rem;
}

.browse-events-card,
.event-card,
.search-result-card,
.event-listing,
.tournament-results {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.browse-events-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.35rem;
  padding: 1.35rem 1.5rem;
  border-left: 6px solid var(--burgundy);
}

.browse-events-card h2 {
  color: var(--slate);
  margin: 0.25rem 0 0.35rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
}

.feature-label,
.result-type,
.event-card-year {
  display: inline-block;
  color: var(--burgundy);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feature-arrow {
  color: var(--burgundy);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.section-header h2,
.event-tournaments h2 {
  color: var(--slate);
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.section-header a {
  color: var(--burgundy);
  font-size: 0.95rem;
  font-weight: 750;
}

.recent-events-grid,
.search-results-grid,
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.event-card,
.search-result-card {
  display: block;
  padding: 1.15rem 1.25rem;
  border-left: 5px solid var(--burgundy);
}

.event-card h3,
.search-result-card strong {
  display: block;
  color: var(--slate);
  margin: 0.3rem 0 0.65rem;
  font-size: 1.08rem;
  line-height: 1.3;
}

.event-card p {
  margin: 0.35rem 0;
}

.event-card-date,
.event-card-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.event-card-meta {
  font-weight: 700;
}

.event-listing {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.35rem;
}

.event-listing h2 {
  color: var(--slate);
  margin-bottom: 0.65rem;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.events-table-wrap,
.results-table-wrap,
.players-table-wrap {
  overflow-x: auto;
}

.events-table,
.results-table,
.players-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.95rem;
}

.events-table th,
.events-table td,
.results-table th,
.results-table td,
.players-table th,
.players-table td {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.events-table th,
.results-table th,
.players-table th {
  color: var(--slate);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  background: var(--slate-50);
}

.tournament-results {
  margin: 0.85rem 0;
  overflow: hidden;
}

.tournament-results summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--slate);
  background: var(--slate-50);
}

.tournament-meta,
.tournament-notes,
.empty-results {
  padding: 0 1.1rem;
}

.tournament-meta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: var(--muted);
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.event-search-wrap,
.player-search-wrap {
  margin: 0 0 1.5rem 0;
}

.search-input,
.event-search,
.player-search {
  width: 100%;
  max-width: 420px;
  padding: 0.7rem 0.9rem 0.7rem 2.3rem;
  font-size: 0.95rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344l3.387 3.387-1.398 1.398-3.387-3.387a6 6 0 111.398-1.398zM6.5 11A4.5 4.5 0 106.5 2a4.5 4.5 0 000 9z'/%3E%3C/svg%3E")
    no-repeat 0.75rem center;
  background-color: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder,
.event-search::placeholder,
.player-search::placeholder {
  color: #8a8f98;
}

.search-input:focus,
.event-search:focus,
.player-search:focus {
  outline: none;
  border-color: var(--slate-light);
  box-shadow: 0 0 0 3px rgba(111, 130, 152, 0.14);
}

.events-view-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
}

.view-toggle-label {
  font-weight: 700;
  color: #444;
}

.view-toggle-btn {
  border: 1px solid #cfcfcf;
  background: #f7f7f7;
  color: #444;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.view-toggle-btn:hover {
  background: #ececec;
  border-color: #b5b5b5;
}

.view-toggle-btn.active {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--white);
}

.event-title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.event-title-link:hover {
  color: var(--burgundy);
  border-bottom-color: currentColor;
}

.edition-link,
.player-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--burgundy);
}

.edition-link:hover,
.player-link:hover {
  text-decoration: underline;
}

.country-flag {
  width: 18px;
  height: auto;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid #ddd;
}

.site-footer {
  background: var(--slate);
  color: rgba(255, 255, 255, 0.78);
  padding: 1.75rem 1rem;
  text-align: center;
  font-size: 0.92rem;
}

footer {
  margin-top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.sponsors-friends {
  max-width: 1100px;
  margin: 48px auto 0;
  padding: 24px 16px 10px;
  text-align: center;
  border-top: 1px solid #e6e6e6;
}

.sponsors-friends h2 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.sponsor-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  flex-wrap: wrap;
}

.sponsor-card,
.sponsor-card-flip {
  width: 300px;
  height: 290px;
  flex: 0 0 300px;
}

.sponsor-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sponsor-card a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.sponsor-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  flex: 0 0 150px;
}

.sponsor-card-content {
  padding: 13px 14px 15px;
  text-align: left;
}

.sponsor-title {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 700;
  color: #222;
}

.sponsor-label {
  margin-bottom: 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}

.sponsor-card p,
.sponsor-placeholder p,
.flip-back p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #666;
}

.sponsor-card span {
  font-size: 13px;
  font-weight: 600;
  color: #2b7cff;
}

.sponsor-card-flip {
  perspective: 1000px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-inner.flipped {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-back {
  transform: rotateY(180deg);
}

.sponsor-placeholder {
  background:
    repeating-linear-gradient(
      45deg,
      #fafafa,
      #fafafa 10px,
      #f4f4f4 10px,
      #f4f4f4 20px
    );
}

.sponsor-placeholder .sponsor-card-content,
.flip-back .sponsor-card-content {
  text-align: center;
}

.sponsor-placeholder .sponsor-title {
  color: #555;
}

.flip-button {
  border: none;
  background: transparent;
  color: #2b7cff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 0;
}

.flip-button:hover {
  text-decoration: underline;
}

.email-display {
  font-family: monospace;
  font-size: 15px;
  line-height: 1.8;
  color: #444;
}

.bg-point-divider {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 2.1rem auto 1.9rem;
  height: 28px;
  overflow: hidden;
}

.bg-point-divider span {
  display: block;
  width: 42px;
  height: 28px;
  background: var(--slate-light);
  opacity: 0.42;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.bg-point-divider span:nth-child(even) {
  background: var(--slate);
  opacity: 0.34;
  transform: rotate(180deg);
}

/* Responsive */

@media (max-width: 820px) {
  .site-title {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }

  .site-tagline {
    font-size: clamp(0.68rem, 2.2vw, 0.9rem);
    letter-spacing: 0.1em;
  }
}

@media (max-width: 760px) {
  .nav-inner,
  .section-header,
  .home-search {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-inner {
    padding: 0.75rem 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .header-tools {
    justify-content: flex-start;
  }

  .date-format-toggle {
    flex-wrap: wrap;
  }

  .browse-events-card {
    align-items: flex-start;
  }

  .home-search button {
    width: 100%;
  }

  .bg-point-divider {
    margin: 1.6rem auto;
  }

  .bg-point-divider span {
    width: 30px;
    height: 22px;
  }
}

@media (max-width: 560px) {
  .header-inner {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .site-brand-lockup {
    gap: 0.7rem;
  }

  .site-brand-mark {
    width: 62px;
  }

  .site-title {
    font-size: clamp(1.45rem, 8vw, 2.05rem);
    letter-spacing: -0.03em;
  }

  .site-tagline {
    font-size: 0.62rem;
    letter-spacing: 0.07em;
  }
}

@media (max-width: 420px) {
  .site-tagline {
    display: none;
  }
}

.home-hero h1 {
  max-width: 820px;
  font-size: clamp(1.65rem, 3.2vw, 2.45rem);
  line-height: 1.12;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.85rem 0 0;
}

.home-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  text-align: center;
}

.home-stat-card strong {
  display: block;
  color: var(--slate);
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 900;
  line-height: 1.1;
}

.home-stat-card span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .home-stats {
    grid-template-columns: 1fr;
  }
}