.logo-area h1 { font-size: 2em!important; }
/* On reprend la base de la Belote mais on change le tapis */
#game-container { position: relative; width: 1000px; height: 700px; background: radial-gradient(circle, #27ae60 0%, #145a32 100%); border: 8px solid #ecf0f1; border-radius: 20px; box-shadow: 0 0 50px #000; }

/* Zone centrale : Une seule pile */
.table-center { 
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 400px;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Les cartes jouées s'empilent ici */
.pile-card { 
    position: absolute; 
    transition: all 0.3s; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
    transform-origin: center center;
}

/* CARTES ENSEVELIES (Anciens plis de la pile) */
.buried-card {
    filter: brightness(0.5) grayscale(0.4); /* Plus sombre et gris */
    z-index: 1; /* Toujours en dessous */
}

/* CARTES DU DESSUS (Dernier coup joué) */
.top-card {
    filter: brightness(1.1); /* Un peu plus lumineux */
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); /* Grosse ombre pour détacher */
    border: 1px solid rgba(255,255,255,0.5); /* Petit contour blanc subtil */
    z-index: 100; /* Toujours au dessus */
}

/* Joueurs */
.player-label { position: absolute; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.7); padding: 5px 15px; border-radius: 30px; color: white; border: 2px solid transparent; transition: all 0.3s; }
.player-label {
    transition: opacity 0.3s;
}

/* Seuls ceux qui ont passé deviennent transparents */
.player-label.is-passed {
    opacity: 0.4;
    filter: grayscale(100%); /* Optionnel : rend gris */
}

/* On s'assure que jouer ne change pas l'opacité */
.player-label.has-played {
    opacity: 1; 
    filter: none;
}

.player-label.active-turn {
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.6);
    background: rgba(44, 62, 80, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 60;
}

