/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark: #1a4a2e;
  --green-mid: #2a5a3e;
  --green-light: #3a6a4e;
  --gold: #f0b429;
  --gold-light: #f7d070;
  --white: #ffffff;
  --gray-light: #e8f0eb;
  --gray-mid: #b0c4b8;
  --text-dark: #0d2b1a;
  --card-bg: #1e5235;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --radius: 10px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif,
               'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  background: var(--green-dark);
  color: var(--white);
  min-height: 100vh;
  padding-bottom: 80px; /* space for bottom nav on mobile */
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--green-dark);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.logo { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.trophy { font-size: 1.4rem; flex-shrink: 0; }
.site-title { font-size: 1.05rem; font-weight: 700; color: var(--gold); letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lang-toggle {
  background: var(--gold);
  color: var(--text-dark);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.lang-toggle:hover { background: var(--gold-light); }

/* ===== AD BANNERS ===== */
.ad-banner {
  display: flex;
  justify-content: center;
  background: var(--green-dark);
  padding: 8px 0;
}

.ad-desktop { display: none; }
.ad-mobile { display: flex; }

/* ===== AFFILIATE BAR ===== */
.affiliate-bar {
  background: var(--green-mid);
  border-bottom: 1px solid var(--green-light);
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.affiliate-link {
  background: var(--gold);
  color: var(--text-dark);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.affiliate-link:hover { background: var(--gold-light); transform: translateY(-1px); }

/* ===== DESKTOP TAB NAV ===== */
.tab-nav {
  display: none; /* hidden on mobile — bottom nav is used instead */
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  gap: 4px;
  padding: 12px 16px 0;
  box-sizing: border-box;
}

.tab-btn {
  background: var(--green-mid);
  color: var(--gray-mid);
  border: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover { background: var(--green-light); color: var(--white); }
.tab-btn.active { background: var(--green-light); color: var(--gold); border-bottom-color: var(--gold); }

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== FILTER BAR ===== */
.filter-bar {
  margin-bottom: 12px;
}

.filter-bar select {
  background: var(--green-mid);
  color: var(--white);
  border: 1px solid var(--green-light);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ===== MATCH CARDS ===== */
.day-group { margin-bottom: 20px; }

.day-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--green-light);
  margin-bottom: 8px;
}

.match-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  position: relative;
  border-left: 4px solid transparent;
  transition: border-color 0.2s, transform 0.1s;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.match-card:hover { border-left-color: var(--gold); transform: translateX(2px); }
.match-card.live { border-left-color: #ff4444; }
.match-card.finished { border-left-color: var(--green-light); opacity: 0.9; }

.match-meta {
  font-size: 0.75rem;
  color: var(--gray-mid);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.match-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.match-status.live { background: #ff4444; color: white; animation: pulse 1.5s infinite; }
.match-status.finished { background: var(--green-light); color: var(--gray-mid); }
.match-status.upcoming { background: var(--gold); color: var(--text-dark); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.team {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0; /* allow flex children to shrink below content size */
}

.team.away { flex-direction: row-reverse; text-align: right; }

.team-flag {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.team-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.score {
  background: var(--green-dark);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
}

.score-sep { color: var(--gray-mid); font-size: 1rem; font-weight: 300; }

.match-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.match-venue {
  font-size: 0.72rem;
  color: var(--gray-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.whatsapp-btn {
  background: #25D366;
  color: white;
  border: none;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}
.whatsapp-btn:hover { background: #1da851; }

/* ===== GROUP LABEL ===== */
.group-header {
  background: var(--gold);
  color: var(--text-dark);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== STANDINGS TABLE ===== */
.standings-group { margin-bottom: 24px; }

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.standings-table th {
  background: var(--green-mid);
  color: var(--gold);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.standings-table th.num { text-align: center; }

.standings-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--green-mid);
  vertical-align: middle;
}

.standings-table td.num { text-align: center; }

.standings-table tr:nth-child(even) { background: rgba(255,255,255,0.03); }
.standings-table tr:hover { background: rgba(240,180,41,0.08); }

.standings-table .qualify { border-left: 3px solid var(--gold); }
.standings-table .playoff { border-left: 3px solid #888; }

.team-cell { display: flex; align-items: center; gap: 8px; }
.pos-num { font-weight: 700; width: 20px; text-align: center; color: var(--gray-mid); }

/* ===== BRACKET ===== */
.bracket-wrapper {
  overflow-x: auto;
  padding-bottom: 12px;
}

.bracket-rounds {
  display: flex;
  gap: 20px;
  min-width: 900px;
  padding: 8px;
}

.bracket-round { flex: 1; }

.round-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.bracket-matches { display: flex; flex-direction: column; gap: 12px; }

.bracket-match {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--green-light);
}

.bracket-team {
  padding: 8px 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--green-mid);
}

.bracket-team:last-child { border-bottom: none; }
.bracket-team.winner { background: rgba(240,180,41,0.12); font-weight: 700; color: var(--gold); }

.bracket-score {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
  min-width: 18px;
  text-align: right;
}

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--green-dark);
  border-top: 2px solid var(--gold);
  z-index: 200;
  height: 64px;
}

.bottom-nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 6px 4px;
  transition: color 0.2s;
}

.bottom-nav-btn.active { color: var(--gold); }
.bottom-nav-btn:active { transform: scale(0.95); }

.bottom-icon {
  font-size: 1.3rem;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-style: normal;
  color: inherit; /* prevent color: from suppressing color emoji on some Android builds */
}
.bottom-label { font-size: 0.65rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--gray-mid);
  font-size: 0.9rem;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .ad-desktop { display: flex; }
  .ad-mobile { display: none; }
  .ad-bottom { display: none; }

  .tab-nav { display: flex; }

  .site-title { font-size: 1.2rem; }
  .trophy { font-size: 1.6rem; }

  .main-content { padding: 20px; }

  .match-card { padding: 14px 18px; }
  .team-flag { font-size: 1.6rem; }
  .team-name { font-size: 1rem; }
  .score { font-size: 1.6rem; padding: 8px 14px; min-width: 40px; }

  .standings-table { font-size: 0.9rem; }
}

@media (min-width: 1024px) {
  .tab-nav { padding: 16px 20px 0; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--green-dark); }
::-webkit-scrollbar-thumb { background: var(--green-light); border-radius: 3px; }
