#ces-marcadors-container {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
}
.ces-filtre-group {
    margin-bottom: 15px;
}
.ces-filtre-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.ces-select-filtre {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.ces-btn-primary {
    background-color: #9A5790;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

/* PANELL OPERADOR SENSE MODAL */
.ces-modal {
    width: 100%;
    margin-top: 10px;
}
.ces-modal-content {
    background-color: #fff;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
}
.ces-modal-close {
    display: none !important;
}

/* PANTALLA DIGITAL DE JOC DE L'OPERADOR */
.ces-marcador-pantalla {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    background: #222;
    color: #fff;
    padding: 20px 15px;
    border-radius: 6px;
    margin: 15px 0;
}
.ces-equip-box {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.ces-equip-nom {
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 8px;
    min-height: 36px; 
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}
.ces-puntuacio {
    font-size: 48px;
    font-weight: bold;
    color: #ffcc00;
    line-height: 1; 
    margin-top: auto;
    font-family: monospace;
}
.ces-parcials-linia {
    font-size: 14px;
    font-weight: normal;
    color: #3498db;
    margin-top: 6px;
    min-height: 18px;
    text-align: center;
}
.ces-separador-score {
    font-size: 32px;
    color: #fff;
    display: flex;
    align-items: flex-end;
    padding-bottom: 25px;   
}

/* Control de períodes (1a, 2a, 3a, 4a) */
.ces-estat-grup {
    margin-top: 15px;
    margin-bottom: 15px;
}
.ces-estat-grup label {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}
.ces-botons-periodes {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}
.ces-btn-periode {
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}
.ces-btn-periode:hover:not(:disabled) {
    background-color: #d0d0d0;
}
.ces-btn-periode.actiu {
    background-color: #9A5790 !important;
    color: white !important;
    border-color: #7d4373 !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.ces-botons-grup, .ces-fila-basquet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.ces-celda-subbotons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
}
.ces-btn-basquet, .ces-btn-control {
    padding: 12px 5px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    text-align: center;
}
.btn-sumar { background-color: #28a745; }
.btn-restar { background-color: #dc3545; }

.ces-controls-estat-partit {
    margin-top: 15px;
    width: 100%;
}
#ces-btn-finalitzar-partit {
    background-color: #dc3545;
    width: 100%;
    display: block;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#ces-btn-finalitzar-partit:hover { background-color: #bd2130; }

#ces-btn-nou-partit {
    background-color: #28a745;
    width: 100%;
    display: block;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#ces-btn-nou-partit:hover { background-color: #218838; }

.ces-bloquejat {
    opacity: 0.3 !important;
    pointer-events: none !important;
    user-select: none !important;
}
button:disabled, select:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* =========================================================================
   PART 3: CAPÇALERES CENTRADES, LINIES NEGRES I ORDENACIÓ DEFINTIVA
   ========================================================================= */

#ces-public-taula-wrapper {
    width: 100%;
    margin: 25px auto;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #000000;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.ces-taula-publica {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    font-size: 13px;
    text-align: left;
}

/* Textos de la capçalera (th) de la taula completament CENTRATS i fixos */
.ces-taula-publica th {
    background-color: #9A5790;
    color: #ffffff;
    font-weight: bold;
    padding: 10px 8px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: inset 0 -1px 0 #000000;
    text-align: center; 
}

/* Línies de separació de files de color negre sòlid */
.ces-taula-publica td {
    padding: 8px 8px;
    border-bottom: 2px solid #000000;
    color: #444444;
    vertical-align: middle;
}

.ces-taula-publica tbody tr:last-child td {
    border-bottom: none;
}

.ces-taula-publica tbody tr:hover { 
    background-color: #f5f5f5; 
}

.ces-col-data-publica, .ces-col-hora { 
    font-weight: bold; 
    color: #333333; 
}

.ces-col-hora { 
    color: #555555;
    text-align: center; /* Manté l'hora centrada sota la seva capçalera */
}

.ces-col-partit-noms { 
    font-weight: 600; 
    color: #2c3e50; 
}

.ces-txt-vs { 
    color: #999999; 
    font-weight: normal; 
    margin: 0 4px; 
    font-style: italic; 
    font-size: 12px; 
}

/* Columna del marcador completament centrada a joc amb la capçalera */
.ces-col-marcador-bloc {
    white-space: nowrap;
    font-weight: bold;
    font-family: monospace;
    text-align: center;
}

.ces-marcador-groc-text {
    background: #222222;
    color: #ffcc00;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.ces-guio-separador { 
    color: #ffffff; 
    margin: 0 6px; 
    font-weight: normal; 
}

/* Badges d'estat de la cel·la */
.ces-badge-estat {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    text-align: center;
    min-width: 85px;
}

/* Estat actiu en directe -> Fons VERD sòlid i lletres BLANQUES */
.ces-badge-estat.ces-badge-viulive {
    background-color: #28a745 !important;
    color: #ffffff !important;
    border: none;
}

/* Estat "Finalitzat" -> Fons VERMELL sòlid i lletres BLANQUES */
.ces-badge-estat.ces-badge-finalitzat {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border: none;
}

/* ADAPTACIÓ MÒBIL EN BLOCS (SENSE TALLS EN REORDENAR) */
@media screen and (max-width: 768px) {
    #ces-public-taula-wrapper {
        max-height: none;
        border: none;
    }
    .ces-taula-publica, .ces-taula-publica tbody, .ces-taula-publica tr, .ces-taula-publica td {
        display: block;
        width: 100%;
    }
    .ces-taula-publica thead { 
        display: none; 
    }
    .ces-taula-publica tr {
        margin-bottom: 20px;
        border: 2px solid #000000;
        border-radius: 8px;
        padding: 5px 0;
        background: #ffffff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .ces-taula-publica td {
        text-align: left;
        padding: 8px 15px;
        border-bottom: 1px solid #eeeeee;
        position: relative;
        box-sizing: border-box;
    }
    .ces-taula-publica td:last-child { 
        border-bottom: none; 
    }
    
    .ces-taula-publica td::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        color: #777777;
        font-size: 11px;
        text-transform: uppercase;
        margin-bottom: 4px;
        text-align: left;
    }

    .ces-col-partit-noms {
        font-size: 14px;
        line-height: 1.4;
        word-break: break-word;
    }
    .ces-col-marcador-bloc, .ces-col-hora {
        text-align: left; /* Restableix a l'esquerra per a la lectura vertical de mòbil */
    }
    .ces-marcador-groc-text { 
        font-size: 13px; 
        padding: 5px 10px; 
        white-space: normal;
        word-break: break-all;
        display: inline-block;
    }
    .ces-badge-estat {
        margin-top: 2px;
        display: inline-block;
    }
}
