/* ── Panneau stratégie ── */
#strategy-panel {
  width: fit-content;
  flex-shrink: 0;
  min-height: 0;
  background: #1f2937;
  border-left: 1px solid #374151;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

#chart {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.strategy-title {
  color: #fde68a;
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 13px;
}

/* ── Légende traductions ── */
.strategy-legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.55);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: bold;
}

.legend-swatch.action-h {
  background: #dc2626;
  color: white;
}
.legend-swatch.action-s {
  background: #15803d;
  color: white;
}
.legend-swatch.action-d {
  background: #d8c80f;
  color: #000;
}
.legend-swatch.action-sp {
  background: #1d4ed8;
  color: white;
}

.hl-info {
  margin-bottom: 8px;
  padding: 5px 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  font-size: 10px;
  color: #fde68a;
}

.hl-info:empty {
  display: none;
}

/* ── Tableau ── */
.chart-header-row {
  display: flex;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.chart-col-header {
  width: 32px;
  text-align: center;
  font-size: 10px;
  color: #ccc;
}

.chart-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.chart-section-title {
  display: flex;
  align-items: center;
  font-size: 9px;
  color: #ccc;
  border-bottom: 1px solid #374151;
  padding-bottom: 2px;
  margin-bottom: 2px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.chart-section-spacer {
  display: inline-block;
  width: 40px;
  flex-shrink: 0;
}

.chart-row {
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.chart-row-label {
  width: 40px;
  text-align: right;
  padding-right: 4px;
  font-size: 10px;
  color: #ccc;
  flex-shrink: 0;
}

/* Ligne active (situation du joueur) */
.chart-row.row-active .chart-row-label,
.chart-row-label.label-active {
  color: #fde68a;
  font-weight: 700;
}

/* ── Couleurs par action ── */
.action-h {
  background: #dc2626;
  color: white;
} /* Tirer      */
.action-s {
  background: #15803d;
  color: white;
} /* Rester     */
.action-d {
  background: #d8c80f;
  color: #000;
} /* Doubler    */
.action-sp {
  background: #1d4ed8;
  color: white;
} /* Séparer    */

/* Cellule par défaut (action inconnue) */
.chart-cell {
  border: 1px solid transparent;
}

/* Colonne surlignée */
.chart-cell.col-highlight {
  filter: brightness(1.5);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Cellule active (★ situation exacte du joueur) */
.chart-cell.cell-active {
  background: #fef9c3 !important;
  color: #374151 !important;
  border: 2px solid #fbbf24 !important;
  filter: none !important;
}

.chart-cell {
  width: 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* ── Mobile : stratégie affichée en bas ── */
@media (max-width: 600px) {
  #strategy-panel {
    display: flex;
    width: 100%;
    border-left: none;
    border-top: 2px solid #374151;
    padding: 12px 8px;
    height: auto;
    overflow-y: visible;
    align-items: flex-start;
  }
  #chart {
    flex: unset;
    height: auto;
    overflow-y: visible;
    width: 100%;
  }
  .chart-section {
    flex: unset;
    height: auto;
  }
  .chart-header-row,
  .chart-row {
    flex: unset;
    height: 20px;
    width: 100%;
  }
  .chart-row-label {
    width: 32px;
    font-size: 9px;
    padding-right: 2px;
    flex-shrink: 0;
  }
  .chart-cell {
    flex: 1;
    width: auto;
    height: 20px;
    font-size: 8px;
  }
  .chart-col-header {
    flex: 1;
    width: auto;
    font-size: 9px;
  }
  .chart-section-spacer {
    width: 32px;
  }
}
