:root {
  --primary:    #1a3c5a;
  --green:      #1e8449;
  --accent:     #f39c12;
  --bg:         #f0f2f5;
  --card:       #ffffff;
  --text:       #2c3e50;
  --muted:      #7f8c8d;
  --border:     #e0e4e8;
  --tier1:      #f9e79f;
  --tier2:      #d7dbdd;
  --tier3:      #d6eaf8;
  --tier4:      #f9f9f9;
  --success:    #1e8449;
  --danger:     #c0392b;
  --warning:    #f39c12;
  --pending:    #95a5a6;
  --radius:     8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }

/* ── HEADER ── */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, #0d2137 100%);
  color: #fff;
  padding: 1.5rem 1rem 1rem;
  text-align: center;
}
.header-flag { font-size: 2rem; margin-bottom: 0.25rem; }
.header-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.3px; }
.header-sub   { font-size: 0.85rem; opacity: 0.7; margin-bottom: 1rem; }

.pot-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.pot-item { text-align: center; }
.pot-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; }
.pot-value { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.pot-value.small { font-size: 1.1rem; }

.countdown-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  display: inline-block;
}
.countdown-bar.closed { background: rgba(231,76,60,0.3); }
.countdown-bar.live   { background: rgba(30,132,73,0.4); }

/* ── NAV TABS ── */
.nav-tabs {
  background: #fff;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 100;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  display: inline-block;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.nav-tab:hover  { color: var(--primary); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.nav-tab.hidden { display: none; }

/* ── LAYOUT ── */
.container { max-width: 900px; margin: 0 auto; padding: 1rem; }

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

/* ── CARDS ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.section-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ── REGISTRATION FORM ── */
.form-grid {
  display: grid;
  gap: 1rem;
}
.name-email-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
  background: #fff;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-hint { font-size: 0.78rem; color: var(--muted); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.checkbox-label { font-size: 0.9rem; }
.checkbox-label strong { color: var(--primary); }

.radio-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-option {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.9rem;
}
.radio-option input { accent-color: var(--primary); }

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

.total-summary {
  background: var(--bg);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.total-line { display: flex; justify-content: space-between; padding: 0.2rem 0; }
.total-line.grand { font-weight: 700; font-size: 1rem; border-top: 1px solid var(--border); margin-top: 0.4rem; padding-top: 0.4rem; }

.payment-box {
  background: #eaf4fb;
  border: 1px solid #aed6f1;
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.88rem;
  margin-top: 0.5rem;
  word-break: break-word;
  overflow-wrap: break-word;
}
.payment-box strong { display: block; margin-bottom: 0.5rem; }
.payment-box a { word-break: break-all; }

.success-banner {
  background: #eafaf1;
  border: 1px solid #a9dfbf;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.success-banner .emoji { font-size: 2rem; margin-bottom: 0.5rem; }
.success-banner h3 { color: var(--success); margin-bottom: 0.5rem; }

/* ── LEADERBOARD ── */
.lb-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.lb-search input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
}
.lb-search input:focus { outline: none; border-color: var(--primary); }

.lb-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.lb-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.lb-table td { padding: 0.6rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr.highlighted td { background: #fffbea; }
.lb-table tr:hover td { background: #f8f9fa; }

.rank-badge {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  background: var(--bg);
  color: var(--muted);
}
.rank-badge.gold   { background: #f9e79f; color: #7d6608; }
.rank-badge.silver { background: #d7dbdd; color: #515a5a; }
.rank-badge.bronze { background: #f0d9c8; color: #7e5109; }

.team-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--tier4);
  border: 1px solid var(--border);
}
.team-chip.tier1 { background: var(--tier1); border-color: #d4ac0d; }
.team-chip.tier2 { background: var(--tier2); border-color: #b2babb; }
.team-chip.tier3 { background: var(--tier3); border-color: #aed6f1; }
.team-chip.active { opacity: 1; }
.team-chip.eliminated { opacity: 0.4; text-decoration: line-through; }

.stage-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
}
.stage-badge.winner   { background: #f9e79f; color: #7d6608; }
.stage-badge.runner   { background: #d7dbdd; color: #515a5a; }
.stage-badge.semi     { background: var(--tier3); color: #1a5276; }
.stage-badge.active   { background: #d5f5e3; color: #1e8449; }

/* ── GROUP TABLES ── */
.group-tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem;
}
.group-tab {
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.group-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.group-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.group-table th {
  padding: 0.45rem 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.group-table th:first-child { text-align: left; }
.group-table td { padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--border); text-align: center; }
.group-table td:first-child { text-align: left; font-weight: 600; }
.group-table tr:last-child td { border-bottom: none; }
.group-table tr.qualified td { background: #eafaf1; }
.group-table tr.eliminated td { background: #fdedec; color: var(--muted); }

.sweepstake-holder {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

/* ── FIXTURES LIST ── */
.fx-stage-block { margin-bottom: 1.75rem; }
.fx-stage-hdr {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.35rem; margin-bottom: 0.6rem;
}
.fx-matchday-hdr {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  margin: 0.7rem 0 0.2rem;
}
.fx-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.2rem; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.fx-row:last-child { border-bottom: none; }
.fx-row.upcoming { color: var(--muted); }
.fx-row.live { background: #f0fdf4; }
.fx-grp-tag {
  font-size: 0.68rem; background: var(--border); border-radius: 3px;
  padding: 0.1rem 0.3rem; color: var(--muted); white-space: nowrap;
  min-width: 3.8rem; text-align: center;
}
.fx-team {
  flex: 1; font-weight: 600;
  display: flex; flex-direction: column;
}
.fx-team.right { text-align: right; align-items: flex-end; }
.fx-team.winner { color: var(--primary); }
.fx-team em { font-style: normal; font-size: 0.7rem; color: var(--muted); font-weight: 400; }
.fx-score {
  font-weight: 700; font-size: 1rem;
  min-width: 3.2rem; text-align: center; color: var(--text);
}
.fx-row.upcoming .fx-score { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

/* ── KNOCKOUT ── */
.knockout-stage { margin-bottom: 1.5rem; }
.knockout-stage-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  background: #fff;
}
.match-team { flex: 1; font-weight: 600; }
.match-team.right { text-align: right; }
.match-team.winner { color: var(--success); }
.match-score {
  padding: 0.2rem 0.8rem;
  background: var(--bg);
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  min-width: 60px;
  text-align: center;
  color: var(--primary);
}
.match-score.tbd { color: var(--muted); font-size: 0.8rem; font-weight: 400; }

/* ── TOP SCORERS / WOODEN SPOON ── */
.scorer-row, .ws-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.scorer-row:last-child, .ws-row:last-child { border-bottom: none; }
.scorer-rank {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.scorer-rank.gold   { background: var(--tier1); color: #7d6608; }
.scorer-info { flex: 1; }
.scorer-name { font-weight: 600; }
.scorer-team { font-size: 0.78rem; color: var(--muted); }
.scorer-goals {
  font-size: 1.1rem; font-weight: 800; color: var(--primary); min-width: 28px; text-align: right;
}
.scorer-holder { font-size: 0.75rem; color: var(--muted); font-style: italic; }

/* ── STATES ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state .emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; max-width: 320px; margin: 0 auto; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.alert-info    { background: #eaf4fb; border: 1px solid #aed6f1; color: #1a5276; }
.alert-success { background: #eafaf1; border: 1px solid #a9dfbf; color: #1e8449; }
.alert-warning { background: #fef9e7; border: 1px solid #f9e79f; color: #7d6608; }
.alert-danger  { background: #fdedec; border: 1px solid #f5b7b1; color: #922b21; }

.loading { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.9rem; }

/* ── HOW IT WORKS ── */
.how-section { margin-bottom: 1.5rem; }
.how-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--primary); }
.how-section p, .how-section ul { font-size: 0.9rem; color: var(--text); line-height: 1.6; margin-bottom: 0.5rem; }
.how-section ul { padding-left: 1.2rem; }
.how-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 0.25rem; }
.how-table th, .how-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
.how-table thead th { font-weight: 700; background: var(--bg); }
.contact-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.contact-form textarea { width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.92rem; font-family: inherit; resize: vertical; box-sizing: border-box; }

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* ── ADMIN SPECIFIC ── */
.admin-header {
  background: #2c3e50;
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { font-size: 1rem; font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { text-align: left; padding: 0.5rem 0.75rem; background: #f8f9fa; font-size: 0.78rem; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--border); }
.admin-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: #f8f9fa; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-pending   { background: #f5eef8; color: #7d3c98; }
.badge-confirmed { background: #eafaf1; color: #1e8449; }
.badge-yes       { background: var(--tier1); color: #7d6608; }

/* ── WINNERS ── */
.winners-champion {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 2px solid #f0d060;
}
.champion-trophy  { font-size: 3rem; line-height: 1; margin-bottom: 0.5rem; }
.champion-team    { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.champion-holder  { font-size: 1rem; color: var(--muted); margin: 0.25rem 0; }
.champion-prize   { font-size: 1.5rem; font-weight: 700; color: var(--success); margin-top: 0.5rem; }

.winners-list     { display: flex; flex-direction: column; gap: 0; margin-bottom: 1rem; }
.winners-row      { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0;
                    border-bottom: 1px solid var(--border); }
.winners-row:last-child { border-bottom: none; }
.winners-position { font-size: 0.78rem; font-weight: 700; color: var(--muted);
                    text-transform: uppercase; min-width: 80px; }
.winners-team     { flex: 1; }
.winners-team strong { display: block; font-size: 1rem; }
.winners-team em  { font-style: normal; font-size: 0.85rem; color: var(--muted); }
.winners-team .unassigned { color: var(--warning); }
.winners-prize    { font-size: 1.1rem; font-weight: 700; color: var(--success);
                    min-width: 70px; text-align: right; }
.rolldown-arrow   { font-size: 0.72rem; color: var(--warning); }
.rolldown-notice  { background: #fff8e1; border-left: 3px solid var(--warning);
                    padding: 0.6rem 0.85rem; border-radius: 0 6px 6px 0;
                    font-size: 0.85rem; margin: 1rem 0; }

.side-pots        { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.side-pot-card    { border: 1.5px solid var(--border); border-radius: 10px; padding: 1rem; }
.side-pot-title   { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.side-pot-pot     { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.side-pot-detail  { font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.5rem; }
.side-pot-winner  { font-size: 0.9rem; color: var(--success); font-weight: 600; }
.winners-footer   { text-align: center; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; }

@media (max-width: 600px) {
  .side-pots { grid-template-columns: 1fr; }
  .champion-team { font-size: 1.4rem; }
}

/* ── WHATSAPP JOIN ── */
.whatsapp-join {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}
.whatsapp-qr {
  width: 120px;
  height: 120px;
  border-radius: 6px;
  flex-shrink: 0;
}
.whatsapp-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.btn-whatsapp {
  display: inline-block;
  background: #25d366;
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-whatsapp:hover { background: #1ebe5d; }
.whatsapp-hint { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; }
@media (max-width: 500px) {
  .whatsapp-qr { display: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .pot-value        { font-size: 1.3rem; }
  .header-title     { font-size: 1.2rem; }
  .lb-table .hide-mobile { display: none; }
  .match-card       { flex-direction: column; gap: 0.3rem; text-align: center; }
  .match-team.right { text-align: center; }
  .stat-grid        { grid-template-columns: 1fr 1fr; }

  /* Registration form */
  .name-email-grid  { grid-template-columns: 1fr; }
  .card             { padding: 1rem; }
  .btn-primary      { width: 100%; }
  .checkbox-label   { font-size: 0.85rem; }
  .success-banner   { padding: 1.25rem 1rem; }

  /* Fixtures */
  .fx-grp-tag       { min-width: 2.2rem; font-size: 0.62rem; padding: 0.1rem 0.2rem; }
  .fx-score         { min-width: 2.6rem; font-size: 0.9rem; }
}
