/* ============================================
   TOURNOI — Admin + Client
   ============================================ */

/* ===== ADMIN ===== */

.tournoi-admin-wrap {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#tournoi-root {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tournoi-card {
    background: rgba(244, 240, 230, 0.08);
    border: 1px solid rgba(244, 240, 230, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.tournoi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.tournoi-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #f4c941;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.tournoi-subtitle {
    font-size: 0.9rem;
    color: rgba(244, 240, 230, 0.7);
}

.tournoi-section-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #efa707;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.15);
}

.tournoi-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tournoi-form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Vue création centrée */
.tournoi-create-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
    gap: 1.5rem;
}

.tournoi-card--centered {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}
.tournoi-card--centered .tournoi-form {
    text-align: left;
}

/* Formulaire ajout équipe (2 joueurs) */
.add-equipe-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.add-equipe-row {
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: 0.4rem;
    align-items: center;
}
.add-equipe-label {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-align: center;
}
.add-equipe-form .tournoi-input {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.88rem !important;
}

/* Widget terrain éditable dans le header */
.tournoi-terrain-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: rgba(244, 240, 230, 0.85);
}
.tournoi-terrain-edit-label {
    color: rgba(244, 240, 230, 0.6);
    font-size: 0.85rem;
}

/* Onglets de la vue tournoi admin */
.tournoi-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.1);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}
.tournoi-tab {
    background: transparent;
    border: 1px solid rgba(244, 240, 230, 0.15);
    color: rgba(244, 240, 230, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.15s;
}
.tournoi-tab:hover {
    color: #f4f0e6;
    border-color: rgba(244, 201, 65, 0.4);
}
.tournoi-tab--active {
    background: rgba(244, 201, 65, 0.12);
    border-color: rgba(244, 201, 65, 0.5);
    color: #f4c941;
}
.tournoi-tabs-spacer { flex: 1; }

/* Pointage : stats + liste */
.pointage-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.pointage-stat {
    flex: 1;
    min-width: 140px;
    background: rgba(244, 201, 65, 0.08);
    border: 1px solid rgba(244, 201, 65, 0.25);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.pointage-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(244, 240, 230, 0.6);
    font-weight: 700;
}
.pointage-stat-value {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.pointage-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.pointage-equipe {
    background: rgba(244, 240, 230, 0.04);
    border: 1px solid rgba(244, 240, 230, 0.1);
    border-radius: 10px;
    overflow: hidden;
}
.pointage-equipe-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    background: rgba(244, 240, 230, 0.05);
    border-bottom: 1px solid rgba(244, 240, 230, 0.08);
}
.pointage-equipe-nom {
    font-weight: 700;
    color: #f4f0e6;
    font-size: 0.92rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pointage-poule {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(244, 201, 65, 0.7);
    font-weight: 700;
    flex-shrink: 0;
}

.pointage-joueur {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0.9rem;
    border-top: 1px dashed rgba(244, 240, 230, 0.06);
    transition: background 0.15s;
}
.pointage-joueur:first-of-type { border-top: none; }
.pointage-joueur--present { background: rgba(244, 201, 65, 0.04); }
.pointage-joueur--paye    { box-shadow: inset 3px 0 0 rgba(72, 187, 120, 0.55); }
.pointage-joueur-nom {
    color: #f4f0e6;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pointage-toggles {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

/* Compat : ancienne classe pointage-row si quelque chose la cible encore (rien dans le JS mais on garde) */
.pointage-row { display: none; }

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(244, 240, 230, 0.18);
    background: rgba(244, 240, 230, 0.04);
    color: rgba(244, 240, 230, 0.5);
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.15s;
}
.toggle-btn:hover {
    background: rgba(244, 240, 230, 0.08);
    color: #f4f0e6;
}
.toggle-btn--on {
    background: rgba(72, 187, 120, 0.15);
    border-color: rgba(72, 187, 120, 0.5);
    color: #6ee7a7;
}
.toggle-icon { font-size: 1rem; line-height: 1; }
.toggle-label { letter-spacing: 0.02em; }

/* Checkbox dans le formulaire de création */
.checkbox-row {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.6rem;
    row-gap: 0.15rem;
    align-items: center;
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: rgba(244, 240, 230, 0.04);
    border: 1px solid rgba(244, 240, 230, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.checkbox-row:hover {
    background: rgba(244, 240, 230, 0.07);
    border-color: rgba(244, 201, 65, 0.3);
}
.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #f4c941;
    cursor: pointer;
    grid-row: span 2;
}
.checkbox-text {
    font-weight: 600;
    color: #f4f0e6;
    font-size: 0.9rem;
}
.checkbox-hint {
    font-size: 0.78rem;
    color: rgba(244, 240, 230, 0.55);
    line-height: 1.4;
}

/* Tournois archivés */
.tournoi-card--archived {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: rgba(244, 240, 230, 0.04);
    border-color: rgba(244, 240, 230, 0.12);
}
.archived-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.archived-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(244, 240, 230, 0.04);
    border: 1px solid rgba(244, 240, 230, 0.1);
    border-radius: 10px;
}
.archived-info { flex: 1; min-width: 0; }
.archived-nom {
    font-weight: 600;
    color: #f4f0e6;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.archived-meta {
    font-size: 0.78rem;
    color: rgba(244, 240, 230, 0.55);
    margin-top: 0.2rem;
}
.archived-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .archived-item {
        flex-direction: column;
        align-items: stretch;
    }
    .archived-actions { justify-content: flex-end; }
}

.format-hint {
    font-size: 0.8rem;
    color: rgba(244, 240, 230, 0.65);
    line-height: 1.5;
    margin-top: 0.6rem;
    padding: 0.7rem 0.9rem;
    background: rgba(244, 201, 65, 0.06);
    border-left: 3px solid rgba(244, 201, 65, 0.4);
    border-radius: 4px;
    font-style: italic;
}

.tournoi-input {
    background: transparent;
    border: 0;
    color: #f4f0e6;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    outline: none;
    width: 100%;
    flex: 1;
}
.tournoi-input::placeholder { color: rgba(244, 240, 230, 0.4); }

.tournoi-input--mini {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

select.tournoi-input {
    appearance: none;
    cursor: pointer;
    background: rgba(244, 240, 230, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(244, 240, 230, 0.2);
}
select.tournoi-input--mini {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}
select.tournoi-input option {
    background: #680920;
    color: #f4f0e6;
}

.control-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(244, 240, 230, 0.7);
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: block;
}

/* Layout 2 colonnes équipes / poules */

.tournoi-setup-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) {
    .tournoi-setup-grid {
        grid-template-columns: 1fr;
    }
}

.tournoi-card--equipes {
    display: flex;
    flex-direction: column;
}

.tournoi-hint {
    font-size: 0.8rem;
    color: rgba(244, 240, 230, 0.6);
    margin: -0.5rem 0 0.75rem 0;
    line-height: 1.4;
}

.equipes-sub-head {
    margin-top: 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(244, 240, 230, 0.5);
    font-weight: 700;
}

/* Équipes */

.equipes-list {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 80px;
    padding: 0.4rem;
    border-radius: 10px;
    border: 1px dashed transparent;
    transition: background 0.15s, border-color 0.15s;
}
.equipes-list--dropzone.drop-target,
.poule-equipes--dropzone.drop-target {
    background: rgba(244, 201, 65, 0.08);
    border-color: rgba(244, 201, 65, 0.5);
}

.equipe-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    background: rgba(244, 240, 230, 0.05);
    border: 1px solid rgba(244, 240, 230, 0.12);
    border-radius: 10px;
}
.equipe-item--draggable {
    cursor: grab;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.1s, opacity 0.1s;
}
.equipe-item--draggable:hover {
    border-color: rgba(244, 201, 65, 0.4);
    background: rgba(244, 240, 230, 0.08);
}
.equipe-item--draggable:active {
    cursor: grabbing;
}
.equipe-item--draggable.dragging {
    opacity: 0.4;
    transform: scale(0.97);
}
.drag-handle {
    color: rgba(244, 240, 230, 0.35);
    font-size: 0.85rem;
    letter-spacing: -1px;
    line-height: 1;
    cursor: grab;
}
.equipe-nom {
    flex: 1;
    font-weight: 500;
    color: #f4f0e6;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    background: rgba(244, 240, 230, 0.06);
    border: 1px solid rgba(244, 240, 230, 0.18);
    color: rgba(244, 240, 230, 0.8);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.icon-btn:hover {
    color: #ea1a15;
    border-color: #ea1a15;
    background: rgba(234, 26, 21, 0.1);
}

/* Poules */

.poules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.poule-card {
    background: rgba(244, 240, 230, 0.05);
    border: 1px solid rgba(239, 167, 7, 0.3);
    border-radius: 12px;
    padding: 1rem;
}
.poule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.12);
}
.poule-nom {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.poule-terrain {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: rgba(244, 240, 230, 0.7);
}
.poule-equipes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.4rem;
    margin: 0;
    border-radius: 10px;
    border: 1px dashed transparent;
    min-height: 60px;
    transition: background 0.15s, border-color 0.15s;
}
.poule-equipe-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(244, 240, 230, 0.04);
    border: 1px solid rgba(244, 240, 230, 0.1);
    border-radius: 8px;
    font-size: 0.88rem;
}
.poule-equipe-item .tournoi-input--mini {
    width: 3rem;
}
.poule-empty {
    color: rgba(244, 240, 230, 0.4);
    font-style: italic;
    font-size: 0.82rem;
    text-align: center;
    padding: 0.5rem;
    margin: 0;
}

