:root {
    --uno-red: #ED1C24;
    --uno-yellow: #FFDE00;
    --uno-green: #00B140;
    --uno-blue: #0072CE;
    --uno-black: #231F20;
    --bg-color: #f4f4f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--uno-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px; /* Padding réduit pour mobile */
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.uno-logo {
    background-color: var(--uno-red);
    color: white;
    font-size: 2.5rem; /* Légèrement réduit pour mobile */
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 10px;
    display: inline-block;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-shadow: 2px 2px 0 var(--uno-black);
    transform: rotate(-5deg);
    margin-bottom: 5px;
}

.container {
    background: white;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 5px solid transparent;
}

/* Couleurs des "Cartes" conteneurs */
.card-yellow { border-color: var(--uno-yellow); }
.card-red { border-color: var(--uno-red); }
.card-green { border-color: var(--uno-green); }

h2 {
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5rem;
}

/* Formulaire adapté au mobile */
form {
    display: flex;
    flex-direction: column; /* Superpose l'input et le bouton sur mobile */
    gap: 10px;
    margin-bottom: 15px;
}

@media (min-width: 600px) {
    form {
        flex-direction: row; /* Aligné sur grand écran */
    }
}

input[type="text"], input[type="number"] {
    flex-grow: 1;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 16px; /* 16px STRICT empêche le zoom automatique sur iOS/iPhone */
}

input[type="number"] {
    width: 70px;
    text-align: center;
}

/* Boutons plus gros pour le tactile */
button {
    padding: 15px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    width: 100%; /* Prend toute la largeur par défaut (mobile) */
}

@media (min-width: 600px) {
    button {
        width: auto; /* Taille naturelle sur PC */
    }
}

button:active {
    transform: scale(0.95);
}

button:hover {
    opacity: 0.9;
}

.btn-green { background-color: var(--uno-green); }
.btn-blue { background-color: var(--uno-blue); }
.btn-yellow { background-color: var(--uno-yellow); color: var(--uno-black); }
.btn-black { background-color: var(--uno-black); }

ul {
    list-style: none;
    margin-bottom: 15px;
}

ul li {
    background: #eee;
    margin: 5px 0;
    padding: 12px;
    border-radius: 5px;
    font-weight: bold;
}

/* --- MAGIE RESPONSIVE DU TABLEAU --- */
.table-container {
    overflow-x: auto; /* Active le défilement horizontal */
    -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
    margin-bottom: 20px;
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.15); /* Ombre pour indiquer qu'on peut scroller */
}

table {
    width: 100%;
    border-collapse: separate; /* Requis pour que le position: sticky fonctionne bien */
    border-spacing: 0;
    min-width: max-content; /* Force le tableau à déborder si nécessaire */
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
}

th {
    background-color: var(--uno-black);
    color: white;
    border-top: 1px solid #ddd;
}

/* Geler la première colonne (Les noms) */
th:first-child, td:first-child {
    position: sticky;
    left: 0; /* Colle la colonne à gauche */
    z-index: 2; /* Garde les noms au-dessus des scores qui défilent */
    background-color: white; /* Cache les scores qui passent en dessous */
    font-weight: bold;
    text-align: left;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); /* Petite ombre pour séparer */
    border-left: 1px solid #ddd;
}

th:first-child {
    background-color: var(--uno-black);
    color: white;
    z-index: 3; /* Le coin supérieur gauche doit être au-dessus de tout */
}

/* Action buttons sous le tableau */
.action-buttons {
    display: flex;
    flex-direction: column; /* Superposé sur mobile */
    gap: 15px;
}

@media (min-width: 600px) {
    .action-buttons {
        flex-direction: row; /* Côte à côte sur PC */
        justify-content: space-between;
    }
}

.hidden {
    display: none !important;
}
