/* ============================================================
   BOLÃO COPA DO MUNDO 2026 — Estilos Globais
   Fonte: Barlow Condensed (títulos) + Nunito (corpo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Nunito:wght@400;500;600;700&display=swap');

/* ── VARIÁVEIS ──────────────────────────────────────────────── */
:root {
  --bg:         #07091A;
  --bg-card:    #0D1225;
  --bg-hover:   #141C38;
  --bg-input:   #101629;
  --border:     #1E2D52;
  --primary:    #00C46A;
  --primary-dk: #009E54;
  --gold:       #F5A623;
  --silver:     #C0C8DC;
  --bronze:     #CD7F32;
  --danger:     #EF4444;
  --warn:       #F59E0B;
  --info:       #3B82F6;
  --text:       #E8EEFF;
  --text-muted: #6B7A99;
  --text-dim:   #3D4E72;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
  --glow:       0 0 20px rgba(0,196,106,.15);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-family: 'Barlow Condensed', sans-serif; letter-spacing: .03em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,9,26,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  height: 60px;
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  color: var(--primary); text-decoration: none;
}
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-muted);
  font-weight: 600; font-size: .9rem;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: var(--bg-hover);
  text-decoration: none;
}
.nav-links a.active { color: var(--primary); }
.nav-user { font-size: .85rem; color: var(--text-muted); margin-left: .5rem; }
.nav-user strong { color: var(--primary); }

/* ── PAGE WRAPPER ───────────────────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.page-sm { max-width: 480px; margin: 0 auto; padding: 2rem 1rem; }

/* ── CARD ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 1rem;
}

/* ── SECTION HEADER ─────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem;
}
.section-label {
  background: var(--primary);
  color: #000; font-weight: 800; font-size: .75rem;
  padding: .2rem .6rem; border-radius: 4px;
  letter-spacing: .06em; text-transform: uppercase;
}
.section-label.gold { background: var(--gold); }

/* ── BADGE ──────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .15rem .5rem;
  border-radius: 4px; font-size: .75rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.badge-live     { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
.badge-finished { background: var(--bg-hover); color: var(--text-muted); }
.badge-soon     { background: rgba(245,166,35,.15); color: var(--gold); }
.badge-open     { background: rgba(0,196,106,.15);  color: var(--primary); }
.badge-locked   { background: rgba(239,68,68,.12);  color: var(--danger); }

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

/* ── RANKING TABLE ──────────────────────────────────────────── */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: .6rem .75rem; border-bottom: 1px solid var(--border);
  text-align: left;
}
.ranking-table th:last-child { text-align: right; }
.ranking-table td {
  padding: .75rem; font-size: .95rem;
  border-bottom: 1px solid rgba(30,45,82,.5);
  vertical-align: middle;
}
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table tr:hover td { background: var(--bg-hover); }
.rank-pos {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-muted); width: 2.5rem;
}
.rank-pos.p1 { color: var(--gold); }
.rank-pos.p2 { color: var(--silver); }
.rank-pos.p3 { color: var(--bronze); }
.rank-name { font-weight: 700; }
.rank-pts {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.2rem; font-weight: 800;
  color: var(--primary); text-align: right;
}

/* ── MATCH CARD ─────────────────────────────────────────────── */
.match-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(30,45,82,.5);
}
.match-card:last-child { border-bottom: none; }
.match-card:hover { background: var(--bg-hover); border-radius: var(--radius-sm); }

.match-team {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .95rem;
}
.match-team.away { flex-direction: row-reverse; text-align: right; }
.match-team-flag { font-size: 1.3rem; line-height: 1; }

.match-score {
  display: flex; align-items: center; gap: .35rem;
  min-width: 80px; justify-content: center;
}
.score-box {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 6px; padding: .2rem .6rem;
  min-width: 2.2rem; text-align: center;
}
.score-sep { color: var(--text-muted); font-weight: 700; }
.match-time {
  font-size: .8rem; color: var(--text-muted);
  text-align: center; font-weight: 600;
}

