/* ========== Comportement tactile mobile ========== */
html,
body {
    margin: 0;
    /* padding: 20px; */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom right, #6fb1fc, #4364f7);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-x: hidden;
    width: 100%;
}

/* Styles pour modal */
.modal {
    display: none;
    /* caché par défaut */
    position: fixed;
    z-index: 1000;
    /* devant tout */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* scroll si besoin */
    background-color: rgba(0, 0, 0, 0.5);
    /* fond sombre transparent */
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    /* centré verticalement */
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

.modal-content p {
    color: black;
}

/* ========== Titres ========== */
h1 {
    text-align: center;
    color: white;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.tableStat {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
}

.tableStat thead {
    background-color: #E6C900;
    color: white;
    font-size: 0.9rem;
    text-align: center;
}

.tableStat th, .tableStat td {
    padding: 12px 8px;
    text-align: center;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

.tableStat tr:last-child td {
    border-bottom: none;
}

.tableStat tbody tr:nth-child(even) {
    background-color: #f1f7ff;
}

/* @media screen and (max-width: 600px) {
    .tableStat thead {
        display: none;
    }

    .tableStat, .tableStat tbody, .tableStat tr, .tableStat td {
        display: block;
        width: 100%;
    }

    .tableStat tr {
        margin-bottom: 16px;
        background-color: white;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
        border-radius: 8px;
        padding: 12px;
    }

    .tableStat td {
        text-align: left;
        padding: 8px 12px;
        position: relative;
    }

    .tableStat td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #555;
        display: block;
        margin-bottom: 4px;
    }
} */

/* ========== Conteneurs principaux ========== */
form,
#regle,
#contenu,
#divFin {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 90%;
    margin: 20px auto;
    box-sizing: border-box;
}

#corps{
    padding:20px;
    display:flex;
    flex-direction:column;
    align-items: center;
}

#entete {
    width: 90%;    
    margin:5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

#divScoreActuel{
    display:flex;
    align-content: center;
  align-items: center;
  justify-content: space-evenly;
}

#divScoreActuel label{
    color:black;
    margin:5px;
}

#entete p,
#entete label, 
#divScoreActuel label
 {
    color:black;
}

/* ========== Champs de saisie ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
.pseudo,
select {
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    box-sizing: border-box;
    font-size: 1rem;
}

select {
    background-color: white;
    height: 40px;
    width: 100%;
}

/* ========== Labels ========== */
label {
    margin-bottom: 0.5rem;
    font-weight: bold;
    /* color: white; */
    display: block;
}

ul {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

/* ========== Style des boutons ========== */
button,
.buttonScore,
.buttonMode {
    width: 100%;
    padding: 1rem;
    background-color: #f1c40f;
    color: black;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 1rem;
}

button:hover,
.buttonScore:hover,
.buttonMode:hover {
    background-color: #d4ac0d;
}

.buttonScore,
.buttonMode {
    width: auto;
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
}

.buttonMode.active {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.5);
}

.buttonMode:active {
    transform: translateY(2px);
    box-shadow: none;
}

.buttonMini {
    background-color: #eee;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9em;
    margin: 5px 8px 0 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width:100px;
}

.buttonMini:hover {
    background-color: #ddd;
}

/* ========== Saisie score ========== */
.saisie {
    display: inline-block;
    width: 40px;
    height: 30px;
    border: 2px solid #007BFF;
    border-radius: 5px;
    background-color: #E6F0FF;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.6);
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    color: #007BFF;
    font-size: 16px;
}

/* ========== Textes généraux ========== */
p {
    text-align: center;
    margin-top: 1rem;
    color: white;
}

a {
    color: #ffd700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== Tableaux ========== */
#entete table,
#tableScore {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#entete table td,
#tableScore td,
#tableScore th {
    padding: 1px;
    border: 1px solid #ccc;
    text-align: center;
}

#entete table td:first-child,
#tableScore td:first-child,
#tableScore th:first-child {
    width: 80px;
}

/* ========== Étiquettes et objectifs ========== */
label.resultat,
label.total {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.5rem;
}

label.saisie {
    font-weight: bold;
    color: #e67e22;
}

.objectif {
    background-color: #f9f9f9;
    font-weight: bold;
    font-size: 1.5rem;
}

/* ========== Divers ========== */
.hide {
    display: none;
}

#scorePossible {
    text-align: center;
    flex: 6;
}

#divScore {
    /* margin-top: 30px; */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#divCancel {
    flex: 1;
}

.flexColumn {
    display: flex;
    flex-direction: column;
}

/* ========== Responsive mobile ========== */
@media (max-width: 480px) {

    form,
    #entete,
    #regle,
    #contenu,
    #divFin {
        padding: 1.2rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    button,
    .buttonScore,
    .buttonMode {
        font-size: 2rem;
        padding: 0.8rem 1rem;
    }

    .buttonGeneral {
        font-size: 1rem;
        padding: 0.8rem 1rem;
        width: auto;
    }

    .objectif,
    label.resultat,
    label.total {
        font-size: 1.2rem;
    }

    input.pseudo,
    input#nbJrs {
        width: 100% !important;
    }

    #scorePossible,
    #divCancel {
        flex: 100%;
        margin-top: 1rem;
        text-align: center;
    }

    #divCancel button {
        width: 60px;
        /* height: 60px; */
        font-size: 1.2rem;
    }

    #tableScore,
    #tableJoueurs {
        font-size: 0.9rem;
        overflow-x: auto;
    }
}

/* Pour les très petits écrans */
@media (max-width: 360px) {
  #scorePossible {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 6px;
  }

  .buttonScore {
    font-size: 1rem;
    padding: 0.6rem 0;
  }
}

/* Pour les téléphones ultra étroits (moins de 300px) */
@media (max-width: 300px) {
  #scorePossible {
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
  }
}

.columnFlex{
    display:flex; 
    flex-direction:column;
}

.rowFlex{
    display:flex; 
    flex-direction:row;
}

.lb_pseudo,
.lb_score{
    background-color: black;
}