.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: block;
}

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

.bbd-statcard-dialog{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1240px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  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;
}

.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;
  }
}
/* ===== 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;
}