/* Matchs admin */

.phase-section {
    margin-top: 1.5rem;
}
.phase-section:first-of-type {
    margin-top: 0;
}
.phase-section-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #f4c941;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(244, 201, 65, 0.25);
}
.phase-section--finale .phase-section-title {
    color: #efa707;
    border-bottom-color: rgba(239, 167, 7, 0.4);
}

.bracket-card {
    background: rgba(244, 240, 230, 0.04);
    border: 1px solid rgba(239, 167, 7, 0.25);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.bracket-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #efa707;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(239, 167, 7, 0.15);
}
.bracket-done {
    text-align: center;
    color: #f4c941;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

/* Drag & drop pour réordonner les matchs de poule */
.match-item--draggable {
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s, opacity 0.1s, border-color 0.15s;
}
.match-item--draggable:active {
    cursor: grabbing;
}
.match-item--draggable.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}
.match-item--draggable.drop-target {
    border-color: rgba(244, 201, 65, 0.7);
    border-style: dashed;
    box-shadow: 0 0 0 2px rgba(244, 201, 65, 0.2);
}
.match-drag-handle {
    color: rgba(244, 240, 230, 0.35);
    margin-right: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: -1px;
    cursor: grab;
}

/* Durée d'un match (chrono dans le header de chaque carte) */
.match-duree {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: rgba(244, 240, 230, 0.7);
    background: rgba(244, 240, 230, 0.08);
    border: 1px solid rgba(244, 240, 230, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.match-duree--live {
    color: #ea1a15;
    background: rgba(234, 26, 21, 0.12);
    border-color: rgba(234, 26, 21, 0.4);
    animation: pulse-chrono 1.5s ease-in-out infinite;
}
@keyframes pulse-chrono {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* Stats durées (section dédiée) */
.durees-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.durees-stat {
    background: rgba(244, 201, 65, 0.08);
    border: 1px solid rgba(244, 201, 65, 0.25);
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.durees-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(244, 240, 230, 0.55);
    font-weight: 700;
}
.durees-stat-value {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

/* Classements de poule côté admin */
.classements-poules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.classement-poule-card {
    background: rgba(244, 240, 230, 0.05);
    border: 1px solid rgba(239, 167, 7, 0.3);
    border-radius: 12px;
    padding: 1rem;
}
.classement-poule-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.1);
}

.format-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: rgba(244, 201, 65, 0.08);
    border: 1px solid rgba(244, 201, 65, 0.3);
    border-radius: 10px;
}
.format-banner-label {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}
.format-banner-example {
    color: rgba(244, 240, 230, 0.7);
    font-size: 0.85rem;
    font-style: italic;
}

.terrain-section {
    margin-bottom: 1.5rem;
}
.terrain-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    color: #f4f0e6;
    font-size: 1rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(244, 240, 230, 0.15);
}

