/* Onglet Fiche de score : bulletin de jugement JCI */

.timer-pre { align-content: flex-start; }

.jury-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.jury-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 240px;
    max-width: 400px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.jury-field input {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
}

.jury-field input:focus {
    outline: none;
    border-color: var(--blue);
}

.score-input {
    width: 60px;
    padding: 4px 2px;
    text-align: center;
    border: none;
    border-bottom: 2px solid var(--border-strong);
    background: transparent;
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
}

.score-input:focus {
    outline: none;
    border-bottom-color: var(--blue);
}

/* Masque les flèches des champs numériques */
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.styled-table .total-row {
    background-color: var(--navy);
    color: white;
    font-weight: 700;
}

/* Note supérieure au maximum du critère */
.score-input:invalid {
    color: var(--contre);
    border-bottom-color: var(--contre);
}

.scoresheet-heading {
    margin: 2rem 0 0.8rem;
    color: var(--heading);
}

.scoresheet-table th,
.scoresheet-table td { text-align: center; }

.scoresheet-table .crit-cell,
.scoresheet-table thead tr:first-child th:first-child,
.scoresheet-table td:first-child { text-align: left; }

.side-header { color: white; }
.styled-table th.pour-bg { background-color: var(--pour-fill); }
.styled-table th.contre-bg { background-color: var(--contre-fill); }

.captain-name {
    display: block;
    margin-top: 0.15rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.speaker-header {
    font-size: 0.8rem;
    white-space: nowrap;
}

.crit-cell { min-width: 220px; }
.crit-max { color: var(--text-muted); font-weight: 600; }

.crit-desc {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.speaker-name-input {
    width: 100%;
    min-width: 70px;
    padding: 0.3rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 0.85rem;
    text-align: center;
}

.speaker-name-input:focus {
    outline: none;
    border: 1px solid var(--blue);
}

.styled-table .subtotal-row td {
    font-weight: 700;
    color: var(--heading);
    white-space: nowrap;
}

.scoresheet-table .total-row td {
    font-size: 1.1rem;
    white-space: nowrap;
}

.side-switch { display: none; }

.winner-banner {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--highlight);
    border: 1px solid var(--highlight-border);
    color: var(--heading);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
}

/* Téléphone */
@media (max-width: 768px) {
    /* Bulletin : descriptions masquées, défilement horizontal avec la colonne Critère figée à gauche */
    .crit-desc { display: none; }
    .crit-cell { min-width: 120px; }
    .styled-table th,
    .styled-table td { padding: 0.6rem 0.5rem; }
    .score-input { width: 44px; }
    .scoresheet-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--card);
    }
    .scoresheet-table tbody tr:nth-child(even) td:first-child { background: var(--surface); }

    /* Notes des orateurs : un seul camp affiché, choisi par les boutons ou un glissement horizontal */
    #scoresheet .card { padding: 0.4rem; }
    .scoresheet-table tfoot td:first-child { white-space: normal; }
    .scoresheet-table .total-row td { font-size: 1rem; }
    .speaker-name-input { min-width: 0; }
    .speaker-header { white-space: normal; }

    #scoresheet[data-visible-side="pour"] .col-contre,
    #scoresheet[data-visible-side="contre"] .col-pour { display: none; }

    .side-switch {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .side-switch-btn {
        padding: 0.6rem 0.4rem;
        background: var(--card);
        font-size: 0.85rem;
        border: 2px solid currentColor;
    }

    .side-switch-btn.pour-btn { color: var(--pour); }
    .side-switch-btn.contre-btn { color: var(--contre); }
    .side-switch-btn.active { color: white; }
    .side-switch-btn.pour-btn.active { background: var(--pour-fill); border-color: var(--pour-fill); }
    .side-switch-btn.contre-btn.active { background: var(--contre-fill); border-color: var(--contre-fill); }
    .scoresheet-table .total-row td:first-child { background: var(--navy); }
}
