/* ==========================================================
   Single Problem – Layout global
   ========================================================== */
.bdm-problem-single{ max-width: 1120px; margin: 0 auto; padding: 40px 20px; }

/* Top bar */
.bdm-problem-topbar{ margin-bottom: 18px; }
.bdm-problem-back, .bdm-back-link{ text-decoration: none; color: var(--color-blue-primary); font-weight: 400; display: inline-flex; gap: 8px; align-items: center; transition: color .2s ease; }
.bdm-problem-back:hover, .bdm-back-link:hover{ color: var(--color-blue-80); }
.bdm-back-link:hover span{ transform: translateX(-4px); }

/* Header */
.bdm-problem-header{ margin-bottom: 28px; }
.bdm-header-badges { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

/* Badges */
.bdm-problem-badge, .bdm-problem-level { display: inline-block; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; text-transform: uppercase; }
.badge-bidding { background: var(--color-red-60); }
.badge-lead    { background: var(--color-red-primary); }
.badge-poll    { background: var(--color-red-secondary); }
.badge-cardplay { background: #4b66b4; } /* Ajout couleur Cardplay */
.bdm-problem-level { background-color: var(--color-blue-60, #64748b); }

/* Main title */
.bdm-problem-h1{ font-size: 36px; font-weight: 800; line-height: 1.25; color: var(--color-blue-primary); margin: 0 0 18px; }
.bdm-problem-h1 .bdm-hand-inline{ font-size: inherit; font-weight: 800; }
.bdm-problem-h1 .bdm-suitrow__sym{ font-size: 1em; vertical-align: baseline; margin-left: 6px; }

/* Meta row */
.bdm-problem-meta{ display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; color: var(--color-blue-80); margin-top: 10px; }
.bdm-meta-sep { color: #cbd5e1; font-size: 10px; }
.bdm-meta-count { font-weight: 600; color: var(--color-blue-primary); margin-left: 4px; }

/* Author */
.bdm-problem-author{ display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; color: var(--color-blue-primary); }
.bdm-problem-author:hover .name{ text-decoration: underline; }
.bdm-problem-author img{ width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* Votes & comments icons */
.bdm-problem-votes i, .bdm-problem-comments i{ font-size: 16px; color: var(--color-blue-60); margin-right: 4px; }
.bdm-problem-votes, .bdm-problem-comments{ display: inline-flex; align-items: center; white-space: wrap; }

/* Follow button */
.bdm-problem-follow{ margin-left: auto; }
.bdm-problem-follow .button{ background: var(--color-blue-10); border: none; color: var(--color-blue-primary); font-weight: 600; padding: 6px 14px; border-radius: 999px; font-size: 13px; transition: background .2s ease; }
.bdm-problem-follow .button:hover{ background: var(--color-blue-40); }

/* ==========================================================
   Main Layout & Board
   ========================================================== */
.bdm-problem-content{ background: var(--color-blue-5); border-radius: 26px; padding: 34px 40px; margin-top: 26px; }
.bdm-problem-sep{ border: none; background-color: var(--color-blue-10); margin: 30px 0; height: 1px; }

.bdm-problem-board-title, .bdm-problem-board-context { font-size: 18px; font-weight: 700; color: var(--color-blue-primary); margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.bdm-ctx-sep { color: #cbd5e1; font-weight: 300; font-size: 0.8em; }

.bdm-problem-board{ display: grid; grid-template-columns: 1fr 280px; gap: 30px; }
.bdm-problem-board-left, .bdm-problem-board-right{ background: #fff; border-radius: 18px; padding: 0px; } 

/* Panels */
.bdm-problem-panel{ background: #fff; border-radius: 18px; padding: 20px;  }
.bdm-problem-panel-title{ font-size: 18px; font-weight: 800; color: var(--color-blue-primary); margin: 0 0 14px; }
.bdm-problem-panel-content{ font-size: 15px; color: var(--color-blue-90); }
.bdm-problem-panel--note{ margin-top: 24px; }
.bdm-problem-note{ line-height: 1.65; }

/* Hand Block */
.bdm-hand-block{ display: flex; flex-direction: column; gap: 10px; }
.bdm-hand-row{ display: flex; align-items: baseline; gap: 10px; font-size: 20px; font-weight: 800; color: var(--color-blue-primary); }
.bdm-hand-row .bdm-suitrow__sym{ font-size: 1em; }

/* Suit Colors */
.suit-s, .bdm-suit--spades .bdm-suitrow__sym   { color: #000; }
.suit-h, .bdm-suit--hearts .bdm-suitrow__sym   { color: #d02b3b; }
.suit-d, .bdm-suit--diamonds .bdm-suitrow__sym { color: #f28c1a; }
.suit-c, .bdm-suit--clubs .bdm-suitrow__sym    { color: #1b7a52; }
.suit-nt, .bdm-call-btn.suit-nt                { color: #475569; }

/* ==========================================================
   Tableau des Enchères
   ========================================================== */
.auction-table { width: 100%; margin: 0; }
.auction-header-row { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.auction-th { text-align: center; font-weight: 800; color: var(--color-blue-primary); padding: 10px 0; }
.auction-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; }

.auction-cell { 
    position: relative; font-weight: 800; font-size: 18px; height: 50px; 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 6px; background: #fff; border: 1px solid #e2e8f0; color: #0b1a52; 
}

/* Couleurs spécifiques Enchères Transparentes (Dans le tableau) */
.auction-cell.cell-pass { background: #fff !important; color: #408852 !important; }
.auction-cell.cell-x    { background: #fff !important; color: #D64F42 !important; }
.auction-cell.cell-xx   { background: #fff !important; color: #4362A5 !important; }
.auction-cell.cell-question { background-color: #e67e22 !important; color: #fff !important; border-color: #e67e22; font-size: 1.4em; }

.auction-cell.cell-pass span, 
.auction-cell.cell-x span, 
.auction-cell.cell-xx span { color: inherit !important; }

/* Badges (Alerte / Commentaire) */
.bid-badge-alert {
    position: absolute; top: 2px; right: 2px;
    background-color: #4a63ad; color: #fff; font-size: 10px; font-weight: 700;
    width: 16px; height: 16px; border-radius: 3px;
    display: flex; align-items: center; justify-content: center; cursor: help; line-height: 1; z-index: 10;
}
.bid-badge-comment {
    position: absolute; bottom: 2px; right: 2px;
    width: 18px; height: 18px; background-color: #538e58; border-radius: 3px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 20; transition: transform 0.1s;
}
.bid-badge-comment i { color: #fff; font-size: 10px; }
.bid-badge-comment:hover { transform: scale(1.1); background-color: #457a4a; }
.bid-badge-comment.is-active .bdm-comment-popup { display: block; animation: bdmFadeIn 0.2s ease-out; }
@keyframes bdmFadeIn { from { opacity:0; transform:translate(-50%, 0); } to { opacity:1; transform:translate(-50%, -8px); } }

/* ==========================================================
   Zone de Réponse (Bidding Box QCM / Free)
   ========================================================== */
.bdm-problem-answer-grid{ display:grid; grid-template-columns: 420px 1fr; gap: 40px; }
.bdm-problem-h2{ font-size: 28px; font-weight: 800; margin: 0 0 22px; color: var(--color-blue-primary); }

.bdm-calls-table{ background: var(--color-blue-10); border-radius: 12px; padding: 10px; transition: all 0.5s ease; }
.bdm-calls-row{ display:grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-bottom: 6px; }
.bdm-calls-row--special { grid-template-columns: repeat(3, 1fr); }

/* Boutons d'enchères standard */
.bdm-call-btn{
    background:#fff; border-radius:8px; padding:10px 0; font-weight:800; font-size: 18px;
    cursor:pointer; border:2px solid #fff; color: #0b1a52;
    display: flex; align-items: center; justify-content: center; gap: 2px;
    transition: border-color .15s ease, transform 0.12s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.bdm-call-btn:hover{
    border-color: var(--color-blue-80);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
	background:#fff !important; color: #0b1a52 !important;
}
.bdm-call-btn:active { transform: translateY(1px); }

/* Boutons d'enchères SPÉCIALES dans la zone de réponse (Style Transparent) */
.bdm-call-btn[data-call="Pass"] { color: #408852; }
.bdm-call-btn[data-call="X"]    { color: #D64F42; }
.bdm-call-btn[data-call="XX"]   {  color: #4362A5; }


/* État sélectionné (Standard et Spécial) */
.bdm-call-btn.is-selected { background:#fff !important; color: #0b1a52 !important; border-color: var(--color-blue-primary); box-shadow: 0 0 0 3px rgba(11, 26, 82, 0.15); z-index: 2; }
.bdm-call-btn[data-call="Pass"].is-selected  { border-color: #408852; color: #408852 !important; background: #f0fdf4 !important; box-shadow: 0 0 0 3px rgba(64, 136, 82, 0.2); }
.bdm-call-btn[data-call="X"].is-selected     { border-color: #D64F42; color: #D64F42 !important; background: #fef2f2 !important; box-shadow: 0 0 0 3px rgba(214, 79, 66, 0.2); }
.bdm-call-btn[data-call="XX"].is-selected    { border-color: #4362A5; color: #4362A5 !important; background: #eff6ff !important; box-shadow: 0 0 0 3px rgba(67, 98, 165, 0.2); }

/* État Verrouillé (Après réponse) */
.bdm-calls-table.is-locked { pointer-events: none;  }
.bdm-calls-table.is-locked .bdm-call-btn.is-selected { opacity: 1 !important; filter: grayscale(0); z-index: 5; transform: scale(1.05); }
.bdm-call-btn.is-disabled { opacity: 0.3; cursor: not-allowed; background: #f8f8f8; color: #cbd5e1; box-shadow: none; border-color: transparent; }

/* Bouton Valider */
.bdm-btn-validate {
    width: 100%; background: var(--color-blue-primary); color: #fff; border: none;
    padding: 15px; border-radius: 12px; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: background 0.2s; margin-top: 20px;
}
.bdm-btn-validate:hover { background: #1e3a8a; }
.bdm-btn-validate:disabled { opacity: 0.7; cursor: wait; }

/* ==========================================================
   CARDPLAY : 2/3 - 1/3 LAYOUT
   ========================================================== */
.bdm-cardplay-split-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr; /* Proportion 2/3 1/3 ajustée */
    gap: 40px;
    align-items: start;
    margin-bottom: 30px;
}

.bdm-cardplay-table {
    display: grid;
    grid-template-areas:
        ". north ."
        "west compass east"
        ". south .";
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.bdm-cp-pos { display: flex; justify-content: center; }
.bdm-cp-pos-N { grid-area: north; }
.bdm-cp-pos-W { grid-area: west; }
.bdm-cp-pos-E { grid-area: east; }
.bdm-cp-pos-S { grid-area: south; }
.bdm-cp-compass { grid-area: compass; display: flex; align-items: stretch; justify-content: center; }

/* ==========================================================
   Zone de Droite (Résultats)
   ========================================================== */
.bdm-problem-answer-right { opacity: 0; transform: translateY(10px); transition: all 0.5s ease; }
.bdm-problem-answer-right.is-hidden { display: none; }
.bdm-problem-answer-right.is-visible { display: block; opacity: 1; transform: translateY(0); }

/* Enchère Recommandée */
.bdm-rec-box {
    background: #fff; border: 1px solid #bae6fd; padding: 16px; border-radius: 8px;
    margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;
}
.bdm-rec-label { color: var(--color-blue-primary); font-weight: 600; }
.bdm-rec-val { font-size: 20px; font-weight: 800; color: #0b1a52; }

/* Note Auteur */
.bdm-answer-right-author-note { background: #fff; border-left: 4px solid var(--color-blue-primary); padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.bdm-answer-right-title { font-size: 16px; font-weight: 700; color: var(--color-blue-primary); margin-bottom: 10px; }

/* Résultats Barres */
.bdm-result-row { margin-bottom: 12px; }
.bdm-result-top { display: flex; justify-content: space-between; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.bdm-result-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; position: relative; }
.bdm-result-bar-fill { height: 100%; background: var(--color-blue-primary); border-radius: 4px; transition: width 1s ease; }
.bdm-result-row.is-mine .bdm-result-bar-fill { background: #3e8e4f; }

/* Spinner */
.bdm-answer-spinner { width: 100%; display: flex; justify-content: center; padding: 20px; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #e2e8f0; border-top-color: var(--color-blue-primary); animation: bdm-spin 0.8s linear infinite; }
@keyframes bdm-spin { to { transform: rotate(360deg); } }

/* ==========================================================
   Commentaires
   ========================================================== */
.bdm-problem-comments-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.bdm-comments-toggle { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: none; font-size: 14px; font-weight: 600; color: var(--color-blue-80); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.bdm-comments-toggle:hover { background: var(--color-blue-10); }
.bdm-problem-comments.is-collapsed { overflow: hidden; }

/* STYLE DES COMMENTAIRES SUR MESURE */
.bdm-problem-comment-form #respond { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; margin-top: 15px; }
.bdm-custom-comment { display: flex; flex-wrap: wrap; gap: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }

.bdm-custom-comment .bdm-custom-comment{
	min-width:100%;
}

.bdm-comment-avatar img { border-radius: 50%; display: block; width: 48px; height: 48px; object-fit: cover; }
.bdm-comment-content-wrapper { flex: 1; min-width: 0; }
.bdm-comment-header { margin-bottom: 8px; display: flex; flex-direction: column; }
.bdm-comment-author { font-size: 16px; color: #0b1a52; font-weight: 800; }
.bdm-comment-date { font-size: 13px; color: #64748b; margin-top: 2px; }
.bdm-comment-text { font-size: 15px; color: #334155; line-height: 1.6; margin-bottom: 12px; }
.bdm-comment-text p { margin-bottom: 0; }
.bdm-comment-actions a { font-size: 13px; font-weight: 700; color: #0b1a52; text-decoration: none; display: inline-block; }
.bdm-comment-actions a:hover { text-decoration: underline; color: #1e3a8a; }

/* ==========================================================
   BLOC ONBOARDING / LOCKED (Non connecté)
   ========================================================== */
.bdm-locked-box {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 40px 30px; text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 400px;
}
.bdm-locked-icon { width: 60px; height: 60px; background: var(--color-blue-5, #eff6ff); color: var(--color-blue-primary, #0b1a52); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 20px; }
.bdm-locked-title { font-size: 22px; font-weight: 800; color: var(--color-blue-primary, #0b1a52); margin: 0 0 12px; }
.bdm-locked-desc { font-size: 15px; color: var(--color-blue-80, #64748b); line-height: 1.6; max-width: 320px; margin: 0 auto 30px; }
.bdm-locked-actions { display: flex; gap: 16px; width: 100%; justify-content: center; }
.bdm-btn-login, .bdm-btn-register { padding: 12px 24px; border-radius: 99px; font-weight: 700; text-decoration: none; font-size: 15px; transition: all 0.2s ease; min-width: 120px; }
.bdm-btn-login { border: 2px solid var(--color-blue-primary); color: var(--color-blue-primary); background: transparent; }
.bdm-btn-login:hover { background: var(--color-blue-5); }
.bdm-btn-register { background: var(--color-blue-primary); color: #fff; border: 2px solid var(--color-blue-primary); box-shadow: 0 4px 12px rgba(11, 26, 82, 0.2); }
.bdm-btn-register:hover { background: #1e3a8a; border-color: #1e3a8a; transform: translateY(-2px); }

/* ==========================================================
   LEAD PROBLEM (Style Cartes)
   ========================================================== */
.bdm-lead-hand { display: flex; flex-direction: column; gap: 12px; justify-content: flex-start; width: 100%; }
.bdm-lead-suit-row { display: flex; flex-direction: row !important; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.bdm-card-btn {
    appearance: none; border: 2px solid #e2e8f0; background: #fff !important; border-radius: 12px;
    width: 65px; height: 90px; padding: 8px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
.bdm-card-btn:hover { transform: translateY(-4px); box-shadow: 0 10px 15px rgba(0,0,0,0.08); border-color: var(--color-blue-40); }
.bdm-card-btn.is-selected { border-color: var(--color-blue-primary); border-width: 3px; box-shadow: 0 0 0 4px rgba(11, 26, 82, 0.1); transform: translateY(-4px); background: #fff !important; }
.bdm-card-suit { font-size: 24px; line-height: 1; }
.bdm-card-rank { font-size: 22px; font-weight: 800; font-family: 'Inter', sans-serif; color: var(--color-blue-primary); }

/* Helper classes */
.bdm-bid-special { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; box-sizing: border-box; margin: 0; }
.bdm-bid-q { background-color: #E39132 !important; color: #fff !important; font-size: 20px; border-radius: 4px; padding: 2px 8px; }

/* 1. On force le conteneur à empiler les éléments verticalement */
.bdm-comments-list {
    display: flex;
    flex-direction: column; /* L'astuce est ici : on passe de row à column */
    gap: 20px; /* Ajoute un espace propre entre chaque commentaire */
    width: 100%;
}

/* 2. On s'assure que chaque carte de commentaire prend bien toute la place */
.bdm-comments-list .bdm-custom-comment,
.bdm-comments-list .comment {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0; /* On annule les marges latérales potentielles du thème */
}
/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width:1024px) {
    .bdm-cardplay-split-layout { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width:900px){
  .bdm-problem-board, .bdm-problem-answer-grid { grid-template-columns:1fr; }
}
@media (max-width:768px){
  .bdm-problem-h1{ font-size:28px; }
  .bdm-problem-content{ padding:22px 20px; }
  .bdm-cardplay-table { grid-template-areas: "north" "compass" "west" "east" "south"; grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .bdm-card-btn { width: 55px; height: 80px; }
  .bdm-card-suit { font-size: 20px; }
  .bdm-card-rank { font-size: 18px; }
  .bdm-locked-box { min-height: auto; padding: 30px 20px; }
  .bdm-locked-actions { flex-direction: column; }
  .bdm-btn-login, .bdm-btn-register { width: 100%; }
}