/* ── PREDICTION INPUT ───────────────────────────────────────── */
.pred-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: .5rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid rgba(30,45,82,.4);
}
.pred-row:last-child { border-bottom: none; }
.pred-row.locked { opacity: .55; }

.pred-team {
  display: flex; align-items: center; gap: .4rem;
  font-size: .9rem; font-weight: 600;
}
.pred-team.away { flex-direction: row-reverse; text-align: right; }

.pred-inputs {
  display: flex; align-items: center; gap: .3rem;
}
.score-input {
  width: 2.4rem; height: 2.4rem;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  background: var(--bg-input); border: 1.5px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  -moz-appearance: textfield; transition: border-color .2s;
}
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.score-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,196,106,.2); }
.score-input:disabled { background: var(--bg-hover); cursor: not-allowed; }

.pred-pts {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 800;
  color: var(--primary); min-width: 2.5rem; text-align: center;
}
.pred-pts.zero { color: var(--text-dim); }
.pred-lock { font-size: .8rem; color: var(--danger); }
.pred-timer { font-size: .75rem; color: var(--gold); }

/* ── TABS ───────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: .25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .6rem 1.1rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-bottom: 3px solid transparent;
  margin-bottom: -2px; white-space: nowrap; transition: all .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

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

/* ── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-weight: 700; font-size: .85rem;
  color: var(--text-muted); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.form-input, .form-select {
  width: 100%; padding: .7rem 1rem;
  background: var(--bg-input); border: 1.5px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif; font-size: .95rem;
  transition: border-color .2s;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,196,106,.15);
}
.form-input::placeholder { color: var(--text-dim); }
.form-select option { background: var(--bg-card); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .7rem 1.4rem; border-radius: var(--radius-sm);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700; letter-spacing: .04em;
  border: none; cursor: pointer; transition: all .2s;
  text-transform: uppercase; text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: #000;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dk); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-gold   { background: var(--gold); color: #000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  padding: .8rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .9rem;
  transform: translateY(2rem); opacity: 0;
  transition: all .3s; pointer-events: none;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--primary); color: #000; }
.toast-error   { background: var(--danger); color: #fff; }
.toast-info    { background: var(--info); color: #fff; }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
  margin-top: .5rem;
}
.progress-fill {
  height: 100%; background: var(--primary);
  border-radius: 2px; transition: width .5s;
}

/* ── GROUP GRID ─────────────────────────────────────────────── */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── LOGIN CARD ─────────────────────────────────────────────── */
.login-card {
  margin: 4rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.login-logo {
  text-align: center; margin-bottom: 1.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem; font-weight: 800;
}
.login-logo span { color: var(--primary); }

/* ── DIVIDER ────────────────────────────────────────────────── */
.divider {
  border: none; border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── HERO STRIP ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0D1225 0%, #0A1F0E 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '⚽';
  position: absolute; right: -20px; top: -20px;
  font-size: 8rem; opacity: .05;
}
.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
}
.hero-title em { color: var(--primary); font-style: normal; }
.hero-sub { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }
.hero-stats {
  display: flex; gap: 1.5rem; margin-top: 1rem; flex-wrap: wrap;
}
.hero-stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem; font-weight: 800; color: var(--primary);
  line-height: 1;
}
.hero-stat-lbl { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }

/* ── ADMIN SPECIFIC ─────────────────────────────────────────── */
.admin-grid { display: grid; gap: 1.5rem; }

.score-editor {
  display: flex; align-items: center; gap: .5rem;
}
.score-editor .score-input { width: 3rem; height: 2.2rem; font-size: 1.1rem; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }

/* ── SPINNER ────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SELECT GRID (palpites finais) ──────────────────────────── */
.final-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .match-team-name { display: none; }
  .ranking-table th:nth-child(3),
  .ranking-table td:nth-child(3) { display: none; }
  .nav-links a { padding: .35rem .5rem; font-size: .8rem; }
}
