/* ============================================================
   Pronostics — calendrier, cartes de match, détail
   ============================================================ */

.match-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.day-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0 var(--sp-2);
}
.day-head:first-child { margin-top: 0; }
.day-head h2 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand-700);
}
.day-head .rule { flex: 1; height: 1px; background: var(--line); }

/* ---- Carte de match ---- */
.match-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
  transition: box-shadow .15s, border-color .15s;
}
.match-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }

.mc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
}
.mc-meta .grp { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.mc-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-2);
}
.mc-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mc-team .flag {
  width: 30px; height: 22px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
  flex: 0 0 auto;
}
.mc-team .nom { font-weight: 700; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-team.home { justify-content: flex-end; text-align: right; }
.mc-team.home .flag { order: 2; }

.mc-center { text-align: center; padding: 0 var(--sp-2); }
.mc-time {
  font-family: var(--display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--brand-700);
  background: var(--brand-50);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  white-space: nowrap;
}
.mc-score {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

/* ---- Saisie du prono ---- */
.prono-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.prono-form input[type="number"] {
  width: 56px;
  height: 52px;
  padding: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  border-radius: var(--r-sm);
  -moz-appearance: textfield;
}
.prono-form input[type="number"]::-webkit-outer-spin-button,
.prono-form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.prono-form .dash { font-weight: 800; color: var(--faint); }
.prono-form button { height: 52px; }
.prono-form .countdown {
  flex-basis: 100%;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
}

/* ---- Mon prono (verrouillé) ---- */
.my-pred {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: var(--ink-soft);
}
.my-pred .score { font-weight: 800; font-family: var(--display); color: var(--ink); }
.my-pred .pts { margin-left: auto; color: var(--brand-700); font-weight: 800; }
.my-pred.none { color: var(--muted); }

/* ---- Détail match ---- */
.match-hero {
  background: linear-gradient(150deg, var(--brand-700), var(--brand));
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow);
}
.match-hero h1 { color: #fff; }
.match-hero .meta { color: rgba(255, 255, 255, .85); margin-top: 8px; font-size: .9rem; }
.match-hero .final { font-family: var(--display); font-weight: 800; font-size: 2.4rem; margin-top: var(--sp-3); }

.hero-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-team img {
  width: 60px; height: 60px; object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25));
}
.hero-team .nom { font-weight: 800; font-family: var(--display); color: #fff; }
.hero-score { text-align: center; }
.hero-score .ft {
  font-family: var(--display); font-weight: 800; font-size: 2.8rem;
  font-variant-numeric: tabular-nums; line-height: 1; color: #fff;
}
.hero-score .ht { font-size: .8rem; color: rgba(255, 255, 255, .8); margin-top: 6px; }
.hero-scorers {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-5);
  margin-top: var(--sp-4); padding-top: var(--sp-3);
  border-top: 1px solid rgba(255, 255, 255, .25);
  font-size: .82rem; color: rgba(255, 255, 255, .92);
}
.hero-scorers .g { display: flex; gap: 6px; }
.hero-scorers .col-away { text-align: right; justify-content: flex-end; }

.my-prono-strip {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.my-prono-strip .sc { font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
.my-prono-strip .pts { color: var(--brand-700); font-weight: 800; }

.dist { display: flex; flex-direction: column; gap: var(--sp-2); }
.dist-row {
  display: grid; grid-template-columns: 52px 1fr 44px;
  align-items: center; gap: var(--sp-3);
}
.dist-row .sc { font-family: var(--display); font-weight: 800; }
.dist-row .bar { height: 10px; border-radius: var(--r-pill); background: var(--brand-100); overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); }
.dist-row .pc { font-size: .8rem; color: var(--muted); text-align: right; }

.tl-toggle {
  margin-top: var(--sp-3); font-size: .85rem; font-weight: 700;
  color: var(--brand-700); background: none; border: 0;
  cursor: pointer; padding: var(--sp-2) 0; min-height: 44px;
}
.tl-rest[hidden] { display: none; }

/* ---- Chambrage ---- */
.comment {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-2);
}
.comment strong { color: var(--brand-700); }
.comment time { font-size: .76rem; color: var(--faint); margin-left: 8px; }
.comment p { margin-top: 4px; }

/* ---- Détails post-match (API-Football) ---- */
.detail-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; margin-bottom: var(--sp-5); }
@media (min-width: 720px) { .detail-grid { grid-template-columns: 1fr 1fr; } .detail-grid .lineups { grid-column: 1 / -1; } }
.detail-title { margin-bottom: var(--sp-3); }
.tl-row { display: flex; align-items: baseline; gap: 10px; padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.tl-row:last-child { border-bottom: 0; }
.tl-min { font-family: var(--display); font-weight: 800; color: var(--brand-700); min-width: 40px; }
.stat-row { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.stat-row:last-child { border-bottom: 0; }
.stat-k { text-align: center; color: var(--muted); }
.stat-v { font-weight: 800; font-family: var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.lineup-cols { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 560px) { .lineup-cols { grid-template-columns: 1fr 1fr; } }
.lineup-cols h4 { margin-bottom: var(--sp-2); }
.lineup-cols ul { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.lineup-cols li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.lineup-cols li:last-child { border-bottom: 0; }
.lineup-cols .num { display: inline-block; min-width: 26px; font-family: var(--display); font-weight: 800; color: var(--brand-700); }

/* ---- Saisie auto-enregistrée : champ + flèches discrètes ---- */
.score-field {
  position: relative;
  display: flex;
  align-items: center;
}
.prono-form .score-field input[type="number"] {
  width: 76px;
  height: 52px;
  padding-right: 26px;
  text-align: center;
  border-radius: var(--r-sm);
}
.score-field .spin {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: .45;
  transition: opacity .15s;
}
.score-field:hover .spin,
.score-field:focus-within .spin { opacity: 1; }
.score-field .step {
  flex: 1;
  width: 22px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--faint);
  font-size: .5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.score-field .step:hover { color: var(--brand-700); background: var(--brand-50); }
.score-field .step:active { color: var(--brand-700); background: var(--brand-100); }

.match-card { position: relative; }
.save-state {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 12px;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}
.save-state.is-error { pointer-events: auto; }
.save-state.is-dirty  { color: var(--faint); }
.save-state.is-saving { color: var(--ink-soft); background: var(--surface-2); }
.save-state.is-saved  { color: var(--brand-700); background: var(--brand-50); }
.save-state.is-error  { color: #fff; background: var(--live); cursor: pointer; }
.save-state.pop { animation: save-pop .35s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes save-pop {
  0% { transform: scale(.85); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.prono-form.js-on .save-fallback { display: none; }
@media (prefers-reduced-motion: reduce) { .save-state.pop { animation: none; } }
