:root {
  color-scheme: light;
  --bg: #ececea;
  --card: #fbfbf9;
  --text: #111214;
  --muted: #666a70;
  --accent: #16171a;
  --accent-soft: #e3e4e8;
  --border: #cfcfd4;
  --danger: #a1283f;
  --trim: #c9b06b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #f7f7f5 0%, #efefec 48%, var(--bg) 100%);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #000;
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:hover {
  background: #000;
}

.button-link {
  background: none;
  padding: 0;
  color: var(--accent);
}

.button-link:hover {
  background: none;
}

.button-link.danger {
  color: var(--danger);
}

.shell {
  width: min(1100px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(10, 10, 12, 0.94);
  position: sticky;
  top: 0;
}

.site-header,
.site-header a {
  color: #f5f5f2;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 3rem;
  height: 3rem;
  flex: none;
  object-fit: contain;
  filter: invert(1);
}

.brand span {
  line-height: 1;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links form {
  margin: 0;
}

.nav-button-link {
  color: inherit;
  font: inherit;
}

.page {
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.page-header h1,
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
}

.hero-logo {
  width: min(100%, 420px);
  justify-self: end;
  object-fit: contain;
}

.team-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 1.5rem;
  align-items: center;
  overflow: hidden;
}

.team-hero-copy {
  display: grid;
  gap: 0.9rem;
  align-content: center;
}

.team-hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.95;
}

.team-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #f5f5f2;
  font-weight: 700;
}

.team-link:hover {
  color: #f5f5f2;
  text-decoration: none;
  background: #000;
}

.team-hero-image {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: 1rem;
}

.index-section + .index-section {
  margin-top: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--trim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 700;
}

.lede,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-up {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.index-panels {
  gap: 1.5rem;
}

.competition-summary-grid {
  margin-bottom: 1.5rem;
}

.index-list-card {
  display: flex;
  flex-direction: column;
}

.card-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding-top: 0.75rem;
  margin-left: auto;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #f5f5f2;
  font-weight: 700;
}

.card-action-link:hover {
  color: #f5f5f2;
  text-decoration: none;
  background: #000;
}

.competition-matches-card {
  margin-top: 0.5rem;
}

.competition-back-link {
  margin-top: 1.5rem;
}

.back-link-icon {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-left: 0.14rem solid currentColor;
  border-bottom: 0.14rem solid currentColor;
  transform: rotate(45deg);
}

.season-summary-grid {
  margin-bottom: 1.5rem;
}

.season-competitions-card {
  margin-top: 0.5rem;
}

.seasons-stack {
  margin-top: 1.5rem;
}

