/* ==============================================
   HORUS BATTLE ARENA - Dark Dungeon Theme
   Rouge/Noir avec ambiance sombre et mystérieuse
   ============================================== */

/* --- VARIABLES CSS --- */
:root {
    --primary-red: #8b0000;
    --accent-red: #c41e3a;
    --blood-red: #660000;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --dungeon-gray: #1a1a1a;
    --stone-gray: #2d2d2d;
    --text-light: #e0e0e0;
    --text-dim: #888888;
    --gold-accent: #b8860b;
    --parchment: #2a1f1a;
    --parchment-text: #c9a66b;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cinzel', 'Georgia', serif;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 50%, #120808 100%);
    background-attachment: fixed;
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Texture overlay sombre */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* --- TITRE PRINCIPAL --- */
h1 {
    text-align: center;
    font-size: 2rem;
    padding: 20px 15px 15px;
    color: var(--accent-red);
    text-shadow: 
        0 0 8px rgba(196, 30, 58, 0.5),
        0 0 20px rgba(139, 0, 0, 0.3),
        2px 2px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--blood-red);
    margin-bottom: 20px;
    background: linear-gradient(to bottom, transparent, rgba(139, 0, 0, 0.1));
}

h2 {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(196, 30, 58, 0.3);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

h3 {
    color: var(--gold-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- BRAISES FLOTTANTES --- */
.embers-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ember {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ff6b35 0%, #ff4500 50%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    animation: ember-rise 8s ease-in-out infinite;
    box-shadow: 0 0 6px 2px rgba(255, 100, 50, 0.4);
}

.ember:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 7s; }
.ember:nth-child(2) { left: 25%; animation-delay: 1.5s; animation-duration: 9s; }
.ember:nth-child(3) { left: 40%; animation-delay: 0.5s; animation-duration: 6s; }
.ember:nth-child(4) { left: 55%; animation-delay: 3s; animation-duration: 8s; }
.ember:nth-child(5) { left: 70%; animation-delay: 2s; animation-duration: 10s; }
.ember:nth-child(6) { left: 85%; animation-delay: 4s; animation-duration: 7s; }
.ember:nth-child(7) { left: 15%; animation-delay: 5s; animation-duration: 9s; }
.ember:nth-child(8) { left: 60%; animation-delay: 6s; animation-duration: 6s; }

@keyframes ember-rise {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    10% {
        opacity: 0.8;
        transform: translateX(10px) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-15px) scale(0.8);
    }
    90% {
        opacity: 0.3;
        transform: translateX(5px) scale(0.6);
    }
    100% {
        bottom: 100vh;
        opacity: 0;
        transform: translateX(-10px) scale(0.3);
    }
}

/* --- FORME GÉOMÉTRIQUE ABSTRAITE & COMPLEXE --- */
.geometric-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    perspective: 1200px;
    transform-style: preserve-3d;
    z-index: 1;
    transition: transform 0.2s ease-out;
}

/* Base pour tous les anneaux */
.hexagon-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transform-style: preserve-3d;
}

/* Anneau 1 : Grand cercle externe segmenté */
.ring-1 {
    width: 380px;
    height: 380px;
    border: 1px dashed rgba(196, 30, 58, 0.4);
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.1);
    animation: rotate-3d-1 30s linear infinite;
}

/* Anneau 2 : Cercle moyen fin avec lueur */
.ring-2 {
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255, 69, 0, 0.3);
    border-top: 2px solid rgba(255, 69, 0, 0.8);
    border-bottom: 2px solid rgba(255, 69, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.2);
    animation: rotate-3d-2 20s linear infinite reverse;
}

/* Anneau 3 : Cercle interne doré */
.ring-3 {
    width: 180px;
    height: 180px;
    border: 1px dotted rgba(184, 134, 11, 0.6);
    animation: rotate-flat 10s linear infinite;
}

/* Anneau 4 : Grand orbe elliptique incliné */
.ring-4 {
    width: 340px;
    height: 340px;
    border: 1px solid rgba(139, 0, 0, 0.2);
    animation: rotate-orb-1 15s linear infinite;
}

/* Anneau 5 : Petit cercle rapide proche du cœur */
.ring-5 {
    width: 100px;
    height: 100px;
    border-top: 2px solid var(--accent-red);
    border-right: 2px solid transparent;
    border-bottom: 2px solid var(--accent-red);
    border-left: 2px solid transparent;
    animation: rotate-flat 4s linear infinite;
}

/* Particules orbitales */
.orbital-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px var(--accent-red);
}

.p1 { animation: orbit-1 8s linear infinite; }
.p2 { animation: orbit-2 12s linear infinite; }
.p3 { animation: orbit-3 10s linear infinite reverse; }
.p4 { animation: orbit-4 15s linear infinite; background: var(--gold-accent); }

/* Triangles décoratifs */
.triangle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 173px solid rgba(139, 0, 0, 0.05);
    transform-origin: 50% 66%; /* Centre de rotation du triangle */
}

.t1 { animation: rotate-flat 25s linear infinite; border-bottom-color: rgba(196, 30, 58, 0.1); }
.t2 { animation: rotate-flat 35s linear infinite reverse; transform: translate(-50%, -50%) rotate(60deg); border-bottom-color: rgba(184, 134, 11, 0.05); }
.t3 { animation: rotate-flat 45s linear infinite; transform: translate(-50%, -50%) rotate(120deg); }

/* Lignes de connexion */
.connection-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.5), transparent);
    transform-origin: 0% 50%;
}

