:root,
[data-theme="dark"] {
  --bg: #050505;
  --bg-soft: #0c0c0c;
  --fg: #f2f2f0;
  --muted: #8a8a84;
  --line: rgba(242, 242, 240, 0.12);
  --accent: #c8f542;
  --header-bg: transparent;
  --menu-bg: rgba(12, 12, 12, 0.96);
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-bg-hover: rgba(255, 255, 255, 0.04);
  --font-display: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
}

[data-theme="light"] {
  --bg: #f4f4f1;
  --bg-soft: #ffffff;
  --fg: #161614;
  --muted: #6b6b66;
  --line: rgba(22, 22, 20, 0.12);
  --accent: #5a8f00;
  --header-bg: rgba(255, 255, 255, 0.72);
  --menu-bg: rgba(255, 255, 255, 0.98);
  --card-bg: #ffffff;
  --card-bg-hover: #fafaf7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  font-family: var(--font-body);
  background:
    radial-gradient(
      ellipse 80% 50% at 50% -20%,
      color-mix(in srgb, var(--accent) 12%, transparent),
      transparent 55%
    ),
    radial-gradient(
      ellipse 60% 40% at 100% 100%,
      rgba(127, 127, 127, 0.06),
      transparent 50%
    ),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}

.logo img {
  display: block;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  justify-content: center;
  font-size: 0.95rem;
}

.nav a[aria-current="page"],
.nav summary[aria-current="page"] {
  color: var(--accent);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 12rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--menu-bg);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 20;
}

.nav-dropdown-menu a {
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a[aria-current="page"] {
  background: var(--card-bg-hover);
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.lang-sep {
  opacity: 0.4;
}

.harmeyn {
  width: min(920px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  flex: 1;
}

.page-hero {
  margin-bottom: 2.25rem;
  animation: rise 0.6s ease both;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.page-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lead {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.pickers {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  animation: rise 0.7s ease 0.08s both;
}

.picker {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.picker:focus-within {
  z-index: 30;
}

.picker-actions {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
}

.btn-reset {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-reset:hover {
  background: var(--card-bg-hover);
}

.picker-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.picker-field {
  position: relative;
  z-index: 1;
}

.picker-field input {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--bg-soft);
  color: var(--fg);
  font: inherit;
  padding: 0.85rem 1rem;
  outline: none;
}

.picker-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.suggestions[hidden],
.selected[hidden],
.btn-reset[hidden] {
  display: none !important;
}

.suggestions {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--menu-bg);
  max-height: 16rem;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  -webkit-overflow-scrolling: touch;
}

.suggestions .suggestion-item {
  display: block;
  width: 100%;
  margin: 0;
  border-radius: 0.55rem;
  cursor: pointer;
}

.suggestions .suggestion-btn {
  width: 100%;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  cursor: pointer;
  box-sizing: border-box;
}

/* Satırın her yerinden seçim — sadece isim metnine bağlı kalmasın */
.suggestions .suggestion-btn * {
  pointer-events: none;
}

.suggestions .suggestion-item:hover .suggestion-btn,
.suggestions .suggestion-btn:hover,
.suggestions .suggestion-btn:focus-visible {
  background: var(--card-bg-hover);
  outline: none;
}

.suggestions img,
.selected img,
.match-badge {
  display: none;
}

.suggestion-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.suggestion-meta strong {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta span {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-country,
.selected-country {
  font-size: 0.8rem;
  color: var(--muted);
}

.selected {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--card-bg);
  animation: rise 0.35s ease both;
}

.selected .selected-text {
  flex: 1;
  min-width: 0;
}

.selected .selected-text strong {
  display: block;
}

.selected .selected-text span {
  font-size: 0.85rem;
  color: var(--muted);
}

.selected button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.results {
  position: relative;
  z-index: 1;
  margin-top: 2.25rem;
  min-height: 6rem;
  animation: rise 0.75s ease 0.12s both;
}

.results-hint,
.results-empty,
.results-error,
.results-loading {
  color: var(--muted);
  margin: 0;
}

.results-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1rem;
}

.player-filter {
  flex: 1 1 14rem;
  max-width: 22rem;
}

.player-filter input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--bg-soft);
  color: var(--fg);
  font: inherit;
  padding: 0.7rem 0.95rem;
  outline: none;
}

.player-filter input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.match-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 0.5rem 0;
  list-style: none;
}

.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.match-item {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--card-bg);
  transition: background 0.2s ease, transform 0.2s ease;
  animation: rise 0.45s ease both;
}

.match-item:hover {
  background: var(--card-bg-hover);
  transform: translateY(-1px);
}

.match-badge {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.match-body strong {
  display: block;
  font-size: 1.05rem;
}

.match-years {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.data-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.results-meta {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer {
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .nav {
    display: none;
  }

  .pickers {
    grid-template-columns: 1fr;
  }

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