/* ============================================================
   FIFA World Cup 2026 — France Pronostics App
   ============================================================ */

:root {
  --bg:          #080c1a;
  --bg-card:     #111827;
  --bg-card2:    #1c2537;
  --border:      rgba(255,255,255,0.07);
  --border-glow: rgba(245,170,35,0.35);

  --gold:        #f5a823;
  --gold-light:  #ffd700;
  --blue:        #1a56db;
  --blue-light:  #4b8af5;
  --purple:      #7c3aed;
  --red:         #e02424;
  --green:       #0e9f6e;
  --green-lt:    #34d399;

  --fr-blue:     #002395;
  --fr-red:      #ed2939;

  --text:        #f9fafb;
  --text-muted:  #9ca3af;
  --text-dim:    #6b7280;

  --radius:      14px;
  --radius-sm:   8px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background decoration ── */
.bg-decor {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.ball, .star {
  position: absolute;
  user-select: none;
  opacity: 0.04;
  animation: drift linear infinite;
}
.ball { font-size: 80px; }
.star { font-size: 60px; color: var(--gold); }

.b1 { left: 5%;  top: 20%; animation-duration: 28s; animation-delay: 0s;  }
.b2 { left: 70%; top: 60%; animation-duration: 36s; animation-delay: -12s; }
.b3 { left: 40%; top: 85%; animation-duration: 32s; animation-delay: -6s;  }
.s1 { left: 15%; top: 70%; animation-duration: 40s; animation-delay: -4s;  }
.s2 { left: 85%; top: 15%; animation-duration: 34s; animation-delay: -8s;  }
.s3 { left: 55%; top: 40%; animation-duration: 44s; animation-delay: -16s; }
.s4 { left: 28%; top: 5%;  animation-duration: 38s; animation-delay: -2s;  }

@keyframes drift {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(30px,-20px) rotate(90deg); }
  50%  { transform: translate(60px,10px) rotate(180deg); }
  75%  { transform: translate(20px,40px) rotate(270deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,12,26,0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 960px; margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo  { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }
.header-titles { display: flex; flex-direction: column; line-height: 1.1; }
.header-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; letter-spacing: 2px; color: var(--gold);
}
.header-sub { font-size: 11px; color: var(--text-muted); }
.header-user { display: flex; align-items: center; gap: 10px; }
.user-chip {
  font-size: 13px; color: var(--text-muted);
  padding: 4px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.btn-logout {
  font-size: 12px; padding: 5px 13px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-muted);
  text-decoration: none; transition: all .2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Tab navigation ── */
.tab-nav { border-top: 1px solid var(--border); }
.tab-nav-inner {
  max-width: 960px; margin: 0 auto;
  padding: 0 24px; display: flex; gap: 4px;
}
.tab-link {
  padding: 11px 18px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-admin { margin-left: auto; }
.tab-admin.active { color: #ff7b4a; border-bottom-color: #ff7b4a; }

/* ── Flash messages ── */
.flash-wrap {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column;
  gap: 8px; width: 380px; max-width: calc(100vw - 40px);
}
.flash {
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-align: center;
}
.flash-success {
  background: rgba(14,159,110,.13); border: 1px solid rgba(14,159,110,.4);
  color: var(--green-lt);
}
.flash-error {
  background: rgba(224,36,36,.13); border: 1px solid rgba(224,36,36,.4);
  color: #f87171;
}

/* ── Main layout ── */
.main {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  padding: 36px 24px 100px;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; gap: 36px;
}
.auth-hero { text-align: center; }
.trophy-float {
  font-size: 72px; display: block;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 24px rgba(245,170,35,.55));
  animation: float 3.2s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.wc-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px; letter-spacing: 5px;
  background: linear-gradient(130deg, var(--gold) 0%, #fff 50%, var(--gold-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wc-subtitle {
  font-size: 13px; letter-spacing: 3.5px; color: var(--text-muted);
  margin-top: 6px; text-transform: uppercase;
}
.host-flags { margin-top: 14px; font-size: 28px; letter-spacing: 6px; }
.host-label {
  margin-top: 6px; font-size: 12px; color: var(--text-dim);
  letter-spacing: 1px;
}

.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 38px 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03);
}
.auth-logo-wrap { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 14px; }
.auth-heading {
  font-size: 22px; font-weight: 700; text-align: center;
  margin-bottom: 26px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field input {
  padding: 10px 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(75,138,245,.12);
}
.auth-switch {
  margin-top: 20px; text-align: center;
  font-size: 13px; color: var(--text-muted);
}
.auth-switch a { color: var(--blue-light); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; width: 100%;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: .3px; transition: all .2s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,86,219,.4);
}
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-purple {
  background: linear-gradient(135deg, var(--purple), #6d28d9);
}
.btn-purple:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  box-shadow: 0 6px 20px rgba(124,58,237,.4);
}

/* ── Section headers ── */
.section-head { margin-bottom: 28px; }
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px; letter-spacing: 2px; color: var(--gold);
}
.admin-title { color: #ff7b4a; }
.section-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ── Game cards ── */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
/* France tricolour top stripe */
.game-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--fr-blue) 33%, #fff 33% 67%, var(--fr-red) 67%);
}
.game-card:hover { border-color: var(--border-glow); }
.game-card.settled { border-color: rgba(14,159,110,.25); }
.game-card.settled::before { background: linear-gradient(90deg, var(--green), var(--green-lt), var(--green)); }
.admin-card::before { background: linear-gradient(90deg, var(--purple), #a855f7, var(--purple)); }

.game-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.game-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim);
  padding: 3px 8px; background: rgba(255,255,255,.04);
  border-radius: 4px; border: 1px solid var(--border);
}
.admin-badge { color: #c084fc; border-color: rgba(192,132,252,.2); }
.official-badge {
  font-size: 13px; padding: 4px 10px;
  background: rgba(14,159,110,.1); border: 1px solid rgba(14,159,110,.3);
  border-radius: 20px; color: var(--green-lt);
}
.pending-badge {
  font-size: 12px; padding: 4px 10px;
  background: rgba(245,170,35,.08); border: 1px solid rgba(245,170,35,.2);
  border-radius: 20px; color: var(--gold);
}
.stat-badge {
  font-size: 12px; padding: 4px 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-dim);
}

/* Points badges */
.pts-badge {
  font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
}
.pts-perfect { background: rgba(255,215,0,.15); border: 1px solid rgba(255,215,0,.4);  color: var(--gold-light); }
.pts-good    { background: rgba(14,159,110,.12); border: 1px solid rgba(14,159,110,.35); color: var(--green-lt); }
.pts-partial { background: rgba(75,138,245,.12); border: 1px solid rgba(75,138,245,.3); color: var(--blue-light); }
.pts-zero    { background: rgba(224,36,36,.1);   border: 1px solid rgba(224,36,36,.3);  color: #f87171; }

/* ── Score row ── */
.score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 20px;
}
.team { display: flex; align-items: center; gap: 10px; }
.team-home { justify-content: flex-end; flex-direction: row-reverse; text-align: right; }
.team-away { justify-content: flex-start; }

.flag { font-size: 36px; line-height: 1; }
.tname { font-size: 16px; font-weight: 700; color: var(--text); }

.score-inputs { display: flex; align-items: center; gap: 8px; }

.score-box {
  width: 68px; height: 68px;
  text-align: center;
  font-size: 30px; font-weight: 700;
  font-family: 'Bebas Neue', monospace;
  background: var(--bg-card2);
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 12px; color: var(--text);
  outline: none; transition: all .2s;
  -moz-appearance: textfield;
}
.score-box::-webkit-inner-spin-button,
.score-box::-webkit-outer-spin-button { -webkit-appearance: none; }
.score-box:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,170,35,.15);
  background: rgba(245,170,35,.04);
}
.score-box.locked {
  opacity: .6; cursor: not-allowed;
  border-color: rgba(14,159,110,.3);
}
.score-box.admin-box:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168,85,247,.15);
  background: rgba(168,85,247,.04);
}
.score-sep {
  font-size: 28px; font-weight: 700;
  font-family: 'Bebas Neue', sans-serif;
  color: var(--text-muted);
}