.l1 { transform: rotate(0deg) translateX(50px); opacity: 0.8; }
.l2 { transform: rotate(90deg) translateX(50px); opacity: 0.8; }
.l3 { transform: rotate(180deg) translateX(50px); opacity: 0.8; }
.l4 { transform: rotate(270deg) translateX(50px); opacity: 0.8; }

/* Cœur central complexe */
.center-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #ff3333 0%, #660000 100%);
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(255, 51, 51, 0.6);
    animation: core-beat 2s ease-in-out infinite;
    z-index: 10;
}

.inner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    filter: blur(5px);
    opacity: 0.8;
    animation: inner-pulse 0.5s ease-in-out infinite alternate;
}

/* --- ANIMATIONS COMPLEXES --- */

@keyframes rotate-flat {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* spin-fast supprimé - identique à rotate-flat */

@keyframes rotate-3d-1 {
    0% { transform: translate(-50%, -50%) rotateX(60deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateX(60deg) rotateZ(360deg); }
}

@keyframes rotate-3d-2 {
    0% { transform: translate(-50%, -50%) rotateY(45deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateY(45deg) rotateZ(360deg); }
}

@keyframes rotate-orb-1 {
    0% { transform: translate(-50%, -50%) rotateX(-30deg) rotateY(30deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateX(-30deg) rotateY(30deg) rotateZ(360deg); }
}

@keyframes orbit-1 {
    0% { transform: translate(-50%, -50%) rotateZ(0deg) translateX(150px) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateZ(360deg) translateX(150px) rotateZ(-360deg); }
}

@keyframes orbit-2 {
    0% { transform: translate(-50%, -50%) rotateX(70deg) rotateZ(0deg) translateX(120px); }
    100% { transform: translate(-50%, -50%) rotateX(70deg) rotateZ(360deg) translateX(120px); }
}

@keyframes orbit-3 {
    0% { transform: translate(-50%, -50%) rotateY(60deg) rotateZ(0deg) translateX(180px); }
    100% { transform: translate(-50%, -50%) rotateY(60deg) rotateZ(360deg) translateX(180px); }
}

@keyframes orbit-4 {
    0% { transform: translate(-50%, -50%) rotateZ(45deg) translateX(200px) scale(0.5); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) rotateZ(225deg) translateX(200px) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) rotateZ(405deg) translateX(200px) scale(0.5); opacity: 0.5; }
}

@keyframes core-beat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 50px rgba(255, 51, 51, 0.6); }
    50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 70px rgba(255, 51, 51, 0.8); }
}

@keyframes inner-pulse {
    from { opacity: 0.5; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* --- MENU PRINCIPAL --- */
.menu-container {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.menu-container form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    width: 220px;
    padding: 14px 30px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    background: linear-gradient(180deg, var(--stone-gray) 0%, var(--dungeon-gray) 100%);
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-btn:hover {
    background: linear-gradient(180deg, var(--primary-red) 0%, var(--blood-red) 100%);
    border-color: var(--accent-red);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(139, 0, 0, 0.4),
        0 0 20px rgba(196, 30, 58, 0.3);
}

.menu-btn:active {
    transform: translateY(0);
}

/* Debug button styling - inline with other menu buttons */
.menu-btn.debug-btn {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border-color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn.debug-btn:hover {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-color: #555;
}

/* --- USER BADGE (Utilisateur connecté) --- */
.user-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(139, 0, 0, 0.3));
    border: 2px solid var(--gold-accent);
    border-radius: 25px;
    padding: 8px 18px;
    color: var(--gold-accent);
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
    z-index: 100;
}

/* --- ACCOUNT LINK STYLE --- */
.account-link {
    display: block;
    text-decoration: none;
    margin-top: 15px;
    background: linear-gradient(180deg, #1a237e 0%, #0d1642 100%) !important;
    border-color: #3949ab !important;
}

.account-link:hover {
    background: linear-gradient(180deg, #283593 0%, #1a237e 100%) !important;
    box-shadow: 0 0 25px rgba(57, 73, 171, 0.5) !important;
}

/* --- MODE CONTAINER --- */
.mode-container {
    text-align: center;
    margin-top: 20px;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    margin-bottom: 15px;
    margin-left: 15px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.back-link:hover {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

/* --- GAME CONTAINER --- */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* --- ARÈNE DE COMBAT --- */
.arena {
    background: linear-gradient(180deg, var(--dungeon-gray) 0%, var(--darker-bg) 100%);
    border: 2px solid var(--primary-red);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(139, 0, 0, 0.1);
    animation: pulse-glow 4s ease-in-out infinite;
    margin: auto;
}

/* --- STATS ROW (EN DEHORS DE LA ZONE DE COMBAT) --- */
.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.stats-row .stats {
    flex: 1;
    max-width: 48%;
}

.stats-row .hero-stats {
    border-left: 3px solid var(--accent-red);
}

.stats-row .enemy-stats {
    border-right: 3px solid #8b0000;
    border-left: none;
    text-align: right;
}

/* --- ZONE DE COMBAT (IMAGES SEULEMENT) --- */
.fighters-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 200px;
    background: 
        radial-gradient(ellipse at bottom, rgba(139, 0, 0, 0.2) 0%, transparent 70%),
        linear-gradient(to bottom, var(--stone-gray) 0%, var(--dungeon-gray) 100%);
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid var(--stone-gray);
    position: relative;
    overflow: visible;
}

/* Effet de brume au sol */
.fighters-area::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45px;
    background: linear-gradient(to top, rgba(139, 0, 0, 0.15), transparent);
    pointer-events: none;
}

.fighter {
    position: relative;
    text-align: center;
    width: 38%;
    z-index: 1;
}

.fighter img {
    max-width: 100%;
    height: auto;
    max-height: 140px;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.8));
    transition: transform 0.3s ease;
}

.fighter:hover img {
    transform: scale(1.05);
}

.enemy-img {
    transform: scaleX(-1);
}

.fighter:hover .enemy-img {
    transform: scaleX(-1) scale(1.05);
}

/* --- STATS DES COMBATTANTS --- */
.stats {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(139, 0, 0, 0.3) 100%);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    border: 1px solid var(--primary-red);
    box-shadow: 0 0 8px rgba(139, 0, 0, 0.3);
}

.stats strong {
    color: var(--gold-accent);
    font-size: 0.95rem;
}

/* --- LOG DE COMBAT --- */
.battle-log {
    background: linear-gradient(135deg, var(--parchment) 0%, #1a1210 100%);
    border: 2px solid var(--blood-red);
    border-radius: 6px;
    height: 120px;
    overflow-y: auto;
    padding: 10px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--parchment-text);
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.5),
        0 3px 12px rgba(0, 0, 0, 0.5);
}

