.bbd-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.bbd-card--soft{
  background: var(--surface-2);
}

.bbd-section{
  margin: 14px 0;
}

.bbd-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  transition: .15s ease;
}

.bbd-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.bbd-btn--primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.bbd-btn--primary:hover{
  background: var(--primary-2);
  border-color: var(--primary-2);
}

.bbd-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.bbd-pill--success{
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, white);
  background: color-mix(in srgb, var(--success) 10%, white);
}

.bbd-pill--danger{
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, white);
  background: color-mix(in srgb, var(--danger) 10%, white);
}

.bbd-pill--warning{
  color: #9a6700;
  border-color: #f3d28b;
  background: #fff7e6;
}

.bbd-table-wrap{
  overflow-x: auto;
  border-radius: 14px;
}

.bbd-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.bbd-table th,
.bbd-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.bbd-table th{
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.bbd-title{
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.bbd-subtitle{
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.bbd-statcard-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.bbd-statcard-modal.is-open{
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}

.bbd-statcard-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(6px);
  z-index: 0;
}

.bbd-statcard-dialog{
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #0f172a;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
  padding: 16px 16px 14px;
  flex-shrink: 0;
}

.bbd-statcard-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}

.bbd-statcard-preview-wrap{
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.bbd-statcard-preview-wrap canvas{
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 14px;
  background: #111827;
}

.bbd-statcard-actions{
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.bbd-statcard-btn{
  border: 1px solid rgba(148,163,184,.24);
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.bbd-statcard-btn.primary{
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
/* Pastille "sur le terrain" bleue, après le nom */
.on-dot {
  display:inline-block;
  width:8px; height:8px;
  border-radius:50%;
  background:#0b79ff;
  margin-left:6px;
  vertical-align:middle;
  box-shadow:0 0 0 2px #fff;
}
/* ===== Boxscores match uniquement ===== */

.stack-boxscores > .detail-box{
  min-width: 0;
  overflow: hidden;
}

.stack-boxscores > .detail-box .table-wrap{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.stack-boxscores > .detail-box table.bx:not(.fr-night-table){
  width: max-content;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 12px;
  white-space: nowrap;
}

.stack-boxscores > .detail-box table.bx:not(.fr-night-table) th,
.stack-boxscores > .detail-box table.bx:not(.fr-night-table) td{
  padding: 5px 6px;
  white-space: nowrap;
}

.stack-boxscores > .detail-box table.bx:not(.fr-night-table) th:first-child,
.stack-boxscores > .detail-box table.bx:not(.fr-night-table) td:first-child{
  min-width: 180px;
  text-align: left;
}

.stack-boxscores > .detail-box table.bx:not(.fr-night-table) th:not(:first-child),
.stack-boxscores > .detail-box table.bx:not(.fr-night-table) td:not(:first-child){
  min-width: 52px;
  text-align: center;
}

@media (max-width: 640px){
  .stack-boxscores > .detail-box table.bx:not(.fr-night-table){
    min-width: 880px;
    font-size: 12px;
  }

  .stack-boxscores > .detail-box table.bx:not(.fr-night-table) th:first-child,
  .stack-boxscores > .detail-box table.bx:not(.fr-night-table) td:first-child{
    min-width: 200px;
  }
}
/* ===== Timeline de score ===== */
.score-tl {
  padding: 0;
}

/* ── Q-scores table ─────────────────────────── */
.tl-qscore { margin-bottom: 0; }
.tl-qs-table {
  width: 100%; border-collapse: collapse;
  font-size: .75rem;
}
.tl-qs-table thead th {
  color: #94a3b8; font-weight: 700; font-size: .68rem;
  padding: 4px 6px; text-align: center;
}
.tl-qs-table tbody td { padding: 4px 6px; text-align: center; color: #475569; }
.tl-qs-tri { text-align: left !important; font-weight: 900; white-space: nowrap; padding-right: 10px !important; }
.tl-qs-total { font-weight: 900; color: #0f172a; }
.tl-qs-win { color: #16a34a !important; }

/* ── Bar chart section ──────────────────────── */
.tl-section {
  margin-top: 12px;
  background: #fff;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
}
.tl-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px 8px;
  border-bottom: 1px solid rgba(148,163,184,.13);
  background: #f8fafc;
}
.tl-hdr-team {
  font-size: .72rem; font-weight: 900; letter-spacing: .04em;
  display: flex; align-items: center; gap: 5px;
}
.tl-hdr-team--right { flex-direction: row-reverse; }
.tl-hdr-side {
  font-size: .58rem; font-weight: 700; color: #94a3b8;
  background: rgba(148,163,184,.15); border-radius: 4px;
  padding: 1px 4px; letter-spacing: .05em;
}
.tl-hdr-label {
  font-size: .65rem; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .08em;
}
.tl-chart-wrap { padding: 0; }
.tl-chart { width: 100%; }
.tl-svg {
  width: 100%; height: 88px; display: block;
  overflow: visible;
}

/* ===== Récap FR : on annule les contraintes boxscore ===== */

.card.fr-night .detail-box{
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.card.fr-night .table-wrap{
  overflow-x: auto;
  overflow-y: hidden;
}

.card.fr-night table.bx.fr-night-table{
  width: 100%;
  min-width: 1180px;
  table-layout: auto;
  font-size: 13px;
}

.card.fr-night table.bx.fr-night-table th,
.card.fr-night table.bx.fr-night-table td{
  padding: 10px 12px;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
}

.card.fr-night table.bx.fr-night-table th:first-child,
.card.fr-night table.bx.fr-night-table td:first-child{
  text-align: left;
}

.card.fr-night table.bx.fr-night-table td.player-cell{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.card.fr-night table.bx.fr-night-table td.player-cell .pname{
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}

.card.fr-night .match-cell{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.card.fr-night .match-tris{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.card.fr-night .score-cell{
  font-weight: 800;
}
@media (max-width: 640px){
  .card.fr-night table.bx.fr-night-table{
    min-width: 980px;
    font-size: 12px;
  }

  .card.fr-night table.bx.fr-night-table th,
  .card.fr-night table.bx.fr-night-table td{
    padding: 8px 10px;
  }

  .card.fr-night table.bx.fr-night-table td.player-cell{
    min-width: 210px;
  }

  .card.fr-night table.bx.fr-night-table td.player-cell .hs-wrap{
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }
}

/* ===== Fix scroll horizontal boxscore mobile ===== */

.stack-boxscores .detail-box{
  overflow: visible;
}

.stack-boxscores .card-details{
  overflow: visible;
}

.stack-boxscores .table-wrap{
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.stack-boxscores .table-wrap table{
  min-width: 720px;
}
/* ===== Calendrier ===== */

#calendarContainer{
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:18px;
  padding:18px;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

#calendarContainer .cal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}

#calendarContainer .cal-title{
  font-size:1.05rem;
  font-weight:800;
  color:#0f172a;
}

#calendarContainer .chip-btn{
  width:40px;
  height:40px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff;
  font-size:18px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(37,99,235,.28);
}

#calendarContainer .cal-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}

#calendarContainer .cal-wd{
  text-align:center;
  font-size:.82rem;
  font-weight:800;
  color:#64748b;
}

#calendarContainer .cal-day{
  min-height:44px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:12px;
  background:#f8fafc;
  color:#0f172a;
  font-weight:700;
  cursor:pointer;
}

#calendarContainer .cal-day:hover{
  border-color:#2563eb;
  background:#eff6ff;
}

#calendarContainer .cal-day.today{
  border-color:#2563eb;
  color:#2563eb;
  background:#dbeafe;
}

#calendarContainer .cal-day.selected{
  border-color:#1d4ed8;
  background:linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff;
}

#calendarContainer .cal-help{
  margin-top:14px;
  font-size:.9rem;
  color:#475569;
}

/* ── Clip vote (pouce haut/bas) ── */
.clip-vote {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.clip-vote__btn {
  all: unset;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 7px;
  border: 1.5px solid transparent;
  transition: background .12s, border-color .12s;
}

.clip-vote__btn:hover { background: #f1f5f9; }
.clip-vote__btn--active-up   { background: #dcfce7; border-color: #86efac; }
.clip-vote__btn--active-down { background: #fee2e2; border-color: #fca5a5; }

.clip-vote__score {
  font-size: 12px;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}
.clip-vote__score--pos  { color: #16a34a; }
.clip-vote__score--neg  { color: #dc2626; }
.clip-vote__score--zero { color: #94a3b8; }

/* ── Highlights joueur (page joueur) ── */
.player-highlights { margin-top: 16px; }

.player-hl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.player-hl-card {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #dbe2ea);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .15s, transform .12s;
}

.player-hl-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.player-hl-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0c1220 0%, #1a2540 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-hl-card__play {
  opacity: .85;
  transition: opacity .12s, transform .12s;
}

.player-hl-card:hover .player-hl-card__play { opacity: 1; transform: scale(1.08); }

.player-hl-card__info {
  padding: 8px 10px 10px;
}

.player-hl-card__date {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 3px;
}

.player-hl-card__match {
  font-size: 12px;
  color: var(--ink, #0f172a);
  font-weight: 700;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-hl-card__result {
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
}
.player-hl-card__result--v { background: #dcfce7; color: #15803d; }
.player-hl-card__result--d { background: #fee2e2; color: #b91c1c; }

.player-hl-card__stats {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin: 0;
}

/* ── Badge Play-In / Playoffs ── */
.playin-chip {
  margin-top: 6px;
  background: #f0f4ff;
  border: 1px solid #6366f1;
  border-radius: 999px;
  padding: 4px 14px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #4338ca;
  letter-spacing: .03em;
  text-transform: uppercase;
}
