:root {
  --bg: #0A0E14;
  --bg-elevated: #141A24;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #E8E6E1;
  --text-bright: #F5F3EE;
  --text-muted: #8B8F99;
  --azzurro: #3DA5FF;
  --azzurro-dim: rgba(61, 165, 255, 0.10);
  --gold: #C9A24B;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  text-decoration: none;
}

.italic {
  font-style: italic;
  color: var(--azzurro);
}

.links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.nav-link:hover { color: var(--text-bright); }
.nav-link.active { color: var(--azzurro); }

/* Home */
.home { flex: 1; width: 100%; display: flex; flex-direction: column; }

.hero {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 2.5rem;
  text-align: left;
}

.hero h1 {
  font-family: 'Inter Tight', sans-serif;
  color: var(--text-bright);
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 1.5rem;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 540px;
}

.manifesto {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 540px;
  margin: 0;
}

/* Team stats strip */
.stats-strip {
  max-width: 760px;
  width: calc(100% - 3rem);
  margin: 2.5rem auto 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.stat-value {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.form-row {
  display: flex;
  gap: 0.25rem;
}

.form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  color: white;
  background: var(--text-muted);
}

.form-pill.form-w { background: #2DA86A; }
.form-pill.form-d { background: #8B8F99; }
.form-pill.form-l { background: #D6543A; }

/* Match cards */
.match-cards {
  max-width: 760px;
  width: calc(100% - 3rem);
  margin: 2.5rem auto 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.match-card {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.match-card:hover {
  border-color: var(--azzurro);
  transform: translateY(-2px);
}

.match-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--azzurro);
  margin-bottom: 0.6rem;
}

.match-card-body {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.match-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.match-card-cta {
  font-size: 0.8rem;
  color: var(--azzurro);
}

/* Calendario / page */
.page {
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.page h1 {
  font-family: 'Inter Tight', sans-serif;
  color: var(--text-bright);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 3rem;
}

.section { margin-bottom: 3.5rem; }

.section h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--azzurro);
  margin: 0 0 1.25rem;
  font-weight: 600;
}

.empty-note {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Match list */
.match-list { list-style: none; padding: 0; margin: 0; }

.match-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.match-row:last-child { border-bottom: none; }

.match-date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.match-teams { color: var(--text); }
.match-comp {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Standings table — transfermarkt-tight */
.standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.standings th {
  text-align: right;
  padding: 0.6rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
}

.standings th.col-team { text-align: left; }

.standings td {
  text-align: right;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.standings td.col-team {
  text-align: left;
  font-weight: 500;
}

.standings .col-pts {
  font-weight: 700;
  color: var(--text-bright);
}

.standings .row-napoli { background: var(--azzurro-dim); }
.standings .row-napoli .col-team { color: var(--azzurro); font-weight: 700; }
.standings .row-napoli .col-pts { color: var(--azzurro); }

/* Zone stripes on position column */
.standings .col-pos {
  text-align: right;
  position: relative;
  padding-left: 0.85rem;
  color: var(--text-muted);
}

.standings tbody .col-pos::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
}

.standings .zone-ucl .col-pos::before { background: #2DA86A; }
.standings .zone-uel .col-pos::before { background: #FF7A00; }
.standings .zone-uecl .col-pos::before { background: #C9A24B; }
.standings .zone-rel .col-pos::before { background: #D6543A; }

/* Form column inside standings */
.standings .col-form {
  text-align: right;
  white-space: nowrap;
  padding-left: 1rem;
}

.standings .col-form .form-row {
  justify-content: flex-end;
}

.standings .form-empty {
  color: rgba(255, 255, 255, 0.2);
}

/* Standings legend */
.standings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.legend-swatch.zone-ucl-bg { background: #2DA86A; }
.legend-swatch.zone-uel-bg { background: #FF7A00; }
.legend-swatch.zone-uecl-bg { background: #C9A24B; }
.legend-swatch.zone-rel-bg { background: #D6543A; }

/* Plantilla — grouped tables by position */
.squad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.squad-table th {
  text-align: left;
  padding: 0.55rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
}

.squad-table th.col-num,
.squad-table th.col-age {
  text-align: right;
  width: 56px;
}

.squad-table th.col-country {
  text-align: right;
}

.squad-table td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.squad-table tr:last-child td { border-bottom: none; }

.squad-table .col-num {
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.squad-table .col-name a {
  color: var(--text-bright);
  text-decoration: none;
  font-weight: 500;
}

.squad-table .col-name a:hover { color: var(--azzurro); }

.squad-table .col-age {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.squad-table .col-country {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.section-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}

/* Player detail page */
.player-page { max-width: 640px; }

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.15s ease;
}

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

.player-detail-meta {
  font-size: 0.9rem;
  color: var(--azzurro);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin: -1.5rem 0 2.5rem;
}

.player-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 2rem;
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.player-facts dt {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  align-self: center;
}

.player-facts dd {
  margin: 0;
  color: var(--text);
}

.player-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* Footer */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Scudetti banners — tricolore patches with year, on home */
.scudetti-strip {
  max-width: 760px;
  width: calc(100% - 3rem);
  margin: 2.5rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.scudetti-row {
  display: flex;
  gap: 0.5rem;
}

.scudetto {
  position: relative;
  width: 42px;
  height: 54px;
  border-radius: 4px 4px 18px 18px;
  overflow: hidden;
  background:
    linear-gradient(to right,
      #009246 0%, #009246 33.33%,
      #F5F5F0 33.33%, #F5F5F0 66.66%,
      #CE2B37 66.66%, #CE2B37 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.4);
  cursor: help;
  transition: transform 0.15s ease;
}

.scudetto:hover {
  transform: translateY(-2px) scale(1.05);
}

.scudetto-year {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: #1a1a1a;
  text-shadow:
    0 0 3px rgba(245, 245, 240, 0.95),
    0 0 6px rgba(245, 245, 240, 0.6);
  letter-spacing: -0.02em;
}

/* Responsive */
@media (max-width: 720px) {
  .navbar { padding: 1rem 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 2rem; }
  .hero h1 { font-size: 3rem; }
  .match-cards { grid-template-columns: 1fr; }
  .page { padding: 3rem 1.25rem; }
  .page h1 { font-size: 2.5rem; }
  .match-row { grid-template-columns: 1fr; gap: 0.25rem; padding: 0.75rem 0; }
  .standings { font-size: 0.8rem; }
  .standings th, .standings td { padding: 0.4rem 0.3rem; }
}
