/* ==========================================================
   PRONO 2026 — refonte complète
   Police propre, cards claires, drapeaux visibles, zéro code 2 lettres
========================================================== */

:root {
  --page: #f3f6fb;
  --page-2: #eaf0f8;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #101827;
  --muted: #667085;
  --dim: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;

  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --red: #e11d48;
  --red-soft: #fff1f2;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --gold: #d97706;
  --gold-soft: #fffbeb;
  --danger: #dc2626;

  --nav-h: 52px;
  --footer-h: 64px;
  --radius: 22px;
  --max-w: 1180px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  padding-top: var(--nav-h);
  padding-bottom: var(--footer-h);
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .13), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(225, 29, 72, .10), transparent 30%),
    linear-gradient(180deg, var(--page) 0%, var(--page-2) 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
}

button, input { font: inherit; }
button { border: 0; background: transparent; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ==========================================================
   NAV — minimaliste, juste logo + admin
========================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 clamp(14px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .02em;
}

.nav-admin {
  font-size: .78rem;
}

/* ==========================================================
   FOOTER
========================================================== */

.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}

.footer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s;
  text-decoration: none;
  padding: 8px 4px;
}

.footer-btn:hover,
.footer-btn--active { color: var(--blue); }

.footer-icon { font-size: 1.3rem; line-height: 1; }
.footer-label { font-size: .68rem; font-weight: 700; letter-spacing: .03em; }