/* ── Form action ── */
.form-action {
  display: flex; justify-content: center; margin-top: 28px;
}
.form-action .btn-primary { width: auto; min-width: 280px; }

/* ── Points legend ── */
.legend-box {
  margin-top: 44px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 28px;
}
.legend-title {
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px;
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.legend-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  background: var(--bg-card2); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.legend-max {
  border-color: rgba(245,170,35,.3);
  background: rgba(245,170,35,.04);
}
.lpts {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px; color: var(--gold); letter-spacing: 1px;
}
.legend-max .lpts { color: var(--gold-light); }
.ldesc { font-size: 12px; color: var(--text-muted); }

/* ── Leaderboard ── */
.results-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.results-bar-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.result-chip {
  padding: 5px 12px; font-size: 13px; font-weight: 600;
  background: rgba(14,159,110,.1); border: 1px solid rgba(14,159,110,.3);
  border-radius: 20px; color: var(--green-lt);
}

.leaderboard { display: flex; flex-direction: column; gap: 10px; }

.lb-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: all .2s;
}
.lb-row:hover { border-color: var(--border-glow); transform: translateX(3px); }
.lb-row.rank-1 {
  border-color: rgba(255,215,0,.4);
  background: linear-gradient(135deg, rgba(255,215,0,.04), var(--bg-card));
}
.lb-row.rank-2 { border-color: rgba(192,192,192,.25); }
.lb-row.rank-3 { border-color: rgba(205,127,50,.3); }

