/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --green: #1a6b3c;
  --green-light: #25904f;
  --green-dark: #0e3d22;
  --gold: #f0c040;
  --gold-dark: #c9950a;
  --white: #f8f6f0;
  --gray: #8a8578;
  --gray-light: #e8e4dc;
  --dark: #111410;
  --surface: #1c1f1a;
  --surface2: #252820;
  --red: #c0392b;
  --radius: 12px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--white);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── LAYOUT ── */
.container { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.page { padding: 24px 0 80px; }

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid rgba(240,192,64,.15);
  position: sticky; top: 0; z-index: 100;
  padding: 0 16px;
}
.nav-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center;
  height: 56px; gap: 8px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 1px;
  color: var(--gold);
  flex: 1;
  text-decoration: none;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: var(--gray);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all .2s;
}
.nav-link:hover, .nav-link.active { color: var(--white); background: rgba(255,255,255,.07); }
.nav-link.active { color: var(--gold); }

/* ── HEADINGS ── */
h1 { font-family: var(--font-display); font-size: 40px; letter-spacing: 2px; color: var(--white); line-height: 1; }
h2 { font-family: var(--font-display); font-size: 26px; letter-spacing: 1px; color: var(--white); }
h3 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 10px 20px; border-radius: 8px;
  border: none; cursor: pointer;
  transition: all .2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--dark); }
.btn-primary:hover { background: #e0b030; transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-secondary { background: rgba(255,255,255,.08); color: var(--white); }
.btn-secondary:hover { background: rgba(255,255,255,.13); }
.btn-danger { background: rgba(192,57,43,.2); color: #e74c3c; border: 1px solid rgba(192,57,43,.3); }
.btn-danger:hover { background: rgba(192,57,43,.35); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--gray); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  width: 100%; background: var(--surface2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: var(--white);
  font-family: var(--font-body); font-size: 15px;
  padding: 10px 14px;
  transition: border-color .2s;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus, select:focus { outline: none; border-color: var(--gold); }
select option { background: var(--surface2); }

/* ── SCORE INPUT PAIR ── */
.score-input-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 8px;
}
.score-input-row .team-label {
  font-weight: 500; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.score-input-row .team-label.home { text-align: right; }
.score-input-row .vs { color: var(--gray); font-size: 13px; text-align: center; }
.score-input-row input[type="number"] {
  width: 56px; text-align: center; font-size: 20px; font-weight: 600;
  padding: 8px 4px; border-radius: 8px;
}

/* ── MATCH CARD ── */
.match-card {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.match-card.locked { opacity: .6; }
.match-card .match-meta {
  font-size: 11px; color: var(--gray);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px;
}
.match-card .points-badge {
  display: inline-block;
  background: rgba(240,192,64,.15);
  color: var(--gold);
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  margin-left: 8px;
}
.match-card .points-badge.correct { background: rgba(37,144,79,.2); color: #4ade80; }

/* ── LEADERBOARD ── */
.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,.05);
  transition: background .2s;
}
.lb-row.me { border-color: rgba(240,192,64,.3); background: rgba(240,192,64,.06); }
.lb-rank {
  font-family: var(--font-display); font-size: 22px; color: var(--gray);
  text-align: center;
}
.lb-row:nth-child(1) .lb-rank { color: var(--gold); }
.lb-row:nth-child(2) .lb-rank { color: #b0b8c1; }
.lb-row:nth-child(3) .lb-rank { color: #cd7f32; }
.lb-name { font-weight: 500; }
.lb-pts { font-family: var(--font-display); font-size: 26px; color: var(--gold); }
.lb-breakdown { font-size: 11px; color: var(--gray); margin-top: 1px; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; }
.tab {
  padding: 8px 18px; border-radius: 8px;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--gray); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all .2s;
}
.tab.active { background: var(--gold); color: var(--dark); border-color: transparent; }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--green-light);
  margin: 24px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,.07);
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface2); border: 1px solid rgba(255,255,255,.1);
  color: var(--white); padding: 10px 20px; border-radius: 24px;
  font-size: 14px; font-weight: 500;
  opacity: 0; transition: all .3s; z-index: 9999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-success { border-color: rgba(74,222,128,.3); color: #4ade80; }
.toast.toast-error { border-color: rgba(248,113,113,.3); color: #f87171; }

/* ── BOTTOM NAV (mobile) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; z-index: 100;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 10px 4px;
  color: var(--gray); text-decoration: none;
  font-size: 10px; font-weight: 500;
  transition: color .2s;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--gold); }
.bottom-nav svg { width: 22px; height: 22px; }

/* ── AUTH PAGE ── */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(26,107,60,.35) 0%, transparent 60%), var(--dark);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; padding: 36px 32px;
}
.auth-logo { font-family: var(--font-display); font-size: 36px; color: var(--gold); letter-spacing: 2px; text-align: center; margin-bottom: 8px; }
.auth-sub { color: var(--gray); text-align: center; font-size: 14px; margin-bottom: 28px; }

/* ── BADGE / CHIP ── */
.chip {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .4px;
}
.chip-green { background: rgba(37,144,79,.2); color: #4ade80; }
.chip-gold { background: rgba(240,192,64,.15); color: var(--gold); }
.chip-gray { background: rgba(255,255,255,.07); color: var(--gray); }
.chip-red { background: rgba(248,113,113,.15); color: #f87171; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 48px 24px; color: var(--gray); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* ── SPINNER ── */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--gold);
  animation: spin .7s linear infinite;
  margin: 48px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PROGRESS BAR ── */
.progress-bar { height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width .3s; }

/* ── ADMIN TABLE ── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; padding: 8px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--gray); border-bottom: 1px solid rgba(255,255,255,.07);
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.admin-table tr:last-child td { border-bottom: none; }

/* ── RESPONSIVE ── */
@media (min-width: 640px) {
  .bottom-nav { display: none; }
  nav .nav-links { display: flex; }
  body { font-size: 16px; }
}
@media (max-width: 639px) {
  nav .nav-links { display: none; }
}

/* ── PITCH PATTERN (decorative bg) ── */
.pitch-bg {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 48px,
      rgba(255,255,255,.018) 48px,
      rgba(255,255,255,.018) 96px
    );
}