/* Profil modal */
.profil-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
}
.profil-avatar { font-size: 3rem; }
.profil-pseudo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.2rem; }
.profil-pts { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.profil-pts span { color: var(--blue); font-weight: 800; }

/* ==========================================================
   BUTTONS
========================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; font-size: .85rem; font-weight: 700; line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px) scale(.985); }

.btn-primary {
  background: #101827; color: #fff;
  box-shadow: 0 8px 18px rgba(16,24,40,.15);
}
.btn-primary:hover { background: #1d2939; }

.btn-ghost {
  background: #fff; color: #344054;
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--card-soft); }

.btn-sm { min-height: 28px; padding: 0 10px; font-size: .78rem; }
.btn-full { width: 100%; }

/* ==========================================================
   PAGE + DATES
========================================================== */

.page-main {
  width: min(var(--max-w), 100%);
  margin: 0 auto;
  padding: 28px clamp(14px, 4vw, 32px) 80px;
  touch-action: pan-y;
}

.dates-bar {
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  max-width: 100%;
  margin-bottom: 26px;
  padding: 4px 0 12px;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  cursor: grab;
  scrollbar-width: none;
}
.dates-bar::-webkit-scrollbar { height: 8px; }
.dates-bar::-webkit-scrollbar-track { background: transparent; }
.dates-bar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.dates-bar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dates-bar.is-dragging { cursor: grabbing; user-select: none; }

@media (max-width: 760px) {
  .dates-bar { scrollbar-width: none; }
  .dates-bar::-webkit-scrollbar { display: none; }
}

.date-btn {
  flex: 0 0 auto;
  min-width: 76px; padding: 10px 13px;
  border-radius: 18px; border: 1px solid var(--line);
  background: rgba(255,255,255,.78); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 8px 20px rgba(16,24,40,.045);
  transition: .15s ease;
}
.date-btn:hover { transform: translateY(-1px); border-color: var(--line-strong); background: #fff; }
.date-btn.active { background: #101827; color: #fff; border-color: #101827; box-shadow: 0 14px 28px rgba(16,24,40,.18); }
.date-btn--empty { opacity: .4; }
.date-btn--empty:hover { opacity: .6; }

.date-btn-day { font-family: 'Barlow Condensed', 'Inter', sans-serif; font-size: 1.35rem; font-weight: 800; line-height: .95; }
.date-btn-mois { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .72; }

/* ==========================================================
   MATCH GRID
========================================================== */

.matchs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px; width: 100%;
}
.match-card { width: 100%; min-width: 0; }

@media (max-width: 1000px) { .matchs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .matchs-grid { grid-template-columns: 1fr; } }

.grid-empty {
  grid-column: 1 / -1;
  min-height: 180px; display: grid; place-items: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: rgba(255,255,255,.62); color: var(--muted); font-weight: 700;
}

/* ==========================================================
   MATCH CARD
========================================================== */

.match-card {
  position: relative; overflow: hidden;
  border-radius: 26px; border: 1px solid rgba(208,213,221,.9);
  background: var(--card);
  box-shadow: 0 14px 36px rgba(16,24,40,.08);
  animation: fadeUp .28s ease both;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.match-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 6px;
  background: linear-gradient(180deg, var(--blue), var(--red));
}
.match-card:hover { transform: translateY(-4px); border-color: rgba(37,99,235,.34); box-shadow: 0 24px 60px rgba(16,24,40,.13); }
.match-card--locked::before { background: linear-gradient(180deg, var(--green), var(--blue)); }

.match-topline {
  display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 10px 16px 10px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(248,250,252,.95), rgba(255,255,255,.7));
}

.match-day, .match-time, .match-group {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; white-space: nowrap;
}
.match-day { color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: capitalize; }
.match-time { margin-left: auto; padding: 5px 9px; background: #101827; color: #fff; font-size: .78rem; font-weight: 800; }
.match-group { padding: 5px 9px; background: var(--blue-soft); color: var(--blue); font-size: .72rem; font-weight: 800; margin-left: auto; }

/* Score / prono */
.score-box, .score-box--final {
  position: relative !important; display: flex !important;
  align-items: center !important; justify-content: center !important;
  gap: 8px !important; margin: 0 !important; padding: 0 !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.score-box--disabled { opacity: .82; }

.score-input, .score-cell {
  width: 46px !important; height: 50px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  border-radius: 13px !important; border: 1px solid #d5dce8 !important;
  background: #ffffff !important; color: #111827 !important;
  font-family: inherit !important; font-size: 1.2rem !important;
  font-weight: 900 !important; text-align: center !important; box-shadow: none !important;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.13); }
.score-input:disabled { background: #f2f4f7; color: var(--dim); cursor: not-allowed; }

.score-sep {
  position: absolute !important; left: 50% !important; top: 50% !important;
  transform: translate(-50%, -25%) !important;
  width: 22px !important; height: 22px !important; min-width: 22px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  border-radius: 999px !important; color: #fff !important;
  font-size: .75rem !important; font-weight: 900 !important; line-height: 1 !important;
  z-index: 5 !important; pointer-events: none !important;
}
.score-sep--ok, .score-sep-ok   { background: #22c55e !important; color: #fff !important; }
.score-sep--missed               { background: #ef4444 !important; color: #fff !important; }
.score-sep--neutral              { background: #94a3b8 !important; color: #fff !important; }
.score-sep--saving               { background: #94a3b8 !important; color: #fff !important; }

.prono-status {
  margin-top: 8px !important; min-height: 18px !important;
  text-align: center !important; background: transparent !important;
  box-shadow: none !important; border: 0 !important;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: .74rem; font-weight: 750;
}
.prono-status--points { display: flex !important; flex-direction: column !important; gap: 1px !important; align-items: center !important; }
.status-points { color: #16a34a !important; font-weight: 900 !important; font-size: .82rem !important; background: transparent !important; padding: 0 !important; }
.status-prono-detail { color: #64748b !important; font-size: .72rem !important; background: transparent !important; }
.status-login, .status-locked { background: transparent !important; color: var(--muted); padding: 0 !important; }

/* Prono card body */
.prono-card-body { padding: 26px 22px 28px !important; overflow: hidden; }
.prono-flags-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important; gap: 10px !important;
}
.prono-flag { width: 82px !important; height: 58px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
.prono-flag--home { justify-self: start !important; }
.prono-flag--away { justify-self: end !important; }
.prono-flag img { width: 82px !important; height: 58px !important; display: block !important; object-fit: contain !important; border-radius: 10px; }
.prono-score-zone {
  justify-self: center !important; align-self: center !important;
  display: flex !important; flex-direction: column !important;
  align-items: center !important; justify-content: center !important;
  min-width: 96px !important;
}
.prono-score-zone .score-box { position: static !important; transform: none !important; }
.prono-score-zone .score-sep { min-width: 18px !important; text-align: center !important; }
.prono-names-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 18px !important; margin-top: 16px !important; }
.prono-team-name { color: #111827 !important; font-weight: 800 !important; font-size: .92rem !important; line-height: 1.1 !important; }
.prono-team-name--home { text-align: left !important; }
.prono-team-name--away { text-align: right !important; }

.status-missed {
  width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff;
  font-size: .78rem; font-weight: 900; line-height: 1;
  box-shadow: 0 4px 10px rgba(239,68,68,.35);
}

/* ==========================================================
   MODAL AUTH
========================================================== */

.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(16,24,40,.46);
  backdrop-filter: blur(8px); animation: fadeIn .16s ease;
}
.modal {
  width: min(100%, 420px); padding: 22px;
  border-radius: 28px; border: 1px solid rgba(255,255,255,.7);
  background: #fff; box-shadow: 0 28px 80px rgba(16,24,40,.24);
  animation: slideUp .2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-family: 'Barlow Condensed', 'Inter', sans-serif; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.modal-close {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: #f2f4f7; color: var(--muted); font-weight: 800;
}
.modal-close:hover { background: #e4e7ec; color: var(--text); }

.modal-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 5px; margin-bottom: 18px; border-radius: 999px; background: #f2f4f7;
}
.modal-tab { min-height: 38px; border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 800; }
.modal-tab.active { background: #fff; color: var(--text); box-shadow: 0 8px 18px rgba(16,24,40,.08); }

.auth-form { display: flex; flex-direction: column; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { color: #344054; font-size: .82rem; font-weight: 800; }
.form-input {
  width: 100%; min-height: 48px; border: 1px solid var(--line-strong);
  border-radius: 16px; background: #fff; color: var(--text); padding: 0 14px; outline: none;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.form-input::placeholder { color: var(--dim); }
.form-error { min-height: 17px; color: var(--danger); font-size: .82rem; font-weight: 700; }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 14px; background: #f8fafc; border: 1px solid var(--line);
  font-size: 1.28rem; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.avatar-btn:hover { transform: translateY(-1px); background: #fff; }
.avatar-btn.selected { border-color: var(--blue); background: var(--blue-soft); }

/* ==========================================================
   CLASSEMENT
========================================================== */

.page-classement {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.classement-header {
  display: flex; align-items: baseline;
  justify-content: space-between; margin-bottom: 28px;
}
.classement-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.6rem; }
.classement-updated { font-size: .75rem; color: var(--muted); }

.podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 12px; margin-bottom: 36px; padding: 0 16px;
}
.podium-place {
  flex: 1; max-width: 180px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border-radius: 16px 16px 0 0; text-align: center;
}
.podium-place--1 { background: linear-gradient(180deg,#fef9c3,#fef08a); border: 1px solid #fde047; min-height: 160px; order: 2; }
.podium-place--2 { background: linear-gradient(180deg,#f1f5f9,#e2e8f0); border: 1px solid #cbd5e1; min-height: 130px; order: 1; }
.podium-place--3 { background: linear-gradient(180deg,#fff7ed,#fed7aa); border: 1px solid #fdba74; min-height: 110px; order: 3; }

.podium-rank { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.4rem; }
.podium-place--1 .podium-rank { color: #854d0e; font-size: 1.8rem; }
.podium-place--2 .podium-rank { color: #475569; }
.podium-place--3 .podium-rank { color: #9a3412; }
.podium-avatar { font-size: 2rem; }
.podium-pseudo { font-family: 'Syne', sans-serif; font-weight: 700; font-size: .82rem; }
.podium-pts { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; }
.podium-place--1 .podium-pts { color: #854d0e; }
.podium-place--2 .podium-pts { color: #334155; }
.podium-place--3 .podium-pts { color: #9a3412; }

.classement-table { display: flex; flex-direction: column; gap: 6px; }

.classement-row {
  display: grid;
  grid-template-columns: 44px 36px 1fr 80px 80px 80px;
  align-items: center; gap: 10px;
  padding: 14px 18px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 6px rgba(16,24,40,.04);
  transition: border-color .15s, transform .15s;
  animation: fadeUp .25s ease both;
}
.classement-row:hover { border-color: var(--line-strong); transform: translateX(3px); }
.classement-row--me { border-color: var(--blue) !important; background: var(--blue-soft) !important; }
.classement-row--header {
  background: var(--page) !important; border-color: transparent !important;
  box-shadow: none !important; font-size: .72rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 6px 18px;
}
.classement-row--header:hover { transform: none; }

.cr-pos { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; color: var(--muted); text-align: center; }
.cr-pos--1 { color: #854d0e; }
.cr-pos--2 { color: #475569; }
.cr-pos--3 { color: #9a3412; }
.cr-avatar { font-size: 1.4rem; }
.cr-pseudo { font-weight: 700; font-size: .9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-pts { font-family: 'Syne', sans-serif; font-weight: 800; font-size: .95rem; color: var(--text); text-align: right; }
.cr-exact { text-align: center; font-size: .82rem; color: var(--green); font-weight: 700; }
.cr-pronos { text-align: center; font-size: .82rem; color: var(--muted); }

.admin-loading { color: var(--muted); font-size: .88rem; padding: 20px 0; }

/* ==========================================================
   ANIMATIONS + RESPONSIVE
========================================================== */

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { transform: scale(.65); opacity: .2; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 760px) {
  .matchs-grid { grid-template-columns: 1fr; }
  .page-classement { padding: 16px 16px 60px; }
  .classement-row { grid-template-columns: 36px 32px 1fr 70px; }
  .cr-exact, .cr-pronos { display: none; }
  .classement-row--header { display: none; }
  .podium { gap: 6px; }
}

/* ─── Score réel dans la card ────────────────────────────── */
.cc-score-reel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  min-height: 28px;
  margin-bottom: 4px;
  background: #eeeeee;
  border-radius: 10px;
  padding: 5px 10px;
  margin-top: -10px;
}
.cc-score-reel--hidden {
  visibility: hidden;
}
.cc-score-sep {
  color: var(--dim);
  font-size: .85rem;
  font-weight: 400;
}

/* ─── Modal règlement ────────────────────────────────────── */
.modal--reglement {
  max-height: 85dvh;
  overflow-y: auto;
  max-width: 480px;
}

.reglement-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reglement-section { display: flex; flex-direction: column; gap: 8px; }

.reglement-titre {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
}

.reglement-section p {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.6;
}

.reglement-note {
  font-size: .78rem !important;
  background: var(--gold-soft);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px !important;
  color: var(--gold) !important;
}

/* Barème */
.reglement-bareme {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bareme-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--page);
  border: 1px solid var(--line);
}

.bareme-row--gold {
  background: var(--gold-soft);
  border-color: #fde68a;
}

.bareme-pts {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: var(--blue);
  min-width: 52px;
  flex-shrink: 0;
}

.bareme-row--gold .bareme-pts { color: var(--gold); }

.bareme-desc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bareme-desc strong { font-size: .85rem; color: var(--text); }
.bareme-desc span   { font-size: .75rem; color: var(--muted); }

/* Exemple */
.reglement-exemple {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.exemple-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
}
.exemple-row:first-child {
  background: var(--blue-soft);
  font-weight: 700;
  grid-template-columns: 1fr;
  border-bottom: 1px solid #bfdbfe;
}
.exemple-row:last-child { border-bottom: none; }

.exemple-prono { color: var(--text); font-weight: 700; }
.exemple-pts   { font-family: 'Syne', sans-serif; font-weight: 800; color: var(--blue); text-align: center; }
.exemple-detail { color: var(--muted); font-size: .75rem; }
.pts-gold { color: var(--gold) !important; }
.pts-zero { color: var(--danger) !important; }