.battle-log::-webkit-scrollbar {
    width: 8px;
}

.battle-log::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-radius: 4px;
}

.battle-log::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

.log-line {
    padding: 4px 0;
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
}

.log-line:last-child {
    border-bottom: none;
}

/* --- CONTRÔLES / BOUTONS D'ACTION --- */
.controls {
    text-align: center;
}

.controls form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    background: linear-gradient(180deg, var(--stone-gray) 0%, var(--dungeon-gray) 100%);
    border: 2px solid var(--stone-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.action-btn:active {
    transform: translateY(0);
}

/* Bouton Attaque */
.action-btn.attack {
    background: linear-gradient(180deg, var(--accent-red) 0%, var(--blood-red) 100%);
    border-color: var(--accent-red);
}

.action-btn.attack:hover {
    background: linear-gradient(180deg, #d4243e 0%, var(--primary-red) 100%);
    box-shadow: 0 0 25px rgba(196, 30, 58, 0.5);
}

/* Bouton Soin */
.action-btn.heal {
    background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
    border-color: #2e7d32;
}

.action-btn.heal:hover {
    background: linear-gradient(180deg, #388e3c 0%, #2e7d32 100%);
    box-shadow: 0 0 25px rgba(46, 125, 50, 0.5);
}

/* Bouton Abandonner */
.action-btn.abandon {
    background: linear-gradient(180deg, #424242 0%, #212121 100%);
    border-color: #424242;
    font-size: 0.9rem;
    padding: 10px 20px;
}

.action-btn.abandon:hover {
    background: linear-gradient(180deg, #616161 0%, #424242 100%);
}

/* Bouton Nouveau Combat */
.action-btn.new-game {
    background: linear-gradient(180deg, var(--gold-accent) 0%, #8b6914 100%);
    border-color: var(--gold-accent);
    color: var(--dark-bg);
}

.action-btn.new-game:hover {
    background: linear-gradient(180deg, #d4a10d 0%, var(--gold-accent) 100%);
    box-shadow: 0 0 25px rgba(184, 134, 11, 0.5);
}

/* --- GAME OVER --- */
.game-over {
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border-radius: 10px;
    border: 2px solid var(--gold-accent);
    box-shadow: 0 0 30px rgba(184, 134, 11, 0.3);
}

/* --- ÉCRAN DE SÉLECTION --- */
.select-screen {
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(139, 0, 0, 0.1) 100%);
    border-radius: 15px;
    border: 2px solid var(--blood-red);
}

.select-screen h2 {
    margin-bottom: 30px;
}

select {
    width: 80%;
    max-width: 400px;
    padding: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    /* margin: 20px 0; */
    background: var(--dungeon-gray);
    color: var(--text-light);
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23c41e3a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.3);
}

select option {
    background: var(--dungeon-gray);
    color: var(--text-light);
    padding: 10px;
}

/* --- ANIMATIONS --- */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(196, 30, 58, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(196, 30, 58, 0.6);
    }
}

/* Animation pulse-glow définie ici, utilisée par .arena */

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        padding: 25px 15px 20px;
    }

    .fighters-area {
        height: 180px;
        padding: 12px;
    }

    .fighter img {
        max-height: 110px;
    }

    .controls form {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 250px;
    }

    .menu-btn {
        width: 90%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .fighters-area {
        height: 140px;
    }

    .fighter img {
        max-height: 80px;
    }

    .stats {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

/* ==============================================
   NOUVELLES FONCTIONNALITÉS - COMBAT SYSTEM
   ============================================== */

/* --- INDICATEUR DE TOUR --- */
.turn-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.2rem;
    color: var(--gold-accent);
    padding: 10px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--blood-red);
}

/* --- VS INDICATOR --- */
.vs-indicator {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-red);
    text-shadow: 0 0 20px rgba(196, 30, 58, 0.8);
    z-index: 10;
}

/* --- BADGES DE TYPE --- */
.type-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(180deg, var(--primary-red), var(--blood-red));
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
}

/* --- BARRES DE PV --- */
.stat-bar {
    width: 100%;
    height: 8px;
    background: var(--darker-bg);
    border-radius: 4px;
    margin: 8px 0;
    overflow: hidden;
    border: 1px solid var(--stone-gray);
}

.pv-bar {
    height: 100%;
    background: linear-gradient(90deg, #2e7d32, #4caf50);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.pv-bar.enemy-pv {
    background: linear-gradient(90deg, var(--blood-red), var(--accent-red));
}

/* --- INFOBULLES (TOOLTIPS) --- */
/* Uniquement pour les hero-cards (pas dans l'arène) */
.hero-card .tooltip {
    position: absolute;
    bottom: calc(100% + 10px); /* Positionné AU-DESSUS de l'élément */
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(10, 10, 10, 0.98);
    border: 2px solid var(--accent-red);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10000; /* Plus haut que mystery-icon */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Tooltip visible seulement au hover */
.hero-card:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip h4 {
    color: var(--gold-accent);
    margin-bottom: 8px;
    font-size: 1rem;
}

.tooltip hr {
    border: none;
    border-top: 1px solid var(--blood-red);
    margin: 10px 0;
}

.tooltip ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(139, 0, 0, 0.2);
}

.tooltip li:last-child {
    border-bottom: none;
}

.hero-description {
    color: var(--parchment-text);
    font-style: italic;
    margin-bottom: 10px;
}

/* --- GRILLE DE SELECTION DE HÉROS --- */
.hero-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    overflow: visible;
}

.hero-card {
    position: relative;
    cursor: pointer;
    overflow: visible;
}

.hero-card input[type="radio"] {
    display: none;
}

.hero-card-content {
    position: relative;
    overflow: visible;
    background: linear-gradient(180deg, var(--dungeon-gray), var(--darker-bg));
    border: 2px solid var(--stone-gray);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.hero-card:hover .hero-card-content {
    border-color: var(--accent-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.4);
}

.hero-card input:checked + .hero-card-content {
    border-color: var(--gold-accent);
    background: linear-gradient(180deg, var(--stone-gray), var(--dungeon-gray));
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.5);
}

.hero-card img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}



