/* --- SUPERPOSITIONS SUR LE JEU (TIMER, ETC.) --- */
#game-overlays {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    pointer-events: none; /* Pour pouvoir cliquer à travers */
}

#timer-display {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.timer-urgent {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#elixir-x2 {
    background-color: #9b59b6;
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: bold;
    display: none; /* Caché par défaut */
}
#elixir-x2.active {
    display: block;
}

/* --- INTERFACE UTILISATEUR (MAIN, ELIXIR) --- */
#ui-container {
    display: flex;
    flex-direction: column-reverse; /* Elixir en bas */
    justify-content: flex-end;
}

#elixir-bar {
    width: 100%;
    height: 45px;
    background: linear-gradient(to top, #111, #222);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-top: 2px solid #555;
    position: relative;
}

#elixir-crystals {
    width: 80%;
    max-width: 320px;
    height: 22px;
    background-color: #000;
    border-radius: 12px;
    border: 2px solid #4a2a51;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.7);
}

.elixir-crystal {
    flex: 1;
    border-right: 1px solid #4a2a51;
    background-color: transparent;
}
.elixir-crystal:last-child { border-right: none; }

#elixir-text {
    position: absolute;
    color: white;
    font-weight: 900;
    font-size: 1.6em;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
    pointer-events: none;
}

#hand-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 15px;
    width: 100%;
    position: relative;
    background: radial-gradient(circle at center, #34495e 0%, #2c3e50 100%);
}

#hand {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: flex-end;
}

.card {
    width: clamp(60px, 16vw, 80px);
    height: clamp(80px, 21vw, 105px);
    border: 2px solid #f1c40f;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #333;
}

.card:hover {
    transform: translateY(-15px) scale(1.1);
    box-shadow: 0 8px 15px rgba(241, 196, 15, 0.4);
    z-index: 10;
}

.card.disabled {
    filter: grayscale(80%);
    cursor: not-allowed;
}

/* Superposition de gradient pour la lisibilité du texte */
.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    pointer-events: none;
}

.card-cost {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #9b59b6;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 1px solid white;
    z-index: 1;
}

.card-level {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 1;
}

.card-name-container {
    margin-top: auto; /* Pousse le nom en bas */
    padding: 5px;
    text-align: center;
    z-index: 1; /* Pour être au-dessus du gradient ::after */
}

.card-name {
    color: white;
    font-weight: bold;
    font-size: 0.8em;
    text-shadow: 1px 1px 2px black;
}

/* Bordures de rareté */
.card.rarity-commune { border-color: #9e9e9e; }
.card.rarity-rare { border-color: #4fc3f7; }
.card.rarity-epique { border-color: #ba68c8; }