/* ═══════════════════════════════════════════════
   SPIDD — Thème Bleu Blanc Rouge (clair)
   Inclure via : <link rel="stylesheet" href="spidd.css">
   ═══════════════════════════════════════════════ */

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

:root {
  --bg:        #f0f4f8;
  --surface:   #ffffff;
  --surface2:  #e8eef5;
  --border:    #c8d6e5;
  --blue:      #1a3a6b;       /* bleu France foncé */
  --blue-mid:  #2563eb;       /* bleu vif */
  --blue-light:#dbeafe;       /* bleu pâle */
  --red:       #c0392b;       /* rouge France */
  --red-light: #fde8e8;
  --win:       #16a34a;
  --lose:      #dc2626;
  --forfeit:   #d97706;
  --text:      #1e2a3a;
  --text-muted:#5a6a7e;
  --radius:    12px;
  --shadow:    0 2px 12px rgba(26,58,107,0.10);
}

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

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 0 3rem;
}

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, var(--blue) 0%, #1e4d8c 60%, var(--red) 100%);
  border-bottom: 4px solid var(--red);
  padding: 1rem 1rem 0.9rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 3px 16px rgba(26,58,107,0.25);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
}
.header-logo {
  height: 44px;
  width: auto;
  border-radius: 4px;
  flex-shrink: 0;
  background: #fff;
  padding: 2px 4px;
}
.badge-sport {
  background: var(--red); color: #ffffff !important;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: 0.75rem; letter-spacing: 0.12em;
  padding: 0.25rem 0.75rem; border-radius: 4px;
  text-transform: uppercase; white-space: nowrap;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-info h1 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: clamp(1.3rem, 5vw, 2rem); line-height: 1;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.15);
  letter-spacing: 0.01em;
}
.header-info .sub  { font-size: 0.8rem; color: rgba(255,255,255,0.75); margin-top: 0.15rem; }
.header-info .pts-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.4);
  color: #fff; font-weight: 600; font-size: 0.78rem;
  padding: 0.15rem 0.55rem; border-radius: 20px; margin-top: 0.3rem;
}

/* ── STATS BAR ── */
.stats-bar {
  max-width: 1100px; margin: 0.9rem auto 0; padding: 0 1rem;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.stat-pill {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 30px; padding: 0.3rem 0.75rem; font-size: 0.78rem;
  display: flex; align-items: center; gap: 0.35rem;
  box-shadow: var(--shadow);
}
.stat-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-win   { background: var(--win); }
.dot-lose  { background: var(--lose); }
.dot-total { background: var(--blue-mid); }

/* ── SECTION DIVISION ── */
.division-group { max-width: 1100px; margin: 1.25rem auto 0; padding: 0 0.75rem; }
.division-label {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--blue); padding: 0.35rem 0;
  border-bottom: 2px solid var(--blue-light); margin-bottom: 0.65rem;
}

/* ── CARD PARTIE ── */
.partie-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 0.65rem; overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
.partie-card:active { transform: scale(0.99); }
.partie-card.win     { border-left: 4px solid var(--win); }
.partie-card.lose    { border-left: 4px solid var(--lose); }
.partie-card.forfeit { border-left: 4px solid var(--forfeit); }
.partie-card.pending { border-left: 4px solid var(--border); }