.goals-filters-card {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.goals-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.goals-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.goals-filter-actions-right {
  justify-self: end;
  justify-content: flex-end;
}

.goals-layout {
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(240px, 3fr);
  gap: 1rem;
  align-items: start;
}

.goals-table-card {
  overflow-x: auto;
}

.goals-table-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.goals-table-header h2,
.goals-sidebar h2 {
  margin: 0;
}

.goals-sidebar h2 {
  margin-bottom: 0.85rem;
}

.goals-table .goal-entry {
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: start;
}

.goals-table td::before {
  content: none;
}

.goals-sidebar {
  position: sticky;
  top: 6rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination-current {
  font-weight: 600;
}

.pagination-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
}

.pagination-icon {
  width: 0.55rem;
  height: 0.55rem;
  border-top: 0.14rem solid currentColor;
  border-right: 0.14rem solid currentColor;
}

.pagination-icon-prev {
  transform: rotate(-135deg);
}

.pagination-icon-next {
  transform: rotate(45deg);
}

.admin-grid {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card,
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 20px 45px rgba(8, 8, 10, 0.08);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-card strong {
  font-size: 2rem;
}

.admin-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-stat-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  border-radius: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.admin-stat-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  color: #fff;
}

.admin-stat-link:hover {
  background: #000;
  color: #fff;
  text-decoration: none;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.narrow {
  max-width: 540px;
}

label {
  display: grid;
  gap: 0.35rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.roomy-table th,
.roomy-table td {
  padding: 1rem 0.35rem;
}

.roomy-table th:first-child,
.roomy-table td:first-child {
  padding-left: 0;
}

.roomy-table th:last-child,
.roomy-table td:last-child {
  padding-right: 0;
}

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-list li + li {
  margin-top: 0.75rem;
}

.match-list li + li {
  margin-top: 1.2rem;
}

.goal-entry {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.goal-entry-photo {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  object-fit: cover;
  background: var(--accent-soft);
}

.goal-entry .muted {
  display: block;
}

.match-list-meta {
  display: block;
  margin-top: 0.6rem;
}

.match-list-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.match-list-meta-row .match-list-meta {
  margin-top: 0;
}

.match-list-meta-row .match-result-badge {
  margin-left: auto;
}

.match-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
}

.match-scoreline {
  margin: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
}

.match-scoreline.win {
  background: #d9f2df;
  color: #136a2a;
}

.match-scoreline.loss {
  background: #f8dadd;
  color: #9a1f33;
}

.match-scoreline.tie {
  background: #dbeafe;
  color: #1d4ed8;
}

.match-opponent {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.95;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 0.6rem 0 0;
  font-size: 0.98rem;
}

.match-competition {
  color: var(--text);
  font-weight: 700;
}

.match-date {
  color: var(--muted);
}

.match-goal-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.match-goal-photo {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 999px;
  background: var(--accent-soft);
}

.match-goal-item strong,
.match-goal-item .muted {
  display: block;
}

.match-detail-stack {
  max-width: 100%;
}

.match-mvp-card {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.match-mvp-photo {
  width: 4.75rem;
  height: 4.75rem;
  object-fit: cover;
  border-radius: 1rem;
  background: var(--accent-soft);
}

.match-mvp-content {
  min-width: 0;
}

.match-mvp-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.match-mvp-name-row strong {
  font-size: 1.1rem;
}

.match-mvp-stats {
  margin: 0.35rem 0 0;
}

.match-detail-footer {
  margin-top: 1.75rem;
}

.match-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.6rem;
  margin-top: 0.2rem;
}

.match-score {
  font-size: 1rem;
}

.match-result-row .match-result-badge {
  grid-column: 1 / -1;
  justify-self: start;
}

.match-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.match-result-avatar {
  width: 2rem;
  height: 2rem;
  padding: 0;
  flex: none;
}

.match-result-badge.win {
  background: #d9f2df;
  color: #136a2a;
}

.match-result-badge.loss {
  background: #f8dadd;
  color: #9a1f33;
}

.match-result-badge.tie {
  background: #dbeafe;
  color: #1d4ed8;
}

.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.inline-list li + li {
  margin-top: 0;
}

.ranked-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ranked-list-label,
.season-competition-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.leader-crown {
  width: 0.95rem;
  height: 0.8rem;
  flex: none;
  background: linear-gradient(180deg, #ffe37a 0%, #d8a92f 100%);
  clip-path: polygon(0% 100%, 8% 38%, 24% 66%, 36% 12%, 50% 54%, 64% 12%, 76% 66%, 92% 38%, 100% 100%);
  filter: drop-shadow(0 1px 0 rgba(109, 81, 17, 0.35));
}

.leader-crown-black {
  background: #111;
  filter: none;
}

.leader-crown-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  clip-path: none;
  filter: none;
  color: #111;
}

.leader-crown-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.season-competitions-list {
  display: grid;
  gap: 0.85rem;
}

.season-competition-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.player-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.team-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.team-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  font-weight: 700;
}

.team-tab:hover,
.team-tab.is-active {
  background: var(--accent);
  color: #f5f5f2;
  text-decoration: none;
}

.team-roster {
  padding: 1.5rem;
}

.team-roster .player-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.player-card {
  display: grid;
  gap: 0.5rem;
}

.detailed-player-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.45);
}

.player-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1rem;
  background: var(--accent-soft);
}

.player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.leaderboard-showcase {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.leaderboard-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1rem;
  background: var(--accent-soft);
}

.player-detail-top {
  align-items: stretch;
}

.player-photo-card {
  padding: 0;
  overflow: hidden;
}

.player-detail-photo {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

.player-stats-card {
  display: flex;
}

.player-detail-stats-grid {
  grid-template-columns: 1fr;
  width: 100%;
  margin: 0;
  align-content: stretch;
}

.player-detail-stats-grid .stat-card {
  height: 100%;
}

.player-detail-stats-grid .stat-card strong {
  display: block;
  font-size: 6rem;
  line-height: 1;
  text-align: right;
}

.player-detail-bottom {
  margin-top: 1.5rem;
}

.leaderboard-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: #2f2f2f;
}

.leaderboard-list li + li {
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.leader-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0.95rem;
  background: #2f2f2f;
  color: #f5f5f2;
  border: 0;
  border-radius: 0;
}

.leader-button:hover,
.leader-button:focus-visible,
.leader-button.is-active {
  background: #000000;
  color: #f5f5f2;
}

.leader-button strong {
  flex: none;
}

.leader-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
}

.flash.success {
  background: #edf4ee;
}

.flash.error,
.flash.warning {
  background: #f8e9ea;
}

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    justify-self: start;
    width: min(100%, 320px);
  }

  .team-hero {
    grid-template-columns: 1fr;
  }

  .team-hero-image {
    min-height: 240px;
  }

  .team-roster .player-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-showcase {
    grid-template-columns: 1fr;
  }

  .admin-stat-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .goals-filters,
  .goals-layout {
    grid-template-columns: 1fr;
  }

  .goals-filter-actions-right {
    justify-self: stretch;
  }

  .goals-sidebar {
    position: static;
  }

  .goals-table-card {
    overflow-x: visible;
  }

  .goals-table thead {
    display: none;
  }

  .goals-table,
  .goals-table tbody,
  .goals-table tr,
  .goals-table td {
    display: block;
  }

  .goals-table tbody {
    display: grid;
    gap: 0.9rem;
  }

  .goals-table tr {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.72);
  }

  .goals-table td {
    display: grid;
    grid-template-columns: minmax(5.5rem, 6.5rem) minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
  }

  .goals-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .goals-table td:first-child {
    padding-top: 0;
  }

  .goals-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .goals-table .goal-entry {
    gap: 0.75rem;
  }

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

  .actions {
    justify-content: flex-start;
  }
}