.matchs-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.match-item {
    background: rgba(244, 240, 230, 0.05);
    border: 1px solid rgba(244, 240, 230, 0.12);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.match-item--en_cours {
    border-color: #ea1a15;
    background: rgba(234, 26, 21, 0.08);
    box-shadow: 0 0 20px rgba(234, 26, 21, 0.15);
}
.match-item--termine {
    opacity: 0.65;
}
.match-item--pending-dep {
    opacity: 0.55;
    border-style: dashed;
}

.match-equipe--placeholder {
    font-style: italic;
    color: rgba(244, 201, 65, 0.7);
    font-family: 'Turret Road', sans-serif;
    letter-spacing: 0.05em;
}

.match-dep-hint {
    font-size: 0.8rem;
    color: rgba(244, 240, 230, 0.5);
    font-style: italic;
}

.match-header {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.match-meta {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(244, 240, 230, 0.55);
    font-weight: 600;
}
.match-format-tag {
    font-size: 0.68rem;
    color: #f4c941;
    font-weight: 700;
    background: rgba(244, 201, 65, 0.1);
    border: 1px solid rgba(244, 201, 65, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.match-terrain-select {
    font-size: 0.78rem !important;
    padding: 0.25rem 0.4rem !important;
    width: auto !important;
    min-width: 70px;
}

/* Drag & drop des équipes en phase finale */
.match-equipe--draggable {
    cursor: grab;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    border: 1px dashed transparent;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.1s;
}
.match-equipe--draggable:hover {
    background: rgba(244, 201, 65, 0.08);
    border-color: rgba(244, 201, 65, 0.3);
}
.match-equipe--draggable:active {
    cursor: grabbing;
}
.match-equipe--draggable.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}
.match-equipe--draggable.drop-target {
    background: rgba(244, 201, 65, 0.18);
    border-color: rgba(244, 201, 65, 0.7);
    border-style: solid;
}
.match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.match-equipe {
    font-weight: 600;
    color: #f4f0e6;
}
.match-equipe:last-child { text-align: right; }
.match-vs {
    color: rgba(244, 240, 230, 0.5);
    font-weight: 700;
    font-size: 0.85rem;
}

.match-score-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.score-input {
    width: 60px;
    text-align: center;
    background: rgba(244, 240, 230, 0.14) !important;
    border: 1px solid rgba(244, 240, 230, 0.3) !important;
    border-radius: 6px !important;
    padding: 0.35rem !important;
    font-weight: 700;
    font-size: 1rem;
    color: #f4c941 !important;
}

/* Grille multi-sets (Set 1, Set 2, Super TB...) */
.sets-grid {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.set-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.set-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(244, 240, 230, 0.55);
    font-weight: 700;
}
.set-pair {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.set-sep {
    color: rgba(244, 240, 230, 0.4);
    font-weight: 700;
}
.score-input--set {
    width: 48px;
    font-size: 0.95rem;
    padding: 0.3rem !important;
}
.score-input--set::-webkit-inner-spin-button,
.score-input--set::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.match-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}

.tournoi-empty {
    color: rgba(244, 240, 230, 0.5);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* ===== CLIENT (vue publique) ===== */

.tournoi-live-wrap {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tournoi-live-header {
    text-align: center;
    margin-bottom: 2rem;
}
.tournoi-live-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    color: #f4c941;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.tournoi-live-subtitle {
    font-size: 1rem;
    color: rgba(244, 240, 230, 0.7);
}

.live-section-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #efa707;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}
.live-section-title--live {
    color: #ea1a15;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-matchs-section {
    margin-bottom: 2rem;
}
.live-matchs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    justify-content: center;
}

.live-match {
    position: relative;
    background: rgba(234, 26, 21, 0.1);
    border: 2px solid #ea1a15;
    border-radius: 16px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 8px 30px rgba(234, 26, 21, 0.2);
}
.live-match-meta {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(244, 240, 230, 0.7);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.live-match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.live-match-equipe {
    font-weight: 700;
    color: #f4f0e6;
    font-size: 1.1rem;
}
.live-match-equipe:last-child { text-align: right; }
.live-match-equipe--placeholder,
.match-mini-equipe--placeholder {
    font-style: italic;
    color: rgba(244, 201, 65, 0.7);
    font-family: 'Turret Road', sans-serif;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.live-match-score {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.live-match-score .score-sep {
    color: rgba(244, 240, 230, 0.4);
    font-size: 1.2rem;
}

.live-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #ea1a15;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.live-pulse {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: live-pulse 1s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.terrains-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.terrain-card {
    background: rgba(244, 240, 230, 0.06);
    border: 1px solid rgba(244, 240, 230, 0.15);
    border-radius: 14px;
    padding: 1.25rem;
}
.terrain-card-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.12);
    display: block;
}
.terrain-card-title--link {
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.terrain-card-title--link:hover {
    color: #efa707;
    border-bottom-color: rgba(239, 167, 7, 0.4);
}
.terrain-subsection {
    margin-bottom: 1rem;
}
.terrain-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(244, 240, 230, 0.55);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.matchs-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-mini {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: rgba(244, 240, 230, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}
.match-mini-equipe {
    color: #f4f0e6;
    font-weight: 500;
}
.match-mini-equipe:last-child { text-align: right; }
.match-mini-equipe.vainqueur {
    color: #f4c941;
    font-weight: 700;
}
.match-mini-vs {
    color: rgba(244, 240, 230, 0.4);
    font-size: 0.75rem;
}
.match-mini-score {
    font-family: 'Turret Road', sans-serif;
    color: #efa707;
    font-weight: 700;
}

.live-empty-mini {
    color: rgba(244, 240, 230, 0.45);
    font-style: italic;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
}

/* Classement final (admin + client) */
.classement-final-card,
.classement-final-live {
    background: rgba(244, 201, 65, 0.06);
    border: 1px solid rgba(244, 201, 65, 0.3);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.classement-final-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.classement-final-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.08);
}
.classement-final-table tr:last-child td {
    border-bottom: none;
}
.place-rank {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #efa707;
    width: 90px;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}
.place-row:nth-child(1) .place-rank,
.place-row:nth-child(2) .place-rank,
.place-row:nth-child(3) .place-rank {
    color: #f4c941;
    font-size: 1.05rem;
}
.place-equipe {
    color: #f4f0e6;
    font-weight: 600;
    font-size: 0.95rem;
}
.place-row--pending .place-equipe {
    color: rgba(244, 240, 230, 0.4);
    font-style: italic;
    font-weight: 400;
}

/* Bouton "Partager" sur la vue client */
.tournoi-live-share {
    margin-top: 0.75rem;
    background: rgba(244, 201, 65, 0.15);
    border: 1px solid rgba(244, 201, 65, 0.4);
    color: #f4c941;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.15s;
}
.tournoi-live-share:hover {
    background: rgba(244, 201, 65, 0.25);
    border-color: #f4c941;
}

/* Historique des tournois clôturés (vue client) */
.historique-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(244, 240, 230, 0.12);
}
.historique-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.8rem;
}
.historique-card {
    background: rgba(244, 240, 230, 0.05);
    border: 1px solid rgba(244, 240, 230, 0.12);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.historique-card:hover {
    background: rgba(244, 201, 65, 0.08);
    border-color: rgba(244, 201, 65, 0.4);
    transform: translateY(-2px);
}
.historique-card-nom {
    font-weight: 700;
    color: #f4f0e6;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}
.historique-card-meta {
    font-size: 0.82rem;
    color: rgba(244, 240, 230, 0.6);
}
.historique-back {
    display: inline-block;
    color: rgba(244, 240, 230, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(244, 240, 230, 0.15);
}
.historique-back:hover {
    color: #f4c941;
    border-color: rgba(244, 201, 65, 0.4);
}

/* Badge "Clôturé" dans le header admin */
.readonly-badge {
    color: #f4c941;
    background: rgba(244, 201, 65, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

/* Phase finale live */

.finale-live-section {
    margin-bottom: 2rem;
}
.bracket-live-card {
    background: rgba(239, 167, 7, 0.06);
    border: 1px solid rgba(239, 167, 7, 0.3);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.bracket-live-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #efa707;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(239, 167, 7, 0.2);
}

/* Poules live */

.poules-live-section {
    margin-bottom: 2rem;
}
.poules-live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    justify-content: center;
}
.poule-live-card {
    background: rgba(244, 240, 230, 0.06);
    border: 1px solid rgba(239, 167, 7, 0.25);
    border-radius: 12px;
    padding: 1rem;
}
.poule-live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(244, 240, 230, 0.12);
}
.poule-live-nom {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.poule-live-terrain {
    font-size: 0.75rem;
    color: rgba(244, 240, 230, 0.6);
    font-weight: 600;
}

.poule-live-table {
    width: 100%;
    border-collapse: collapse;
}
.poule-live-table th,
.poule-live-table td {
    padding: 0.4rem 0.3rem;
    font-size: 0.88rem;
    color: #f4f0e6;
}
.poule-live-thead th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(244, 240, 230, 0.45);
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(244, 240, 230, 0.1);
    padding-bottom: 0.5rem;
}
.poule-live-thead th:nth-child(2) {
    text-align: left;
}
.poule-pos {
    color: #efa707;
    font-weight: 700;
    width: 32px;
    font-family: 'Turret Road', sans-serif;
}
.poule-eq {
    width: auto;
}
.poule-stat {
    text-align: center;
    color: rgba(244, 240, 230, 0.85);
    font-variant-numeric: tabular-nums;
    width: 36px;
}
.poule-stat--v {
    color: #f4c941;
    font-weight: 700;
}
.poule-qualif {
    color: #f4c941;
    font-weight: 700;
    text-align: right;
    width: 30px;
}

/* Badges classement dans la vue admin poules */
.poule-pos-badge {
    color: #efa707;
    font-weight: 700;
    font-family: 'Turret Road', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    background: rgba(239, 167, 7, 0.12);
    border-radius: 6px;
}
.poule-stats {
    font-size: 0.78rem;
    color: rgba(244, 240, 230, 0.55);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

/* Widget points FFT (J1 + J2 + badge poids) */
.fft-points-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.fft-points-input {
    width: 4rem !important;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem !important;
    padding: 0.3rem !important;
}
.fft-points-input::-webkit-inner-spin-button,
.fft-points-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.fft-poids-badge {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    background: rgba(244, 201, 65, 0.12);
    border: 1px solid rgba(244, 201, 65, 0.3);
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    min-width: 2.2rem;
    text-align: center;
}

/* Input niveau d'équipe (1-10) */
.niveau-input {
    width: 3.2rem;
    text-align: center;
    font-weight: 700;
    color: #f4c941;
    font-family: 'Turret Road', sans-serif;
    background: rgba(244, 201, 65, 0.08) !important;
    border-color: rgba(244, 201, 65, 0.3) !important;
}
.niveau-input:focus {
    border-color: #f4c941 !important;
    outline: none;
}
.niveau-input::-webkit-inner-spin-button,
.niveau-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* État vide */
.live-empty {
    text-align: center;
    padding: 4rem 1rem;
}
.live-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.live-empty-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 800;
    color: #f4c941;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.live-empty-text {
    color: rgba(244, 240, 230, 0.6);
    font-size: 0.95rem;
}

/* ===== Switcher Chrono / Tournoi (admin) ===== */

.admin-switcher {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem;
    background: rgba(244, 240, 230, 0.06);
    border: 1px solid rgba(244, 240, 230, 0.15);
    border-radius: 12px;
    margin: 0 auto 1rem;
    width: fit-content;
}
.admin-switcher button {
    background: transparent;
    border: 0;
    color: rgba(244, 240, 230, 0.6);
    font-family: 'Kanit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
}
.admin-switcher button:hover {
    color: #f4f0e6;
}
.admin-switcher button.active {
    background: #efa707;
    color: #1a1a1a;
}