/* ── TOP BAR ── */
.card-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 0.85rem; background: var(--surface2);
  border-bottom: 1px solid var(--border); gap: 0.5rem; flex-wrap: wrap;
}
.card-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  font-size: 0.66rem; font-weight: 600; padding: 0.12rem 0.4rem;
  border-radius: 4px; background: var(--blue-light);
  border: 1px solid #bfdbfe; color: var(--blue); white-space: nowrap;
}
.tag.tableau { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.card-schedule { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.table-num {
  background: var(--blue); color: #fff; font-weight: 700;
  font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 4px;
}
.heure { font-size: 0.78rem; font-weight: 600; color: var(--text); }

/* ── CORPS CARTE : layout gauche | VS | droite ── */
.card-body {
  padding: 0.6rem 0.85rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}
/* joueur gauche */
.joueur-left {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  min-width: 0; overflow: visible;
}
/* joueur droit */
.joueur-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem;
  min-width: 0; text-align: right; overflow: visible;
}
.joueur-name {
  font-size: 0.88rem; font-weight: 600;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
  width: 100%;
}
.joueur-name.winner { font-weight: 800; color: var(--win); }
.joueur-pts { font-size: 0.68rem; color: var(--text-muted); }
.forfeit-badge {
  background: var(--forfeit); color: #fff; font-size: 0.62rem;
  font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 3px;
}
/* VS central */
.vs-center {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  flex-shrink: 0;
}
.vs-label {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.05em;
}
.score-manche-mini { font-size: 0.65rem; color: var(--blue); font-weight: 600; }

/* ── SCORES MANCHES ── */
.scores-block {
  grid-column: 1 / -1;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.scores-grid {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
}
.manche-box {
  flex: 1; min-width: 46px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.25rem 0.15rem; text-align: center;
}
.manche-box .manche-num { font-size: 0.55rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.1rem; }
.manche-box .manche-score {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 0.85rem; line-height: 1; color: var(--text);
}
.manche-box.empty { opacity: 0.3; }

/* ── BADGE DOUBLE ── */
.badge-double {
  display: inline-block;
  background: linear-gradient(90deg, #6c3fc5, #a855f7); color: #fff;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.1rem 0.4rem;
  border-radius: 3px; margin-left: 0.3rem; vertical-align: middle;
}
.double-title {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: 1rem; color: #7c3aed;
  padding: 0.65rem 0 0.2rem; border-bottom: 2px solid #c4b5fd; margin-bottom: 0.65rem;
}

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

/* ── SECTION (poule/tableau) ── */
.section { max-width: 1100px; margin: 1.5rem auto 0; padding: 0 0.75rem; }
.section-title {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: clamp(1rem, 4vw, 1.25rem); color: var(--blue);
  padding: 0.5rem 0; border-bottom: 2px solid var(--blue-light); margin-bottom: 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-title.tableau-title { color: #7c3aed; border-color: #c4b5fd; }

/* ── LISTE JOUEURS (poule) ── */
.joueurs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.45rem; margin-bottom: 1rem; }
.joueur-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.55rem 0.8rem;
  display: flex; align-items: center; gap: 0.6rem; box-shadow: var(--shadow);
}
.rang-badge {
  background: var(--blue); color: #fff;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: 0.8rem; width: 26px; height: 26px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.joueur-info { flex: 1; min-width: 0; }
.joueur-info .nom { font-size: 0.87rem; font-weight: 600; }
.joueur-info .meta { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.1rem; }
.dossard-badge {
  font-size: 0.66rem; background: var(--blue-light);
  border: 1px solid #bfdbfe; border-radius: 4px; padding: 0.1rem 0.35rem;
  color: var(--blue); white-space: nowrap;
}

/* ── CLASSEMENT ── */
.classement-grid { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.classement-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.45rem 0.8rem;
  display: flex; align-items: center; gap: 0.75rem; box-shadow: var(--shadow);
}
.classement-row:first-child { border-color: #fbbf24; }
.classement-row:first-child .rang-badge { background: #f59e0b; }
.classement-row:nth-child(2) .rang-badge { background: #94a3b8; }
.classement-row:nth-child(3) .rang-badge { background: #b45309; }
.pts-parti { font-size: 0.75rem; font-weight: 700; color: var(--blue); margin-left: auto; white-space: nowrap; }
.forfait-cl { font-size: 0.65rem; background: var(--forfeit); color: #fff; padding: 0.1rem 0.35rem; border-radius: 3px; font-weight: 700; }

/* ── JOUEUR SECTION (club) ── */
.joueur-section { max-width: 1100px; margin: 1.5rem auto 0; padding: 0 0.75rem; }
.joueur-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem; background: var(--blue);
  border-radius: var(--radius) var(--radius) 0 0;
}
.joueur-header h2 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: clamp(1rem, 4vw, 1.3rem); flex: 1; color: #fff;
}
.joueur-pts-badge {
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
  color: #fff; font-weight: 600; font-size: 0.75rem;
  padding: 0.15rem 0.55rem; border-radius: 20px; white-space: nowrap;
}
.joueur-stats {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  padding: 0.45rem 0.8rem;
  background: var(--blue-light); border: 1px solid #bfdbfe; border-top: none;
  margin-bottom: 0.25rem;
}
.empty-joueur { color: var(--text-muted); font-size: 0.82rem; padding: 0.5rem 0 1rem; }

/* ── INDEX FORMS ── */
.container { position: relative; z-index: 1; width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; padding: 2rem 1rem 4rem; }
.page-header { text-align: center; margin-bottom: 0.5rem; }
.page-title { font-family: 'Barlow Condensed', sans-serif; font-size: clamp(1.2rem, 4vw, 1.7rem); font-weight: 900; color: var(--blue); }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }
.competition-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(135deg, var(--blue) 0%, #1e4d8c 60%, var(--red) 100%);
  padding: 0.65rem 1.4rem; border-radius: 999px; color: #fff;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: clamp(1rem, 3vw, 1.2rem); margin: 0 auto 0.75rem; width: fit-content;
  box-shadow: 0 4px 20px rgba(26,58,107,0.2);
}
.search-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.25rem 1.4rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  box-shadow: var(--shadow); transition: border-color 0.2s, box-shadow 0.2s;
}
.search-card:hover { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.card-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--blue);
}
select {
  width: 100%; padding: 0.8rem 2.5rem 0.8rem 1rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-family: 'Barlow', sans-serif; font-size: 0.95rem;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6a7e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center;
  transition: border-color 0.2s, box-shadow 0.2s; min-height: 48px;
}
select:focus { outline: none; border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
select option { background: var(--surface); color: var(--text); }
input[type="submit"] {
  width: 100%; padding: 0.85rem 1.5rem;
  background: var(--blue); color: #fff;
  font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  min-height: 48px; transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(26,58,107,0.2); letter-spacing: 0.03em;
}
input[type="submit"]:hover { background: var(--blue-mid); }
input[type="submit"]:active { transform: scale(0.98); }
.separator {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.separator::before, .separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.footer-note { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ── TRICOLORE accent ── */
.tricolore { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-bottom: 0.1rem; }
.tricolore span { flex: 1; }
.tricolore .t-blue { background: var(--blue); }
.tricolore .t-white { background: #fff; }
.tricolore .t-red { background: var(--red); }