.lb-rank { font-size: 26px; min-width: 40px; text-align: center; }
.rank-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; color: var(--text-dim);
}
.lb-player { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.lb-name { font-size: 16px; font-weight: 600; }
.lb-meta { font-size: 11px; color: var(--text-dim); }

.lb-games { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.lb-game-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 10px; background: var(--bg-card2);
  border-radius: var(--radius-sm); min-width: 68px;
}
.lb-game-cell.absent { opacity: .35; }
.gc-flags { font-size: 14px; }
.gc-score { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.gc-pts {
  font-size: 12px; font-weight: 700; padding: 1px 6px;
  border-radius: 10px;
}
.gc-pts.perfect { background: rgba(255,215,0,.15); color: var(--gold-light); }
.gc-pts.good    { background: rgba(14,159,110,.15); color: var(--green-lt); }
.gc-pts.partial { background: rgba(75,138,245,.15); color: var(--blue-light); }
.gc-pts.zero    { background: rgba(255,255,255,.05); color: var(--text-dim); }

.lb-total { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.lb-pts-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px; color: var(--gold); line-height: 1;
}
.lb-pts-lbl { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }

/* ── Empty states ── */
.empty-state {
  text-align: center; padding: 70px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 52px; margin-bottom: 18px; }
.empty-hint { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

/* ── Admin extras ── */
.distrib {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px; font-size: 13px; color: var(--text-muted);
}
.distrib-sep { color: var(--border); }
.result-ts { margin-top: 10px; font-size: 12px; color: var(--green-lt); }

.admin-review { margin-top: 44px; }
.review-title {
  font-size: 14px; font-weight: 600; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 14px;
}
.review-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.review-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.review-table th {
  background: var(--bg-card2);
  padding: 10px 16px; text-align: left;
  color: var(--text-dim); font-weight: 600; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.review-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.review-table tr:last-child td { border-bottom: none; }
.review-table tr:hover td { background: rgba(255,255,255,.02); }
.player-cell { font-weight: 600; color: var(--text); }
.pred-cell { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.pred-cell.missing { color: var(--text-dim); font-style: italic; }

/* ── Footer ── */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 1;
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(to top, rgba(8,12,26,.9), transparent);
  pointer-events: none;
}
.footer-flags { font-size: 18px; opacity: .3; }
.footer-copy { font-size: 11px; color: var(--text-dim); opacity: .4; letter-spacing: 1px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .main { padding: 24px 16px 80px; }
  .game-card { padding: 18px 16px; }

  .score-row { gap: 10px; }
  .flag  { font-size: 28px; }
  .tname { font-size: 13px; }
  .score-box { width: 56px; height: 56px; font-size: 24px; }
  .score-sep { font-size: 22px; }

  .auth-card { padding: 28px 20px; }
  .wc-title  { font-size: 30px; }
  .trophy-float { font-size: 56px; }

  .lb-row { flex-wrap: wrap; }
  .lb-pts-num { font-size: 26px; }
  .header-inner { padding: 10px 16px; }
  .tab-nav-inner { padding: 0 8px; }
  .tab-link { padding: 10px 12px; font-size: 13px; }
}
