/* ===== FutCat Design System ===== */
:root {
  --bg-primary: #0e0e0e;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-input: #2a2a2a;
  --border: #2a2a2a;
  --border-light: #333333;

  --text-primary: #ffffff;
  --text-secondary: #9f9f9f;
  --text-tertiary: #666666;

  --accent: #61df6e;
  --catalan-gold: #fccd2a;
  --catalan-red: #da121a;

  --win: #61df6e;
  --draw: #9f9f9f;
  --loss: #ff4444;
  --live: #ff4444;

  --radius: 12px;
  --radius-sm: 8px;
  --spacing: 16px;
  --header-h: 56px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --logo-filter: none;
}


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

html {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  padding-top: var(--header-h);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(14, 14, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--spacing);
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-emoji { font-size: 28px; line-height: 1; }
.logo-accent { color: var(--catalan-gold); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  justify-content: center;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-tab.active { color: var(--text-primary); background: var(--bg-card); }

.header-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}
.header-btn:hover { background: var(--bg-card); color: var(--text-primary); }

/* ===== Main Content ===== */
#app {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--spacing);
  min-height: calc(100dvh - var(--header-h));
}

/* ===== Loading ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-secondary);
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--catalan-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Skeleton Loading ===== */
.skeleton-container { padding: 16px 0; }
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-light) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w100 { width: 100%; }
.skeleton-line.h8 { height: 8px; }
.skeleton-line.h20 { height: 20px; }
.skeleton-line + .skeleton-line { margin-top: 10px; }
.skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.skeleton-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-light) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
}
@keyframes shimmer { to { background-position: -200% 0; } }


/* ===== Load More Button ===== */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover {
  border-color: var(--catalan-gold);
  color: var(--catalan-gold);
  background: rgba(252, 205, 42, 0.05);
}

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.section-link {
  font-size: 13px;
  color: var(--catalan-gold);
  font-weight: 600;
}

/* ===== League Selector (Pill Tabs) ===== */
.league-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 16px;
  margin-bottom: 8px;
}
.league-tabs::-webkit-scrollbar { display: none; }

.league-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.league-tab:hover { border-color: var(--border-light); color: var(--text-primary); }
.league-tab.active {
  background: var(--catalan-gold);
  color: #000;
  border-color: var(--catalan-gold);
}
.league-tabs-divider {
  width: 1px;
  background: var(--border-light);
  margin: 4px 4px;
  flex-shrink: 0;
  align-self: stretch;
}
.league-tab.cup-tab {
  font-size: 11px;
  padding: 8px 12px;
}
.league-tab.cup-tab.active {
  background: linear-gradient(135deg, #d4a017, #f5d04e);
  border-color: #d4a017;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-light); }

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.cup-badge {
  background: linear-gradient(135deg, rgba(252, 205, 42, 0.15), rgba(252, 205, 42, 0.05));
  color: var(--catalan-gold);
  border: 1px solid rgba(252, 205, 42, 0.2);
}

/* ===== Match Cards ===== */
.matches-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  cursor: pointer;
}
.match-card:hover { border-color: var(--border-light); background: var(--bg-card-hover); }

.match-team {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
}
.match-team.away { justify-content: flex-end; text-align: right; }

.team-crest {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}
.team-crest img {
  width: 100%; height: 100%;
  object-fit: contain;
  /* Remove dark circular backgrounds from API images */
  mix-blend-mode: lighten;
}
.team-crest.catalan {
  color: var(--catalan-gold);
}
/* Fallback initials circle (no logo) */
.team-crest.no-logo {
  border-radius: 50%;
  background: var(--bg-input);
}
.team-crest.no-logo.catalan {
  background: rgba(252, 205, 42, 0.15);
}

.match-score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 800;
  min-width: 60px;
  justify-content: center;
}
.match-score .separator { color: var(--text-tertiary); font-weight: 400; }