.hero-card h4 {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 5px;
}

.hero-stats-preview {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 10px;
}

/* --- BOUTONS D'ACTION ADDITIONNELS --- */
.action-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* Style général pour tous les boutons d'action de combat */
.action-list .action-btn {
    background: linear-gradient(180deg, var(--stone-gray) 0%, var(--dungeon-gray) 100%);
    border: 2px solid var(--primary-red);
}

.action-list .action-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--primary-red) 0%, var(--blood-red) 100%);
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.4);
}

/* Bouton Enter Arena */
.action-btn.enter-arena {
    background: linear-gradient(180deg, var(--accent-red) 0%, var(--blood-red) 100%);
    border-color: var(--accent-red);
    font-size: 1.2rem;
    padding: 18px 40px;
    margin-top: 25px;
}

.action-btn.enter-arena:hover {
   box-shadow: 0 0 30px rgba(196, 30, 58, 0.6);
}
/* --- STYLES DE LOG AMÉLIORÉS --- */
.log-line.player-action {
    color: #4caf50;
    font-weight: bold;
}

.log-line.enemy-action {
    color: var(--accent-red);
}

.log-line.victory {
    color: var(--gold-accent);
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

.log-line.defeat {
    color: #888;
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

.log-line.turn-separator {
    color: var(--text-dim);
    text-align: center;
    border-bottom: 1px dashed var(--blood-red);
    margin: 5px 0;
}

/* --- RESPONSIVE POUR NOUVELLES FEATURES --- */
@media (max-width: 768px) {
    .hero-select-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .tooltip {
        width: 220px;
        font-size: 0.75rem;
    }

    .vs-indicator {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-select-grid {
        grid-template-columns: 1fr;
    }

    .fighter .tooltip {
        display: none;
    }
}

/* ==============================================
   SYSTÈME D'EMOJI D'ACTION - ANIMATIONS
   ============================================== */

/* Container pour les emojis d'action */
/* .fighter position déjà définie plus haut */

/* Emoji d'action - Animation pop */
.action-emoji {
    position: absolute;
    font-size: 3rem;
    z-index: 100;
    pointer-events: none;
    animation: emoji-pop 1.5s ease-out forwards;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Position sur soi-même (centre du personnage) */
.action-emoji.on-self {
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
}

/* Position sur la cible (au-dessus) */
.action-emoji.on-target {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

/* Style différent pour les actions ennemies */
.action-emoji.enemy-action {
    filter: hue-rotate(180deg) brightness(1.2);
}

/* Animation emoji pop */
@keyframes emoji-pop {
    0% {
        transform: translateX(-50%) scale(0) rotate(-20deg);
        opacity: 0;
    }
    20% {
        transform: translateX(-50%) scale(1.5) rotate(10deg);
        opacity: 1;
    }
    40% {
        transform: translateX(-50%) scale(1.2) rotate(-5deg);
        opacity: 1;
    }
    60% {
        transform: translateX(-50%) scale(1.3) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1) translateY(-20px);
        opacity: 0;
    }
}

/* Conteneur des indicateurs d'effets */
.effects-container {
    position: absolute;
    bottom: -15px;
    display: flex;
    gap: 8px;
    z-index: 50;
    overflow: visible;
}

.effects-container.hero-effects {
    left: 5px;
}

.effects-container.enemy-effects {
    right: 5px;
    flex-direction: row-reverse;
}

/* Indicateurs d'effets actifs (brûlure, etc.) */
.effect-indicator {
    position: relative;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(255, 100, 0, 0.8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.effect-indicator .effect-emoji {
    display: block;
}

/* Badge de durée en bas à droite de l'icône */
.effect-duration-badge {
    position: absolute;
    bottom: -4px;
    right: -6px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0a0a15 100%);
    border: 1px solid var(--gold-accent);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--gold-accent);
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: none;
    animation: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Tooltip au hover */
.effect-tooltip {
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%) !important;
    border: 1px solid var(--gold-accent) !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    min-width: 180px;
    max-width: 250px;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1000 !important;
    pointer-events: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 
                0 0 20px rgba(184, 134, 11, 0.2);
    margin-bottom: 8px;
    white-space: nowrap;
}

.effect-indicator:hover .effect-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(-5px) !important;
}

.effect-tooltip-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--gold-accent);
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(184, 134, 11, 0.3);
    padding-bottom: 4px;
}

.effect-tooltip-desc {
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 6px;
    line-height: 1.3;
}

.effect-tooltip-duration {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

/* Effet en attente (brûlure à venir) */
.effect-indicator.pending {
    opacity: 0.6;
}

.effect-indicator.pending .effect-duration-badge {
    background: linear-gradient(135deg, #2a1a0a 0%, #1a0a00 100%);
    border-color: #ff6b00;
    color: #ff6b00;
}

@keyframes pulse-effect {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.2);
        filter: brightness(1.3);
    }
}

@keyframes pulse-pending {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Amélioration responsive pour les emojis */
@media (max-width: 768px) {
    .action-emoji {
        font-size: 2rem;
    }
    
    .effect-indicator {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .action-emoji {
        font-size: 1.5rem;
    }
    
    .effect-indicator {
        font-size: 1rem;
        bottom: -5px;
    }
}

/* ==============================================
   SYSTÈME DE PP (Power Points)
   ============================================== */

/* Boutons avec structure PP */
.action-btn.has-pp {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    min-width: 120px;
}

.action-icon {
    font-size: 0.8rem;
    color: var(--gold-accent);
    font-weight: bold;
    letter-spacing: 1px;
}

.action-name {
    font-size: 0.9rem;
}

/* .action-pp définie dans section action-list ci-dessous */

/* Boutons désactivés (plus de PP) */
.action-btn.disabled,
.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
    transform: none !important;
}

.action-btn.disabled:hover,
.action-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Victory/Defeat text */
.victory-text {
    color: var(--gold-accent);
    text-shadow: 0 0 20px rgba(184, 134, 11, 0.8);
    font-size: 2rem;
}

.defeat-text {
    color: #666;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    font-size: 1.8rem;
}

/* ==============================================
   NOUVELLE UI - LISTE DE SÉLECTION DES HÉROS
   ============================================== */

.hero-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.hero-row {
    display: block;
    cursor: pointer;
}

.hero-row input[type="radio"] {
    display: none;
}

.hero-row-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(50,30,30,0.6) 100%);
    border: 2px solid var(--stone-gray);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.hero-row:hover .hero-row-content {
    border-color: var(--gold-accent);
    transform: translateX(5px);
}

.hero-row input:checked + .hero-row-content {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(139,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.3);
}

.hero-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--stone-gray);
}

