body {
    background: #0b5138;
    font-family: "Segoe UI", sans-serif;
    text-align: center;
    color: white;
    margin: 0;
    padding: 0;
}

h1 {
    margin-top: 20px;
    font-size: 2.5rem;
    letter-spacing: 2px;
}

.table {
    margin-top: 30px;
}

.card-row {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.card {
    width: 80px;
    height: 120px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    margin: 0 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    position: relative;
}

.red {
    color: #c61a1a;
}

.black {
    color: #111;
}

/* Glow main active (Non-animé) */
.active-hand {
    box-shadow: 0 0 20px 3px #0ea5a4;
}

/* Le glow dynamique s'applique aux cartes ENFANTS du conteneur .highlight-hand */
.highlight-hand .card {
    animation: glowPulse 1s infinite alternate;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 15px 3px #0ea5a4; }
    100% { box-shadow: 0 0 30px 6px #0ea5a4; }
}

/* Dos de carte */
.card-back {
    background: repeating-linear-gradient(
        45deg,
        #144,
        #144 10px,
        #0d3b3b 10px,
        #0d3b3b 20px
    );
    border: 2px solid #0a2323;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.score {
    font-size: 1.3rem;
    margin-top: 5px;
}

/* Styles de base pour tous les boutons */
.controls button {
    padding: 12px 24px;
    margin: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

/* --- DÉFINITION DES COULEURS PAR ACTION --- */

/* 🟢 HIT (Tirer) */
#btn-hit {
    background: linear-gradient(145deg, #4CAF50, #388E3C);
}
#btn-hit:hover {
    background: linear-gradient(145deg, #66BB6A, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* 🔴 STAND (Rester) */
#btn-stand {
    background: linear-gradient(145deg, #f44336, #d32f2f);
}
#btn-stand:hover {
    background: linear-gradient(145deg, #e57373, #f44336);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* 🔵 DEAL (Distribuer) */
#btn-deal {
    background: linear-gradient(145deg, #2196F3, #1976D2);
}
#btn-deal:hover {
    background: linear-gradient(145deg, #64B5F6, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* 🟡 SPLIT */
#btn-split {
    background: linear-gradient(145deg, #FFC107, #FFA000);
}
#btn-split:hover {
    background: linear-gradient(145deg, #FFD54F, #FFC107);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* Effet général pour les boutons cliqués */
.controls button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Style pour les boutons désactivés (DISABLED) */
.controls button:disabled {
    background: #555;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
    transform: none;
}

/* classe pour cacher les boutons */
.hidden {
    display: none;
}

/* --- RESULTAT VISUEL --- */
#result {
    margin-top: 25px;
    font-weight: bold;
    padding: 10px;
    animation: fadeIn 0.5s ease-out;
}

.split-result-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hand-result-box {
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.5rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.outcome-win {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border: 3px solid #66BB6A;
}

.outcome-lose {
    background: linear-gradient(135deg, #f44336, #B71C1C);
    border: 3px solid #e57373;
}

.outcome-push {
    background: linear-gradient(135deg, #FFC107, #FF8F00);
    border: 3px solid #FFD54F;
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* NOUVELLE RÈGLE : Animation Cercle Radiant de Victoire */
#result.win-splash {
    position: relative;
    overflow: hidden;
}

#result.win-splash::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(168, 255, 51, 0.7);
    transform: translate(-50%, -50%);
    animation: radial-burst 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

/* NOUVELLE KEYFRAMES pour l'effet de cercle */
@keyframes radial-burst {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    50% {
        width: 150%;
        height: 150%;
        opacity: 0.5;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}