.match-status {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.match-status.live { color: var(--live); }
.match-status.ft { color: var(--text-tertiary); }

.match-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.match-info {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

.match-date {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.match-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== Standings Table ===== */
.standings-table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table th {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
.standings-table th:nth-child(2) { text-align: left; }

.standings-table td {
  padding: 10px 10px;
  font-size: 13px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.standings-table td:nth-child(2) { text-align: left; font-weight: 600; }

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

.standings-table tbody tr {
  transition: background 0.15s;
}
.standings-table tbody tr:hover { background: var(--bg-card-hover); }

.standings-row.catalan {
  background: rgba(252, 205, 42, 0.06);
}
.standings-row.catalan:hover {
  background: rgba(252, 205, 42, 0.1);
}
.standings-row.catalan td:first-child {
  box-shadow: inset 3px 0 0 var(--catalan-gold);
}

.pos-cell { font-weight: 700; color: var(--text-secondary); width: 36px; }

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.team-name-short { display: none; }

.form-dots {
  display: flex;
  gap: 3px;
}
.form-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.form-dot.w { background: var(--win); }
.form-dot.d { background: var(--draw); }
.form-dot.l { background: var(--loss); }

.standings-row.zone-promotion { box-shadow: inset 3px 0 0 #4285f4; }
.standings-row.zone-europa { box-shadow: inset 3px 0 0 #f4a742; }
.standings-row.zone-conference { box-shadow: inset 3px 0 0 #42f49b; }
.standings-row.zone-playoff { box-shadow: inset 3px 0 0 #a78bfa; }
.standings-row.zone-relegation { box-shadow: inset 3px 0 0 var(--loss); }

/* Zone Legend */
.zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-secondary);
}
.zone-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.zone-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.zone-legend-dot.zone-promotion { background: #4285f4; }
.zone-legend-dot.zone-europa { background: #f4a742; }
.zone-legend-dot.zone-conference { background: #42f49b; }
.zone-legend-dot.zone-playoff { background: #a78bfa; }
.zone-legend-dot.zone-relegation { background: var(--loss); }

/* ===== Scorers Table ===== */
.player-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card-bg);
  flex-shrink: 0;
}
.player-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-name {
  font-size: 13px;
  font-weight: 500;
}
.player-team-mobile {
  display: none;
  font-size: 11px;
  color: var(--text-tertiary);
}
@media (max-width: 768px) {
  .player-team-mobile { display: block; }
}

/* ===== Squad Grid ===== */
.squad-pos-header {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.squad-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.squad-player-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.squad-player-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.squad-player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.squad-player-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.squad-player-num {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ===== Stat Card Zone Coloring ===== */
.stat-card.zone-promotion { border-bottom: 2px solid #4285f4; }
.stat-card.zone-europa { border-bottom: 2px solid #f4a742; }
.stat-card.zone-conference { border-bottom: 2px solid #42f49b; }
.stat-card.zone-playoff { border-bottom: 2px solid #a78bfa; }
.stat-card.zone-relegation { border-bottom: 2px solid var(--loss); }

/* ===== Team Profile ===== */
.team-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.team-hero-crest {
  width: 72px; height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--catalan-gold);
  flex-shrink: 0;
  overflow: hidden;
}
.team-hero-crest img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.team-hero-info h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.team-hero-meta {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.team-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--catalan-gold);
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Teams Grid ===== */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.team-card:hover {
  border-color: var(--catalan-gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.team-card .team-crest {
  width: 48px; height: 48px;
  font-size: 16px;
}

.team-card-name {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.team-card-league {
  font-size: 11px;
  color: var(--text-tertiary);
}

.team-card-pos {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none !important;
}
.team-card-pos.zone-promotion { color: #4285f4; background: rgba(66, 133, 244, 0.1); box-shadow: none; }
.team-card-pos.zone-europa { color: #f4a742; background: rgba(244, 167, 66, 0.1); box-shadow: none; }
.team-card-pos.zone-conference { color: #42f49b; background: rgba(66, 244, 155, 0.1); box-shadow: none; }
.team-card-pos.zone-playoff { color: #a78bfa; background: rgba(167, 139, 250, 0.1); box-shadow: none; }
.team-card-pos.zone-relegation { color: #ff4444; background: rgba(255, 68, 68, 0.1); box-shadow: none; }

/* ===== Empty / Error States ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
  gap: 12px;
}
.empty-state .icon { font-size: 40px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; }
.empty-state p { font-size: 13px; color: var(--text-tertiary); max-width: 300px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { font-size: 24px; color: var(--text-tertiary); line-height: 1; }

.modal-body { padding: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.form-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.form-input:focus { border-color: var(--catalan-gold); }

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.form-hint a { color: var(--catalan-gold); text-decoration: underline; }

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}
.btn-primary {
  background: var(--catalan-gold);
  color: #000;
}
.btn-primary:hover { opacity: 0.9; }

/* ===== Matchday Header ===== */
.matchday-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 8px;
}

.matchday-nav {
  display: flex;
  gap: 8px;
}

.matchday-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
}
.matchday-btn:hover { border-color: var(--border-light); color: var(--text-primary); }

.matchday-label {
  font-size: 14px;
  font-weight: 700;
}

/* ===== Player Stats (Team Page) ===== */
.player-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .player-stats-grid { grid-template-columns: 1fr; }
}
.player-stats-list {
  padding: 8px 12px;
}
.player-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.player-stat-row:last-child { border-bottom: none; }
.player-stat-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  min-width: 16px;
  text-align: center;
}
.player-stat-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-input);
  flex-shrink: 0;
}
.player-stat-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-stat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.player-stat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-stat-meta {
  font-size: 10px;
  color: var(--text-tertiary);
}
.player-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--catalan-gold);
  min-width: 28px;
  text-align: center;
}

/* ===== Live Match Pulse ===== */
.match-live {
  border-color: rgba(255, 68, 68, 0.3);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%, 100% { border-color: rgba(255, 68, 68, 0.3); }
  50% { border-color: rgba(255, 68, 68, 0.6); }
}

/* ===== Match Detail ===== */
.match-events {
  padding: 12px 16px;
}
.event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.event-row:last-child { border-bottom: none; }
.event-home { flex-direction: row; }
.event-away { flex-direction: row-reverse; text-align: right; }
.event-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  min-width: 32px;
  text-align: center;
}
.event-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.event-detail strong { color: var(--text-primary); }
.event-detail small { color: var(--text-tertiary); font-size: 11px; }
.event-assist { font-style: italic; }
.card-icon {
  display: inline-block;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.card-icon.yellow { background: #ffd700; }
.card-icon.red { background: #ff4444; }

/* Stat Bars */
.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-bar-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 36px;
  text-align: center;
}
.stat-bar-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-bar-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
  font-weight: 600;
}
.stat-bar-track {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-input);
}
.stat-bar-fill.home {
  background: var(--catalan-gold);
  border-radius: 3px 0 0 3px;
}
.stat-bar-fill.away {
  background: var(--text-tertiary);
  border-radius: 0 3px 3px 0;
}

/* Lineups */
.lineups-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 12px 16px;
}
.lineup-team { font-size: 12px; }
.lineup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
}
.lineup-formation {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
}
.lineup-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: var(--text-secondary);
  font-size: 12px;
}
.lineup-num {
  color: var(--text-tertiary);
  font-weight: 700;
  font-size: 11px;
  min-width: 20px;
}
.lineup-subs-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-bottom: 4px;
}
.lineup-player.sub { color: var(--text-tertiary); }

@media (max-width: 480px) {
  .lineups-container { grid-template-columns: 1fr; }
}

/* ===== Senyera Stripe Decoration ===== */
/* ===== Partits Section Nav ===== */
.partits-nav {
  display: flex;
  gap: 6px;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--bg-primary);
  padding: 10px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.partits-nav-btn {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.partits-nav-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}
.partits-nav-btn.active {
  background: var(--catalan-gold);
  color: #000;
  border-color: var(--catalan-gold);
}

.senyera-bar {
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--catalan-red) 0px,
    var(--catalan-red) 20px,
    var(--catalan-gold) 20px,
    var(--catalan-gold) 40px
  );
}

/* ===== Highlights Dashboard ===== */
.highlights-dashboard {
  margin: 16px 0 8px;
}
.highlights-scroll {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 0 12px;
}

.highlight-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-light);
  transition: border-color 0.2s;
}
.highlight-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}
.highlight-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}
.highlight-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.highlight-text small {
  display: block;
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 10px;
  margin-top: 2px;
}

/* Accent variants */
.highlight--gold {
  border-left-color: var(--catalan-gold);
  background: rgba(252, 205, 42, 0.05);
}
.highlight--green {
  border-left-color: var(--win);
  background: rgba(97, 223, 110, 0.05);
}
.highlight--red {
  border-left-color: var(--loss);
  background: rgba(255, 68, 68, 0.05);
}
.highlight--blue {
  border-left-color: #4285f4;
  background: rgba(66, 133, 244, 0.05);
}

@media (max-width: 768px) {
  .highlights-scroll {
    grid-template-columns: repeat(2, 1fr);
  }
  .highlight-card {
    padding: 10px 12px;
  }
  .highlight-text { font-size: 11px; }
}
@media (max-width: 480px) {
  .highlights-scroll {
    grid-template-columns: 1fr;
  }
}

/* ===== View Transitions ===== */
.view-enter {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root { --spacing: 12px; }

  .header-inner { gap: 8px; }
  .logo-text { display: none; }

  .nav-tab {
    padding: 6px 12px;
    font-size: 12px;
  }

  .match-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .match-team { font-size: 12px; gap: 6px; }
  .team-crest { width: 24px; height: 24px; font-size: 9px; }
  .match-score { font-size: 16px; min-width: 50px; }

  .team-name-full { display: none; }
  .team-name-short { display: inline; }

  .standings-table .hide-mobile { display: none; }

  .team-hero { padding: 16px; gap: 14px; }
  .team-hero-crest { width: 56px; height: 56px; }
  .team-hero-info h1 { font-size: 18px; }

  .teams-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 480px) {
  .team-hero-meta { flex-direction: column; gap: 4px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-value { font-size: 20px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 40%; }
.skeleton-row { height: 44px; margin-bottom: 4px; }

/* ===== Gender Toggle ===== */
.gender-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gender-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.gender-toggle.active {
  border-color: #e879a8;
  background: rgba(232, 121, 168, 0.1);
  color: #e879a8;
}

.gender-toggle .gender-icon {
  font-size: 15px;
  line-height: 1;
}

.gender-toggle.active .gender-icon::after {
  content: '♀';
}
.gender-toggle.active .gender-icon {
  font-size: 0;
}
.gender-toggle.active .gender-icon::after {
  font-size: 15px;
}

@media (max-width: 600px) {
  .gender-toggle .gender-label {
    display: none;
  }
  .gender-toggle {
    padding: 6px 10px;
  }
}

/* ===== Auth Button ===== */
.auth-signin-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.auth-signin-btn:hover { border-color: var(--catalan-gold); color: var(--catalan-gold); }

.user-avatar-btn { display: flex; align-items: center; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: border-color 0.2s;
}
.user-avatar:hover { border-color: var(--catalan-gold); }

/* ===== Profile Page ===== */
.perfil-page { max-width: 700px; margin: 0 auto; }
.perfil-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.perfil-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--catalan-gold);
}
.perfil-name { font-size: 20px; font-weight: 700; }
.perfil-email { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

.perfil-section {
  margin-bottom: 28px;
}
.perfil-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

/* Newsletter toggle */
.newsletter-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.newsletter-toggle input { display: none; }
.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: all 0.2s;
}
.newsletter-toggle input:checked + .toggle-slider {
  background: var(--catalan-gold);
}
.newsletter-toggle input:checked + .toggle-slider::after {
  left: 23px;
  background: #000;
}
.toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Team selector */
.team-select-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.team-select-action-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.team-select-action-btn:hover { border-color: var(--catalan-gold); color: var(--text-primary); }
.team-count { font-size: 12px; color: var(--text-tertiary); margin-left: auto; }

.team-league-group { margin-bottom: 20px; }
.team-league-title {
  font-size: 13px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.team-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.team-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.team-toggle:hover { border-color: var(--catalan-gold); color: var(--text-primary); }
.team-toggle.selected {
  border-color: var(--catalan-gold);
  background: rgba(252, 205, 42, 0.1);
  color: var(--catalan-gold);
  font-weight: 600;
}
.team-toggle-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.team-toggle-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.signout-btn {
  padding: 8px 24px;
  border-radius: 8px;
  border: 1px solid var(--catalan-red);
  background: transparent;
  color: var(--catalan-red);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.signout-btn:hover { background: var(--catalan-red); color: #fff; }
