/* ─── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg: #f4f6fc;
  --bg2: #eaecf8;
  --card: #ffffff;
  --border: #cdd0e5;
  --gold: #d49a00;
  --gold2: #b88600;
  --goldbg: rgba(212,154,0,0.12);
  --green: #006847;
  --red: #ce1126;
  --blue: #003087;
  --blue2: #0a2566;
  --text: #1a1c2e;
  --gray: #63659a;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,80,0.08);
}

/* ─── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); text-decoration: underline; }

img { max-width: 100%; }

input, select, button {
  font-family: inherit;
  font-size: 1rem;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue2) 100%);
  border-bottom: 3px solid var(--gold);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,80,0.2);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
}

.navbar-brand .trophy { font-size: 1.5rem; }

.nav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.nav-links a, .nav-links button {
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.nav-links a:hover, .nav-links button:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

.nav-links .btn-primary-sm {
  background: var(--gold);
  color: #000;
  font-weight: 600;
  border-radius: 8px;
}

.nav-links .btn-primary-sm:hover { background: var(--gold2); color: #000; }

/* ─── Hero / Landing ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #001040, #003087 50%, #004a1a);
  padding: 80px 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '⚽';
  position: absolute;
  font-size: 300px;
  opacity: 0.04;
  top: -50px;
  right: -50px;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, #f5c518, #ff6b35, #f5c518);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat-item {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 120px;
}

.stat-item .num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
}

.stat-item .label { font-size: 0.8rem; color: var(--gray); }

/* ─── Container ──────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 2rem 1.5rem; max-width: 1100px; margin: 0 auto; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 { font-size: 1.2rem; color: var(--gold); }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold2); color: #000; }

.btn-success { background: #1a7a4a; color: #fff; }
.btn-success:hover { background: #1e8f56; }

.btn-danger { background: #8b1a1a; color: #fff; }
.btn-danger:hover { background: #a51f1f; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); }

.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}

.form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,197,24,0.15); }
.form-control::placeholder { color: #555; }

select.form-control { cursor: pointer; }

/* ─── Score Input ────────────────────────────────────────────────────────────── */
.score-input {
  width: 52px;
  padding: 8px 4px;
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
}

.score-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,197,24,0.15); }

/* ─── Auth pages ─────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo h1 { font-size: 1.8rem; color: var(--gold); }
.auth-logo p { color: var(--gray); font-size: 0.9rem; }

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  min-width: 60px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.tab-btn.active { background: var(--gold); color: #000; }

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

/* ─── Match table ────────────────────────────────────────────────────────────── */
.group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.group-badge {
  background: var(--gold);
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 6px;
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.match-row:hover { border-color: rgba(245,197,24,0.3); }

.match-row.finished { border-color: rgba(26,122,74,0.4); background: rgba(26,122,74,0.05); }
.match-row.correct-score { border-color: var(--gold); }
.match-row.correct-result { border-color: #1a7a4a; }
.match-row.wrong { border-color: rgba(206,17,38,0.3); }

.team-name { font-size: 0.9rem; font-weight: 600; }
.home-team { text-align: right; }
.away-team { text-align: left; }

.vs-sep {
  color: var(--gray);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 4px;
}

.match-meta {
  font-size: 0.75rem;
  color: var(--gray);
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  display: flex;
  gap: 12px;
}

.pts-badge {
  background: var(--gold);
  color: #000;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-block;
}

.pts-badge.pts-3 { background: var(--gold); }
.pts-badge.pts-1 { background: #2a7a4a; color: #fff; }
.pts-badge.pts-0 { background: #5a1a1a; color: #fff; }

/* ─── Rankings table ─────────────────────────────────────────────────────────── */
.rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rankings-table th {
  padding: 10px 14px;
  text-align: left;
  color: var(--gray);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.rankings-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(42,45,80,0.5);
}

.rankings-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}

.rank-1 { background: var(--gold); color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: var(--bg2); color: var(--gray); border: 1px solid var(--border); }

/* ─── Dashboard ──────────────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-card .value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* ─── Payment section ────────────────────────────────────────────────────────── */
.payment-section {
  background: linear-gradient(135deg, #1a0a2a, #0a1a2a);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
}

.payment-section h2 { font-size: 1.8rem; color: var(--gold); margin-bottom: 1rem; }
.payment-section p { color: var(--gray); margin-bottom: 1.5rem; }

.price-tag {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.price-currency { font-size: 1.2rem; vertical-align: top; margin-top: 8px; display: inline-block; }

/* ─── Alert / messages ───────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert-success { background: rgba(26,122,74,0.15); border-color: rgba(26,122,74,0.4); color: #4ade80; }
.alert-error { background: rgba(206,17,38,0.15); border-color: rgba(206,17,38,0.4); color: #ff6b6b; }
.alert-info { background: rgba(245,197,24,0.1); border-color: rgba(245,197,24,0.3); color: var(--gold); }
.alert-warning { background: rgba(255,100,0,0.15); border-color: rgba(255,100,0,0.3); color: #ff8c42; }

/* ─── Admin ──────────────────────────────────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .admin-grid { grid-template-columns: 1fr; } }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-paid { background: rgba(26,122,74,0.25); color: #4ade80; border: 1px solid rgba(26,122,74,0.4); }
.badge-unpaid { background: rgba(206,17,38,0.2); color: #ff6b6b; border: 1px solid rgba(206,17,38,0.3); }
.badge-admin { background: rgba(245,197,24,0.2); color: var(--gold); border: 1px solid rgba(245,197,24,0.3); }

/* ─── Bonus section ──────────────────────────────────────────────────────────── */
.bonus-section {
  background: linear-gradient(135deg, #1a1000, #1a0a00);
  border: 2px solid rgba(245,197,24,0.4);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.bonus-section h3 { color: var(--gold); margin-bottom: 1rem; font-size: 1.2rem; }

.bonus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .bonus-grid { grid-template-columns: 1fr; } }

/* ─── Progress bar ───────────────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--bg2); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold), #ff6b35); border-radius: 999px; transition: width 0.5s; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 4rem;
}

/* ─── Loader ─────────────────────────────────────────────────────────────────── */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(245,197,24,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .navbar-brand span { display: none; }
  .match-row { grid-template-columns: 1fr auto auto auto 1fr; gap: 4px; padding: 8px; }
  .team-name { font-size: 0.78rem; }
  .score-input { width: 44px; font-size: 1rem; }
  .auth-card { padding: 1.5rem; }
}

/* ─── Scroll to top button ───────────────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 99;
}

.scroll-top.visible { display: flex; }

/* ─── Save bar ───────────────────────────────────────────────────────────────── */
.save-bar {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: linear-gradient(90deg, #1a1000, #1a0a00);
  border-bottom: 1px solid rgba(245,197,24,0.3);
  padding: 10px 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.save-bar p { font-size: 0.85rem; color: var(--gray); }
