/*
 * World Cup 2026 — Football Pitch Design
 * Warm charcoal. Grass-green accent. No AI dashboard vibes.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Canvas — warm charcoal instead of cold near-black */
  --bg: #0d1114;
  --bg-elevated: #14181c;
  --bg-surface: #1a1f24;
  --bg-hover: #21262b;

  /* Text */
  --text: #f0f1f3;
  --text-secondary: #c8ccd1;
  --text-muted: #7c8188;
  --text-quiet: #565a5f;

  /* Accent — pitch green */
  --accent: #1e9e55;
  --accent-hover: #22b461;
  --accent-dim: rgba(30, 158, 85, 0.10);
  --accent-glow: rgba(30, 158, 85, 0.20);

  /* Gold — for top 3, highlights */
  --gold: #cba045;
  --gold-dim: rgba(203, 160, 69, 0.12);

  /* Semantic */
  --red: #e35d6a;
  --green: #1e9e55;

  /* Borders — cleaner, less transparent */
  --border: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.04);
  --border-hover: rgba(255,255,255,0.10);
  --border-active: rgba(30, 158, 85, 0.35);

  /* Geometry */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 9999px;

  /* Layout */
  --max-w: 640px;
  --tab-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Font */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px);
  line-height: 1.55;
}

/* ══════════════════════════════════════════
   Typography
   ══════════════════════════════════════════ */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 0.92rem; font-weight: 600; }
.subtitle { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.caption { font-size: 0.75rem; color: var(--text-quiet); }
.mono { font-family: var(--font-mono); font-size: 0.78rem; }

/* ══════════════════════════════════════════
   Layout
   ══════════════════════════════════════════ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 20px 20px 0; padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 20px); }
.section { margin-bottom: 24px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}

/* ══════════════════════════════════════════
   Cards
   ══════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.18s;
}
.card:hover { border-color: var(--border-hover); }
.card.pressable { cursor: pointer; }
.card.pressable:active { background: var(--bg-hover); }

/* ══════════════════════════════════════════
   Buttons
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; border: none; transition: all 0.18s;
  text-decoration: none; font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); }

.btn-sm { padding: 5px 12px; font-size: 0.75rem; border-radius: var(--radius-sm); }

/* ══════════════════════════════════════════
   Bottom Tab Bar
   ══════════════════════════════════════════ */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(13, 17, 20, 0.94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: center;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--text-quiet);
  text-decoration: none; font-size: 0.62rem; font-weight: 500;
  transition: color 0.18s; max-width: 100px;
  -webkit-tap-highlight-color: transparent;
}
.tab-item.active { color: var(--accent); }
.tab-item .tab-icon {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}
.tab-item .tab-icon svg { width: 20px; height: 20px; }
.tab-item .tab-icon svg path,
.tab-item .tab-icon svg rect,
.tab-item .tab-icon svg circle,
.tab-item .tab-icon svg line {
  stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.tab-item.active .tab-icon svg { stroke-width: 1.8; }

/* ══════════════════════════════════════════
   Filter pills
   ══════════════════════════════════════════ */
.filter-row {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.filter-pill {
  padding: 5px 14px; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-muted);
  background: transparent; transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.filter-pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ══════════════════════════════════════════
   Rankings
   ══════════════════════════════════════════ */
.rank-item {
  display: grid; grid-template-columns: 32px 44px 1fr auto auto;
  align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.rank-item:last-child { border-bottom: none; }
.rank-num { font-size: 0.82rem; font-weight: 500; color: var(--text-quiet); text-align: center; }
.rank-num.top3 { color: var(--gold); font-weight: 700; }
.rank-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--bg-elevated); border: 1.5px solid var(--border);
}
.rank-info { min-width: 0; }
.rank-name { font-size: 0.88rem; font-weight: 600; }
.rank-team { font-size: 0.72rem; color: var(--text-muted); }
.rank-position {
  font-size: 0.65rem; color: var(--text-quiet);
  background: var(--bg-elevated); padding: 2px 8px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-subtle);
}
.rank-rating {
  font-size: 0.95rem; font-weight: 700; color: var(--accent);
  text-align: center; min-width: 32px;
}
.rank-like {
  display: flex; align-items: center; gap: 3px; font-size: 0.7rem;
  color: var(--text-quiet);
}

/* ══════════════════════════════════════════
   Schedule
   ══════════════════════════════════════════ */
.match-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 8px;
}

/* ══════════════════════════════════════════
   Hero / Home
   ══════════════════════════════════════════ */
.hero {
  text-align: center; padding: 28px 0 12px;
}
.hero h1 {
  font-size: 1.55rem; font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.2; margin-bottom: 4px;
}
.hero p { font-size: 0.85rem; color: var(--text-muted); }
.hero-actions {
  display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   Back link
   ══════════════════════════════════════════ */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: 0.8rem;
  text-decoration: none; margin-bottom: 10px;
}
.back-link:hover { color: var(--text); }

/* ══════════════════════════════════════════
   Modal
   ══════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px; width: 90%; max-width: 320px;
  text-align: center;
}
.modal-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.modal-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ══════════════════════════════════════════
   Footer
   ══════════════════════════════════════════ */
.footer {
  text-align: center; font-size: 0.7rem; color: var(--text-quiet);
  padding: 24px 0;
}
::-webkit-scrollbar { display: none; }