/* Couleurs d'équipe / Avatar (Cosmétique) */
.player-label[data-slot="0"] .player-avatar { background: #3498db; } /* Bleu */
.player-label[data-slot="1"] .player-avatar { background: #e74c3c; } /* Rouge */
.player-label[data-slot="2"] .player-avatar { background: #2ecc71; } /* Vert */
.player-label[data-slot="3"] .player-avatar { background: #9b59b6; } /* Violet */
.player-label[data-slot="4"] .player-avatar { background: #f1c40f; } /* Jaune */
.player-label[data-slot="5"] .player-avatar { background: #e67e22; } /* Orange */
.player-label[data-slot="6"] .player-avatar { background: #1abc9c; } /* Turquoise */
.player-label[data-slot="7"] .player-avatar { background: #7f8c8d; } /* Gris */

/* Rôles (Icônes dans le nom) */
.role-icon { font-size: 1.2em; margin-right: 4px; }

/* Icône Couronne (pour le président) */
.crown-icon {
    position: absolute;
    top: -20px;
    right: -5px;
    font-size: 1.4em;
    color: #f1c40f;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.8));
    animation: bounce 2s infinite;
    z-index: 65;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }


/* --- MAIN DU JOUEUR (MY HAND) --- */
#my-hand { 
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: flex-end;
    height: 130px;
}
.card { 
    width: 80px;
    height: 120px;
    margin-left: -15px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2); 
    z-index: 10;
}
.card:first-child { margin-left: 0; }

.card:hover { 
    transform: translateY(-20px); 
}

.card.selected { 
    transform: translateY(-30px); 
    border: 3px solid #3498db; 
    z-index: 5; 
}

/* Structure carte */
.card-corner { position: absolute; font-weight: bold; font-size: 1.2em; display: flex; flex-direction: column; align-items: center; line-height: 0.8; padding: 4px; }
.top-left { top: 2px; left: 2px; }
.bottom-right { bottom: 2px; right: 2px; transform: rotate(180deg); }
.card-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3em; }

/* Contrôles de jeu (Boutons) */
#game-controls {
    position: absolute; bottom: 240px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 15px; z-index: 50;
}
.btn-action { padding: 10px 25px; font-size: 1.1em; border-radius: 25px; border: none; cursor: pointer; font-weight: bold; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: transform 0.1s; }
.btn-action:active { transform: scale(0.95); }
.btn-play { background: #2ecc71; color: white; }
.btn-pass { background: #e74c3c; color: white; }
.btn-disabled { background: #95a5a6; cursor: not-allowed; opacity: 0.7; }

/* Message central (ex: "Révolution !") */
#center-message {
    position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
    font-size: 3em; font-weight: bold; color: #f1c40f; text-shadow: 0 5px 10px black;
    pointer-events: none; z-index: 200; opacity: 0; transition: opacity 0.5s;
}

/* Échange de cartes */
#exchange-panel {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9); padding: 20px; border-radius: 10px; text-align: center; color: white;
    z-index: 100; display: none; border: 2px solid #f1c40f;
}

/* Les cartes jouées s'empilent ici */
.pile-card { 
    position: absolute; 
    transition: all 0.3s; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
    /* Important pour que le z-index JS fonctionne bien */
    transform-origin: center center;
}

/* Animation quand le pli est fini (lastTrick) */
.fading-pile {
    opacity: 0.7;
    filter: grayscale(0.5);
    transition: opacity 0.5s;
}

/* --- MODALE DE SCORE (FIN DE MANCHE) --- */

#score-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Fond sombre semi-transparent */
    display: none; /* Caché par défaut */
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Au-dessus de tout */
    backdrop-filter: blur(5px); /* Effet de flou sur l'arrière-plan */
    animation: fadeIn 0.5s ease-out;
}

#score-content {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(241, 196, 15, 0.2);
    border: 2px solid #f1c40f; /* Bordure dorée */
    overflow: hidden;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
}

/* En-tête */
.score-header {
    background: #f1c40f;
    color: #2c3e50;
    padding: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.score-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 800;
}

/* Corps du tableau */
.score-body {
    padding: 20px;
}

.sb-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sb-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    color: #bdc3c7;
    font-size: 0.9em;
    text-transform: uppercase;
}

.sb-table td {
    padding: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1.1em;
}

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

/* Lignes spécifiques (Rangs) */
.sb-table tr:nth-child(1) td { color: #f1c40f; font-weight: bold; text-shadow: 0 0 10px rgba(241, 196, 15, 0.3); } /* 1er */
.sb-table tr:nth-child(2) td { color: #bdc3c7; font-weight: bold; } /* 2ème */
.sb-table tr:nth-child(3) td { color: #e67e22; } /* 3ème */
.sb-table tr:last-child td { color: #95a5a6; } /* Dernier */

/* Pied de page (Boutons) */
.score-footer {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.score-footer p {
    margin: 0;
    font-style: italic;
    color: #bdc3c7;
    animation: pulse 2s infinite;
}

/* Boutons dans le footer */
.score-footer button {
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
}

.score-footer button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.score-footer .btn-green { background: #27ae60; color: white; }
.score-footer .btn-red { background: #c0392b; color: white; }
.score-footer .btn-blue { background: #2980b9; color: white; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.game-notification {
    height: 30px; /* Hauteur fixe pour éviter que ça décale tout */
    margin-top: 5px;
    text-align: center;
    color: #e74c3c; /* Rouge */
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* Pour cliquer au travers si besoin */
    z-index: 150;
}

.game-notification.visible {
    opacity: 1;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- ADAPTATION MOBILE (RESPONSIVE) --- */
@media (max-width: 900px) {

    .game-notification {
        position: relative;
        top: 125px;
    }
    #revolution-banner {
        top: 115px !important;
        width: 60%;
        text-align: center;
    }
    
    #screen-game {
        padding-top: 35px;
        height: 90vh;
    }
    #game-container {
        width: 98vw;
        height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: radial-gradient(circle, #27ae60 0%, #145a32 100%);
    }

    .table-center {
        width: 310px;
        height: 200px;
        top: 45%;
    }

    .card {
        width: 55px;
        height: 85px;
        border-radius: 6px;
    }
    
    .card-corner { font-size: 0.8em; padding: 2px; }
    .card-center { font-size: 1.8em; }
    
    .pile-card {
        transform-origin: center center;
    }

    #my-hand {
        width: 100%;
        height: 180px;
        flex-wrap: wrap;
        bottom: 0;
        z-index: 20;
        gap: 0;
        justify-content: center;
        align-items: center;
    }

    #my-hand .card {
        flex-shrink: 0;
        margin-left: -15px;
    }
    
    #my-hand .card:first-child { margin-left: 0; }
    
    #my-hand .card:hover, #my-hand .card.selected {
        transform: translateY(-15px);
    }

    .player-label {
        padding: 4px;
        font-size: 0.8em;
        background: rgba(0,0,0,0.6);
        gap: 5px;
    }
    
    .player-avatar {
        width: 25px; height: 25px; font-size: 0.9em; line-height: 25px;
    }


    /* 6. CONTRÔLES DE JEU */
    #game-controls {
        bottom: 225px;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .btn-action {
        padding: 8px 20px;
        font-size: 0.9em;
    }
    button {
        margin-top: unset;
    }

    /* 7. ÉLÉMENTS SECONDAIRES */
    #permanent-scoreboard { display: none !important; } /* Trop gros pour le mobile */
    
    #center-message {
        font-size: 1.5em;
        width: 90%;
        text-align: center;
    }

    /* Modal Score adaptée */
    #score-content {
        width: 95%;
        max-height: 85vh;
        padding: 0;
    }
    .score-body { padding: 10px; }
    .sb-table th, .sb-table td { padding: 5px; font-size: 0.85em; }
    
    /* Bouton retour plus petit */
    .back-link {
        padding: 5px 10px;
        font-size: 0.8em;
        top: 10px;
        left: 10px;
    }
    /* Panel d'échange */
    #exchange-panel {
        width: 90%;
        padding: 15px;
    }
}