.hero-info {
    flex: 1;
}

.hero-info h4 {
    color: var(--gold-accent);
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.hero-theme {
    color: var(--parchment-text);
    font-size: 0.85rem;
    margin: 5px 0;
    font-style: italic;
    line-height: 1.4;
}

.hero-stats-mini {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* ==============================================
   NOUVELLE UI - LISTE D'ACTIONS DÉFILANTE
   ============================================== */

.action-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    margin-bottom: 15px;
}

.action-list .action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    width: 100%;
    text-align: left;
}

.action-emoji-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.action-label {
    flex: 1;
    font-size: 0.95rem;
}

.action-pp {
    font-size: 0.8rem;
    color: var(--parchment-text);
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid var(--blood-red);
}

/* Stats display */
.stat-numbers {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-thumb {
        width: 60px;
        height: 60px;
    }
    
    .hero-theme {
        font-size: 0.75rem;
    }
    
    .action-list {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .hero-row-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-thumb {
        width: 70px;
        height: 70px;
    }
    
    .action-emoji-icon {
        font-size: 1.2rem;
        min-width: 30px;
    }
}



/* ==============================================
   SCROLLBARS PERSONNALISÉES - Thème Dungeon
   ============================================== */

/* Hero List Scrollbar */
.hero-list::-webkit-scrollbar {
    width: 10px;
}

.hero-list::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-radius: 5px;
    border: 1px solid var(--blood-red);
}

.hero-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-red) 0%, var(--blood-red) 100%);
    border-radius: 5px;
    border: 1px solid var(--accent-red);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.hero-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-red) 0%, var(--primary-red) 100%);
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.5);
}

/* Action List Scrollbar */
.action-list::-webkit-scrollbar {
    width: 10px;
}

.action-list::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-radius: 5px;
    border: 1px solid var(--stone-gray);
}

.action-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-accent) 0%, #8b6914 100%);
    border-radius: 5px;
    border: 1px solid var(--gold-accent);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.action-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4a10d 0%, var(--gold-accent) 100%);
    box-shadow: 0 0 10px rgba(184, 134, 11, 0.5);
}

/* Firefox Support */
.hero-list,
.action-list {
    scrollbar-width: thin;
}

.hero-list {
    scrollbar-color: var(--primary-red) var(--darker-bg);
}

.action-list {
    scrollbar-color: var(--gold-accent) var(--darker-bg);
}

/* ==============================================
   NOM D'ATTAQUE AFFICHÉ AU-DESSUS DU PERSONNAGE
   ============================================== */

