/* Concours de belote : déroulement (tables, saisie des scores, classement) */
.belote { --belote-a: #1e6f5c; --belote-b: #b4532a; }

.belote-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-bottom: 16px; }
.belote-entete__titre { flex: 1 1 320px; min-width: 0; }
.belote-entete__titre h1 { margin: 2px 0 4px; font-size: 1.6rem; font-weight: 800; }
.belote-entete__titre p { margin: 0; color: var(--mud-palette-text-secondary); }
.belote-entete__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.belote-progression { display: flex; flex-wrap: wrap; gap: 6px; }
.belote-progression__tour {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--mud-palette-divider); color: var(--mud-palette-text-secondary); font-weight: 800; font-size: .8rem;
}
.belote-progression__tour.est-courant { border-color: var(--mud-palette-primary); color: var(--mud-palette-primary); }
.belote-progression__tour.est-fait { border-color: var(--mud-palette-success); background: var(--mud-palette-success); color: #fff; }

.belote-aide { margin: 0 0 12px; color: var(--mud-palette-text-secondary); font-size: .9rem; }
.belote-carte { padding: 18px 20px; border: 1px solid var(--mud-palette-divider); border-radius: 16px; background: var(--mud-palette-surface); }
.belote-carte h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; }
.belote-formation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: center; }

.belote-equipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.belote-equipe { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--mud-palette-divider); border-radius: 12px; background: var(--mud-palette-surface); }
.belote-equipe.est-incomplete { border-color: var(--mud-palette-warning); }
.belote-equipe__numero {
    display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
    background: color-mix(in srgb, var(--belote-a) 15%, transparent); color: var(--belote-a); font-weight: 800;
}
.belote-equipe__texte { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.belote-equipe__texte small { color: var(--mud-palette-text-secondary); }

/* Tour : bandeau de progression et grille des tables */
.belote-tour__bandeau { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; font-weight: 700; }
.belote-tour__bandeau > span { white-space: nowrap; }
.belote-tour__bandeau > b { white-space: nowrap; color: var(--mud-palette-text-secondary); font-weight: 600; }
.belote-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.belote-table {
    display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--mud-palette-divider);
    border-radius: 18px; background: var(--mud-palette-surface); transition: box-shadow .2s, transform .2s;
}
.belote-table:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.belote-table.est-terminee { border-color: color-mix(in srgb, var(--mud-palette-success) 45%, var(--mud-palette-divider)); }
.belote-table.est-exemptee { opacity: .75; }

.belote-table__plateau { position: relative; aspect-ratio: 1; }
.belote-table__plateau img { width: 100%; height: 100%; object-fit: contain; display: block; }
.belote-table.est-terminee .belote-table__plateau img { filter: saturate(.55) brightness(.92); }
.belote-table__numero {
    position: absolute; top: 0; left: 0; padding: 3px 10px; border-radius: 999px;
    background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-divider); font-size: .75rem; font-weight: 800;
}

/* Sièges : partenaires face à face (A en haut et en bas, B à gauche et à droite) */
.belote-siege {
    position: absolute; max-width: 46%; padding: 3px 9px; border-radius: 999px; color: #fff; font-size: .75rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.belote-siege.est-a { background: var(--belote-a); }
.belote-siege.est-b { background: var(--belote-b); }
.belote-siege--haut { top: 4%; left: 50%; transform: translateX(-50%); }
.belote-siege--bas { bottom: 4%; left: 50%; transform: translateX(-50%); }
.belote-siege--gauche { left: 0; top: 50%; transform: translateY(-50%) translateY(-28px); }
.belote-siege--droite { right: 0; top: 50%; transform: translateY(-50%) translateY(28px); }

.belote-table__score {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; border-radius: 14px; background: rgba(255, 255, 255, .94); color: #1d2a26; font-size: 1.5rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.belote-table__score b { font-weight: 800; color: #7a8783; }
.belote-table__score b.est-gagnant { color: #1d2a26; }

.belote-table__cotes { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.belote-table__contre { color: var(--mud-palette-text-secondary); font-size: .75rem; }
.belote-cote { display: flex; flex-direction: column; min-width: 0; padding: 6px 8px; border-radius: 10px; border-left: 4px solid; }
.belote-cote.est-a { border-color: var(--belote-a); }
.belote-cote.est-b { border-color: var(--belote-b); text-align: right; border-left: 0; border-right: 4px solid var(--belote-b); }
.belote-cote > span { font-weight: 700; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.belote-cote small { color: var(--mud-palette-text-secondary); }
.belote-cote.est-gagnant { background: color-mix(in srgb, var(--mud-palette-success) 12%, transparent); }
.belote-table__detail { margin: 0; text-align: center; color: var(--mud-palette-text-secondary); font-size: .78rem; }
.belote-table__exempt { margin: 0; text-align: center; color: var(--mud-palette-text-secondary); font-size: .85rem; }

/* Saisie du score */
.belote-saisie__entete, .belote-saisie__ligne { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.belote-saisie__entete { margin-bottom: 6px; }
.belote-saisie__entete b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.belote-saisie__entete .est-a { color: #1e6f5c; }
.belote-saisie__entete .est-b { color: #b4532a; }
.belote-saisie__ligne > span { font-weight: 700; color: var(--mud-palette-text-secondary); }
.belote-saisie__gagnant .mud-input-outlined-border { border-color: var(--mud-palette-success) !important; border-width: 2px !important; }
.belote-saisie__actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.belote-saisie__etat { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--mud-palette-background-gray); font-size: .88rem; }
.belote-saisie__etat.est-ok { background: color-mix(in srgb, var(--mud-palette-success) 14%, transparent); }

/* Classement */
.belote-classement__detail { display: block; color: var(--mud-palette-text-secondary); }
.belote-rang { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; background: var(--mud-palette-background-gray); }
.belote-rang--1 { background: #f2c94c; color: #4a3b00; }
.belote-rang--2 { background: #d5d9dd; color: #33393f; }
.belote-rang--3 { background: #e0a26b; color: #4a2a0a; }

@media (max-width: 760px) {
    .belote-formation { grid-template-columns: 1fr; }
    .belote-tables { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
