/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --accent: #ff6f00;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #e3e3e8;
  --win: #1b5e20;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0d47a1 50%, #1a237e 100%);
  color: white;
  padding: 48px 20px 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 10px;
}
.hero-sub {
  font-size: 16px;
  opacity: 0.85;
  letter-spacing: 3px;
  margin-bottom: 10px;
}
.hero-meta {
  font-size: 13px;
  opacity: 0.7;
}

/* === Stage Nav === */
.stage-nav {
  display: flex;
  gap: 6px;
  padding: 14px 20px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.stage-nav::-webkit-scrollbar { display: none; }
.stage-btn {
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.stage-btn:hover { background: #e8e8f0; color: var(--text); }
.stage-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* === Container === */
.container { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }

/* === Toolbar === */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar input, .toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
}
.toolbar input { flex: 1; }

/* === Stats === */
.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.stat-num {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* === Match list === */
.match-list { display: flex; flex-direction: column; gap: 10px; }

/* === Date group === */
.date-group { margin-bottom: 20px; }
.date-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.date-header h2 {
  font-size: 15px;
  font-weight: 700;
}
.date-count {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 50px;
}

/* === Match card === */
.match-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.match-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.11); }
.match-card.status-completed { border-left: 4px solid #4caf50; }
.match-card.status-upcoming { border-left: 4px solid var(--accent); }
.match-card.status-live { border-left: 4px solid #d50000; }

/* Card header */
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.card-id { font-weight: 600; color: var(--muted); font-size: 11px; }
.card-time { font-weight: 600; color: var(--primary); font-size: 13px; }
.card-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
}
.status-completed .card-status { background: #e8f5e9; color: var(--win); }
.status-upcoming .card-status { background: #fff8e1; color: #e65100; }
.status-live .card-status { background: #ffebee; color: #d50000; }

/* Card body */
.card-body {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
}
.team {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.team.away { flex-direction: row-reverse; text-align: right; }
.team-flag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.team-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-group {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.vs-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}
.score-display {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
}
.score-pending {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}
.score-stage {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Card footer */
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #fafafa;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.group-badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* === Responsive === */
@media (max-width: 600px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar input { min-width: 100%; }
  .card-body { padding: 10px 12px; gap: 8px; }
  .team-name { font-size: 12px; }
  .score-display { font-size: 18px; }
}