.action-name-display {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(50, 30, 30, 0.9) 100%);
    color: var(--gold-accent);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 150;
    border: 2px solid var(--accent-red);
    box-shadow: 
        0 0 15px rgba(196, 30, 58, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.8);
    animation: action-name-pop 1.5s ease-out forwards;
}

@keyframes action-name-pop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.1);
    }
    30% {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px) scale(0.9);
    }
}

/* ==============================================
   ANIMATION DE MORT ET PHASES D'EFFETS
   ============================================== */

/* Animation de mort - Fondu */
.fighter-dead {
    animation: death-fade 1.5s ease-out forwards;
}

@keyframes death-fade {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.8));
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
        filter: drop-shadow(0 0 30px rgba(139, 0, 0, 0.8)) grayscale(0.5);
    }
    100% {
        opacity: 0.15;
        transform: scale(0.9);
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5)) grayscale(1);
    }
}

/* Label de mort */
.action-name-display.death-label {
    background: linear-gradient(180deg, rgba(50, 0, 0, 0.95) 0%, rgba(80, 0, 0, 0.9) 100%);
    border-color: #ff0000;
    color: #ff4444;
    font-size: 1.2rem;
    animation: death-label-pop 2s ease-out forwards;
}

@keyframes death-label-pop {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) scale(1.3);
    }
    40% {
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Label pour phase de dégâts d'effet (brûlure, poison) */
.action-name-display.effect-damage {
    background: linear-gradient(180deg, rgba(80, 20, 0, 0.95) 0%, rgba(50, 10, 0, 0.9) 100%);
    border-color: #ff5722;
    color: #ff8a50;
}

/* Label pour phase de stats d'effet (gel, buff) */
.action-name-display.effect-stats {
    background: linear-gradient(180deg, rgba(0, 40, 80, 0.95) 0%, rgba(0, 20, 50, 0.9) 100%);
    border-color: #00bcd4;
    color: #80deea;
}

/* Label pour les passifs de blessing (couleur violette) */
.action-name-display.blessing-passive {
    background: linear-gradient(180deg, rgba(80, 0, 128, 0.95) 0%, rgba(50, 0, 100, 0.9) 100%);
    border-color: #9932cc;
    color: #da70d6;
    text-shadow: 0 0 15px rgba(153, 50, 204, 0.6);
}

/* Image d'animation blessing (grande, comme action-emoji) */
.blessing-action-img {
    position: absolute;
    width: 120px;
    height: 120px;
    z-index: 100;
    pointer-events: none;
    animation: blessing-emoji-pop 1.5s ease-out forwards;
    filter: drop-shadow(0 0 20px rgba(153, 50, 204, 0.6)) brightness(1.2);
}

.blessing-action-img.on-self {
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
}

.blessing-action-img.on-target {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.blessing-action-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes blessing-emoji-pop {
    0% {
        transform: translateX(-50%) scale(0) rotate(-20deg);
        opacity: 0;
    }
    20% {
        transform: translateX(-50%) scale(1.5) rotate(10deg);
        opacity: 1;
    }
    40% {
        transform: translateX(-50%) scale(1.2) rotate(-5deg);
        opacity: 1;
    }
    60% {
        transform: translateX(-50%) scale(1.3) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1) translateY(-20px);
        opacity: 0;
    }
}

/* ==============================================
   MULTIPLAYER - Custom Interface
   ============================================== */

/* Main split container */
.controls-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: stretch; /* Aligner la hauteur */
    margin-top: 20px;
    height: 180px;
}

