/* ==========================================================================
   CORE — SCORE TABLE
   Composant réutilisable : saisie de scores fin de partie
   Deux modes : cards (une carte par joueur) ↔ tableau (grille)
   ========================================================================== */

/* ---- Barre de contrôle (toggle + titre) ---- */
.sct-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sct-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: var(--font);
}
.sct-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}
.sct-toggle i { font-size: 0.9rem; }

/* Bouton pivot orientation (affiché uniquement en mode tableau) */
.sct-orient {
    margin-left: auto;  /* pousse à droite dans la toolbar */
}


/* ================================================================
   MODE CARDS (défaut)
   ================================================================ */

.sct-cards { display: flex; flex-direction: column; gap: 0; }

.sct-player-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 5px solid var(--sct-player-color, var(--accent));
    box-shadow: var(--shadow);
}

.sct-player-header {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sct-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.sct-field-group { display: flex; flex-direction: column; gap: 0.3rem; }

.sct-field-label {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sct-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.4rem;
    color: var(--text-primary);
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
    transition: var(--transition);
    font-family: var(--font);
}
.sct-input:focus {
    border-color: var(--accent);
    outline: none;
    background: var(--bg-primary);
}

.sct-total-badge {
    grid-column: span 2;
    background: var(--accent);
    color: white;
    text-align: center;
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    font-weight: 900;
    font-size: 1.15rem;
    margin-top: 0.25rem;
}


/* ================================================================
   MODE TABLEAU — orientation A : joueurs en colonnes, champs en lignes
   (≤ 5 champs)
   ================================================================ */

.sct-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.sct-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    font-size: 0.85rem;
    min-width: 280px;
}

/* En-têtes colonnes joueurs */
.sct-table thead th {
    padding: 0.6rem 0.5rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--bg-primary);
    white-space: nowrap;
}
.sct-table thead th:first-child {
    text-align: left;
    padding-left: 0.75rem;
    min-width: 110px;
}

/* Ligne de champ */
.sct-table tbody tr {
    border-bottom: 1px solid var(--bg-tertiary);
}
.sct-table tbody tr:last-child { border-bottom: none; }
.sct-table tbody tr:nth-child(even) { background: var(--bg-primary); }

/* Cellule label */
.sct-table tbody td.sct-row-label {
    padding: 0.45rem 0.5rem 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Cellule input */
.sct-table tbody td.sct-row-cell {
    padding: 0.3rem 0.4rem;
    text-align: center;
    vertical-align: middle;
}
.sct-table tbody td.sct-row-cell .sct-input {
    max-width: 70px;
    margin: 0 auto;
    padding: 0.4rem 0.3rem;
    font-size: 0.95rem;
}

/* Ligne TOTAL */
.sct-table tfoot tr { background: var(--bg-tertiary); }
.sct-table tfoot td {
    padding: 0.6rem 0.5rem;
    font-weight: 900;
    text-align: center;
    font-size: 1rem;
    border-top: 2px solid var(--bg-primary);
}
.sct-table tfoot td:first-child {
    text-align: left;
    padding-left: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.sct-table tfoot td.sct-col-total {
    /* couleur injectée inline par le JS */
    font-size: 1.05rem;
}


/* ================================================================
   MODE TABLEAU — orientation B : champs en colonnes, joueurs en lignes
   (> 5 champs — même structure HTML mais classes différentes)
   ================================================================ */

.sct-table.sct-transposed thead th {
    font-size: 0.72rem;
    padding: 0.5rem 0.35rem;
}
.sct-table.sct-transposed tbody td.sct-row-label {
    /* Colonne joueur à gauche */
    display: table-cell;
    min-width: 90px;
    padding-left: 0.6rem;
    font-size: 0.85rem;
    font-weight: 800;
}
.sct-table.sct-transposed tbody td.sct-row-cell .sct-input {
    max-width: 56px;
    font-size: 0.88rem;
    padding: 0.35rem 0.2rem;
}
.sct-table.sct-transposed tfoot td {
    font-size: 0.9rem;
}


/* ================================================================
   RANKING (commun aux deux modes)
   ================================================================ */

.sct-ranking { margin-top: 1rem; }