:root {
  --bg0: #0f1c14;
  --bg1: #173323;
  --ink: #f3f0e6;
  --muted: #a8b5a8;
  --line: rgba(243, 240, 230, 0.12);
  --accent: #c6f26d;
  --accent-2: #7fd4c5;
  --card: rgba(12, 28, 18, 0.72);
  --warn: #f0b35a;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background: radial-gradient(1200px 600px at 10% -10%, #2a5a3a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1b3d4a 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 55%, #0c1610);
}

.pitch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 48px,
    rgba(255, 255, 255, 0.25) 48px,
    rgba(255, 255, 255, 0.25) 49px
  );
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  padding: 1.5rem 1.5rem 0.75rem;
  position: relative;
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.main-nav a:hover {
  color: var(--ink);
  background: rgba(198, 242, 109, 0.08);
}

.main-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--line);
  background: rgba(198, 242, 109, 0.1);
}

.main-nav.compact {
  margin-top: 0.45rem;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  letter-spacing: 0.04em;
  line-height: 0.9;
  color: var(--accent);
}

.tag {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.stats div {
  text-align: right;
}

.stats dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats dd {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem 0.25rem;
  position: relative;
}

.filters label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filters label.grow {
  flex: 1 1 220px;
}

.filters select,
.filters input {
  min-width: 140px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.meta {
  padding: 0.25rem 1.5rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  margin: 0 1rem 2rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(8px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: rgba(10, 22, 14, 0.95);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 1;
}

tbody tr:hover {
  background: rgba(198, 242, 109, 0.06);
}

.player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 200px;
}

td:first-child img,
td:first-child .crest {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #102018;
  display: block;
}

td:first-child img {
  width: 36px;
  height: 36px;
}

.crest {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  object-fit: cover;
  background: #102018;
  flex-shrink: 0;
}

.name {
  font-weight: 600;
}

.sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  min-width: 2rem;
  justify-content: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-variant-numeric: tabular-nums;
}

.badge.hi {
  background: rgba(198, 242, 109, 0.18);
  color: var(--accent);
}

.badge.mid {
  background: rgba(127, 212, 197, 0.16);
  color: var(--accent-2);
}

.money {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .top {
    flex-direction: column;
    align-items: start;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
  .stats div {
    text-align: left;
  }
}

/* —— Player detail —— */
.player-top {
  align-items: start;
}

.brand.compact {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-top: 0.35rem;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent);
}

.player-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  position: relative;
}

.player-page .status {
  color: var(--muted);
}

.player-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  align-items: center;
  margin: 0.5rem 0 1.25rem;
}

.player-hero .portrait {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #102018;
}

.player-hero .portrait.placeholder {
  display: block;
}

.player-hero h1 {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.crest.inline {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.meta-line {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.25rem;
  border: 1px solid var(--line);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(198, 242, 109, 0.06);
  font-size: 0.85rem;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 0.9rem 1rem;
  backdrop-filter: blur(8px);
}

.panel.wide {
  margin-top: 0.85rem;
}

.panel h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.panel h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.facts {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.facts div {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 0.5rem;
}

.facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.facts dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.facts a {
  color: var(--accent-2);
}

.hint,
.note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.club-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.club-row img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #102018;
  border-radius: 8px;
}

.plain {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.table-wrap.nested {
  margin: 0;
  border-radius: 10px;
}

.table-wrap.nested table {
  min-width: 640px;
}

a.player-link {
  color: inherit;
  text-decoration: none;
}

a.player-link:hover .name {
  color: var(--accent);
}

td a.photo-link {
  display: inline-block;
}

@media (max-width: 560px) {
  .player-hero {
    grid-template-columns: 88px 1fr;
  }
  .player-hero .portrait {
    width: 88px;
    height: 88px;
  }
}

/* —— Schedule / fixtures —— */
.fixtures-table {
  min-width: 780px;
}

.fixtures-table .when {
  display: grid;
  gap: 0.1rem;
}

.fixtures-table .score-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fixtures-table .score {
  display: inline-flex;
  min-width: 2.6rem;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fixtures-table .score.done {
  color: var(--accent);
}

.fixtures-table .score.live {
  color: var(--warn);
}

.fixtures-table .score.empty {
  color: var(--muted);
  font-weight: 500;
}

.fixtures-table.club-fixtures {
  min-width: 640px;
}

@media (max-width: 900px) {
  .top {
    flex-wrap: wrap;
  }
  .main-nav {
    order: 3;
    width: 100%;
  }
}