/* LEFT COLUMN: Action List */
.action-list {
    flex: 1; /* 50% width */
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%; /* Fill container height */
    overflow-y: auto; /* Scroll always available if needed */
    padding-right: 10px;
    
    /* Custom Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) var(--dungeon-gray);
}

.action-list::-webkit-scrollbar {
    width: 8px;
}

.action-list::-webkit-scrollbar-track {
    background: var(--dungeon-gray);
}

.action-list::-webkit-scrollbar-thumb {
    background-color: var(--primary-red);
    border-radius: 4px;
}

/* Buttons in list */
.action-list .action-btn {
    width: 100%;
    margin: 0;
    text-align: left;
    display: flex;
    align-items: center;
    padding: 15px;
    border: 3px solid #b71c1c; 
    background: linear-gradient(90deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 60px; /* Ensure buttons have good touch target */
}

.action-list .action-btn:hover {
    background: linear-gradient(90deg, #2d2d2d 0%, #3e3e3e 100%);
    border-color: #ff5252;
    transform: translateX(5px);
}

.action-emoji-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    min-width: 30px;
    text-align: center;
}

.action-label {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

.action-pp {
    font-size: 0.8rem;
    color: #aaa;
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

/* RIGHT COLUMN: Info Panel */
.info-panel {
    flex: 1; /* 50% width */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: 100%;
}

/* Circular Timer (Red/Gold Theme) */
.action-timer-circle {
    width: 70px; /* Smaller size */
    height: 70px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

/* SVG Progress Ring */
.timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.timer-circle-progress {
    fill: none;
    stroke: var(--primary-red);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 200; /* Approx 2*PI*R (R=32) */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

/* Timer visual text */
.action-timer-circle span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
    z-index: 2;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.action-timer-circle.timer-critical .timer-circle-progress {
    stroke: #ff3d00;
    filter: drop-shadow(0 0 5px #ff3d00);
}

.action-timer-circle.timer-critical span {
    color: #ff3d00;
    animation: pulse-text 0.5s infinite;
}

/* Description Box (Themed) */
.action-description {
    width: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, rgba(20, 10, 10, 0.95) 0%, rgba(40, 10, 10, 0.9) 100%);
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.15), inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
}

/* Petit ornement doré pour la description */
.action-description::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--gold-accent);
    box-shadow: 0 0 10px var(--gold-accent);
    border-radius: 0 0 4px 4px;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Hit animation on hero PNG */
.fighter-hit {
    animation: fighter-shake 0.4s ease-out;
}

.fighter-hit img {
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)) brightness(1.2) !important;
}

@keyframes fighter-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* ==============================================
   SIMULATION - Page de statistiques d'équilibrage
   ============================================== */

/* --- CONTAINER PRINCIPAL --- */
.simulation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- LIEN MENU SIMULER --- */
.simulate-link {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    margin-top: 20px;
    background: linear-gradient(180deg, #1a3a5c 0%, #0d1f33 100%) !important;
    border-color: #2196f3 !important;
}

.simulate-link:hover {
    background: linear-gradient(180deg, #2196f3 0%, #1565c0 100%) !important;
    box-shadow: 0 0 25px rgba(33, 150, 243, 0.5) !important;
}

/* --- FORMULAIRE DE SIMULATION --- */
.simulation-form {
    background: linear-gradient(135deg, var(--dungeon-gray) 0%, var(--darker-bg) 100%);
    border: 2px solid var(--primary-red);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--gold-accent);
}

/* Input number pour combats */
.form-group input[type="number"] {
    width: 150px;
    padding: 12px 18px;
    font-size: 1.3rem;
    font-family: inherit;
    font-weight: bold;
    text-align: center;
    background: linear-gradient(180deg, var(--stone-gray) 0%, var(--dungeon-gray) 100%);
    color: var(--text-light);
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -moz-appearance: textfield; /* Firefox: masquer les flèches */
    appearance: textfield; /* Standard */
}

/* Masquer les flèches spin sur Chrome/Safari/Edge */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"]:focus {
    border-color: var(--accent-red);
    box-shadow: 
        0 0 20px rgba(196, 30, 58, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-group input[type="number"]:hover {
    border-color: var(--accent-red);
    transform: translateY(-2px);
}

.form-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--stone-gray);
}

.form-info p {
    margin: 5px 0;
    color: var(--text-dim);
}

.form-info strong {
    color: var(--accent-red);
}

.simulate-btn {
    background: linear-gradient(180deg, #1565c0 0%, #0d47a1 100%) !important;
    border-color: #2196f3 !important;
    font-size: 1.2rem;
    padding: 18px 40px;
}

.simulate-btn:hover {
    background: linear-gradient(180deg, #1976d2 0%, #1565c0 100%) !important;
    box-shadow: 0 0 30px rgba(33, 150, 243, 0.6) !important;
}

/* --- RÉSULTATS --- */
.simulation-results {
    background: linear-gradient(135deg, var(--dungeon-gray) 0%, var(--darker-bg) 100%);
    border: 2px solid var(--primary-red);
    border-radius: 15px;
    padding: 30px;
}

.simulation-results h2 {
    text-align: center;
    margin-bottom: 10px;
}

.simulation-results h3 {
    text-align: center;
    margin: 30px 0 15px;
}

.results-summary {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* --- LÉGENDE D'ÉQUILIBRAGE --- */
.balance-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.legend-item {
    font-size: 0.85rem;
    padding: 5px 12px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
}

.legend-item.overpowered { color: #ff5252; border-left: 3px solid #ff5252; }
.legend-item.slightly-strong { color: #ff9800; border-left: 3px solid #ff9800; }
.legend-item.balanced { color: #4caf50; border-left: 3px solid #4caf50; }
.legend-item.slightly-weak { color: #ffeb3b; border-left: 3px solid #ffeb3b; }
.legend-item.underpowered { color: #2196f3; border-left: 3px solid #2196f3; }

/* --- TABLEAU DE RÉSULTATS --- */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.results-table th,
.results-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid var(--stone-gray);
}

.results-table th {
    background: var(--blood-red);
    color: var(--text-light);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.results-table tbody tr {
    transition: background 0.2s ease;
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Classes d'équilibrage pour les lignes */
.results-table tr.overpowered {
    background: rgba(255, 82, 82, 0.15);
    border-left: 4px solid #ff5252;
}

.results-table tr.slightly-strong {
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
}

.results-table tr.balanced {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
}

.results-table tr.slightly-weak {
    background: rgba(255, 235, 59, 0.08);
    border-left: 4px solid #ffeb3b;
}

.results-table tr.underpowered {
    background: rgba(33, 150, 243, 0.1);
    border-left: 4px solid #2196f3;
}

.results-table .rank {
    font-weight: bold;
    color: var(--gold-accent);
}

.results-table .name {
    text-align: left;
}

.results-table .wins {
    color: #4caf50;
}

.results-table .losses {
    color: #f44336;
}

/* Barre de winrate */
.winrate-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
}

.winrate-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.winrate-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* --- MATRICE DE MATCHUPS --- */
.matrix-help {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.matchup-matrix-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.matchup-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.matchup-matrix th,
.matchup-matrix td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--stone-gray);
    min-width: 50px;
}

.matchup-matrix th {
    background: var(--blood-red);
    color: var(--text-light);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.matchup-matrix tbody th {
    background: var(--dungeon-gray);
    text-align: left;
    padding-left: 10px;
}

.matchup-matrix td.self {
    background: var(--darker-bg);
    color: var(--text-dim);
}

.matchup-matrix td.strong-win {
    background: rgba(76, 175, 80, 0.4);
    color: #a5d6a7;
    font-weight: bold;
}

.matchup-matrix td.slight-win {
    background: rgba(76, 175, 80, 0.2);
    color: #c8e6c9;
}

.matchup-matrix td.slight-loss {
    background: rgba(244, 67, 54, 0.2);
    color: #ffcdd2;
}

.matchup-matrix td.strong-loss {
    background: rgba(244, 67, 54, 0.4);
    color: #ef9a9a;
    font-weight: bold;
}

/* --- RESPONSIVE SIMULATION --- */
@media (max-width: 768px) {
    .simulation-container {
        padding: 10px;
    }
    
    .simulation-form,
    .simulation-results {
        padding: 15px;
    }
    
    .balance-legend {
        flex-direction: column;
        align-items: center;
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }
    
    .matchup-matrix {
        font-size: 0.7rem;
    }
    
    .matchup-matrix th,
    .matchup-matrix td {
        padding: 5px 3px;
        min-width: 40px;
    }
}

/* ==============================================
   MULTIPLAYER MODE STYLES
   ============================================== */

.multi-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 600px;
}

/* Screen Visibility Logic */
.screen {
    display: none;
    animation: fade-in 0.5s ease-out;
}

.screen.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader style matching theme */
.loader {
    width: 60px;
    height: 60px;
    margin: 40px auto;
    border: 5px solid var(--dungeon-gray);
    border-top: 5px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Queue Screen Styling */
.queue-container {
    background: linear-gradient(180deg, rgba(45, 45, 45, 0.5), rgba(10, 10, 10, 0.7));
    border: 2px solid var(--blood-red);
    border-radius: 15px;
    padding: 50px 30px;
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.3);
}

.queue-status {
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-top: 20px;
}

.waiting-text {
    color: var(--gold-accent);
    font-style: italic;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Hero card clickable improvements for multiplayer */
.multi-container .hero-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.multi-container .hero-card:hover .hero-card-content {
    border-color: var(--accent-red);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(196, 30, 58, 0.5);
}

/* Arena styling inherited from game-container */
.multi-container .arena {
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.6), rgba(5, 5, 5, 0.8));
    border: 3px solid var(--accent-red);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 
        0 0 40px rgba(196, 30, 58, 0.4),
        inset 0 0 30px rgba(139, 0, 0, 0.2);
}

.multi-container .turn-indicator {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gold-accent);
    text-shadow: 0 0 10px rgba(184, 134, 11, 0.3);
    margin-bottom: 20px;
    font-weight: bold;
}

/* Stat rows styling for multiplayer */
.multi-container .stats-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.multi-container .stats {
    flex: 1;
    background: linear-gradient(180deg, rgba(45, 45, 45, 0.4), rgba(20, 20, 20, 0.6));
    border: 2px solid var(--stone-gray);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.multi-container .stats strong {
    display: block;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* .multi-container */ .type-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-red));
    color: var(--text-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.multi-container .stat-bar {
    width: 100%;
    height: 20px;
    background: var(--darker-bg);
    border: 1px solid var(--blood-red);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.multi-container .pv-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.multi-container .pv-bar.enemy-pv {
    background: linear-gradient(90deg, #ff6b6b, #ff9999);
}

.multi-container .stat-numbers {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Battle log styling */
.multi-container .battle-log {
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.8), rgba(10, 10, 10, 0.9));
    border: 2px solid var(--stone-gray);
    border-radius: 10px;
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    margin: 20px 0;
    font-size: 0.9rem;
}

.multi-container .log-line {
    padding: 5px 0;
    color: var(--text-light);
    border-bottom: 1px solid rgba(139, 0, 0, 0.2);
}

/* Fighters area */
.multi-container .fighters-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 25px 0;
    min-height: 150px;
}

.multi-container .fighter {
    text-align: center;
}

.multi-container .fighter img {
    max-width: 120px;
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(196, 30, 58, 0.4));
}

.multi-container .vs-indicator {
    color: var(--accent-red);
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(196, 30, 58, 0.5);
}

/* Controls styling */
.multi-container .controls {
    text-align: center;
    margin-top: 25px;
}

.multi-container .action-form {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.multi-container .action-btn {
    background: linear-gradient(135deg, var(--primary-red), var(--accent-red));
    color: white;
    border: 2px solid var(--blood-red);
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.multi-container .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(196, 30, 58, 0.5);
}

.multi-container .action-btn:active {
    transform: translateY(0);
}

.multi-container .action-btn.abandon {
    background: linear-gradient(135deg, var(--stone-gray), var(--dungeon-gray));
    border-color: var(--stone-gray);
}

/* Responsive design */
@media (max-width: 768px) {
    .multi-container .stats-row {
        flex-direction: column;
    }
    
    .multi-container .fighters-area {
        gap: 20px;
    }
    
    .multi-container .action-form {
        flex-direction: column;
    }
    
    .multi-container .action-btn {
        width: 100%;
    }
}

/* ===== CUSTOM TOOLTIP SYSTEM ===== */
.custom-tooltip {
    position: fixed;
    z-index: 10000;
    background: rgba(10, 10, 20, 0.92 0.5);
    border: 1px solid rgba(184, 134, 11, 0.6);
    border-radius: 6px;
    padding: 8px 12px;
    max-width: 260px;
    font-size: 12px;
    color: #e0e0e0;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(184, 134, 11, 0.15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    line-height: 1.4;
    backdrop-filter: blur(4px);
}

.custom-tooltip.visible {
    opacity: 1;
   /*  transform: translateY(0); */
}

