* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #333;
    overflow: hidden;
    height: 100vh;
    image-rendering: pixelated;
}

.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Écran de sélection */
#selection-screen {
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 60%, #90EE90 60%, #228B22 100%);
}

.cyber-title {
    font-size: 4rem;
    color: #FFD700;
    text-shadow: 4px 4px 0px #FF4500, 6px 6px 0px #000;
    margin-bottom: 20px;
    font-weight: bold;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.5rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    border: 3px solid #333;
}

.allies-selection {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.ally-card {
    background: #fff;
    border: 4px solid #000;
    border-radius: 20px;
    padding: 20px;
    width: 250px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 0 #666, 0 8px 20px rgba(0,0,0,0.5);
}

.ally-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 0 #666, 0 12px 25px rgba(0,0,0,0.6);
}

.ally-card:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #666, 0 4px 10px rgba(0,0,0,0.5);
}

.ally-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border: 3px solid #333;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ally-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ally-card h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.stats {
    text-align: center;
    color: #34495e;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #ccc;
}

.stats p {
    margin: 5px 0;
    font-size: 1rem;
    font-weight: bold;
}

/* Écran de combat */
#battle-screen {
    background: linear-gradient(to bottom,
        #87CEEB 0%,
        #87CEEB 35%,
        #C4A777 35%,
        #DEB887 50%,
        #8B7355 50%,
        #90EE90 70%,
        #228B22 100%
    );
    flex-direction: column;
}

.battle-arena {
    flex: 1;
    width: 100%;
    display: grid;
    grid-template-rows: 1fr 1fr;
    position: relative;
    padding: 20px;
}

.enemy-zone, .ally-zone {
    display: flex;
    align-items: center;
    gap: 30px;
}

.enemy-zone {
    justify-content: flex-end;
    padding-right: 80px;
    align-items: flex-start;
    padding-top: 40px;
}

.ally-zone {
    justify-content: flex-start;
    padding-left: 80px;
    align-items: flex-end;
    padding-bottom: 40px;
}

.enemy-sprite, .ally-sprite {
    width: 250px;
    height: 250px;
    position: relative;
}

.enemy-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: float 2s ease-in-out infinite;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.4));
}

.ally-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.4));
}

/* Platformes sous les sprites */
.ally-sprite::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
}

.enemy-sprite::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 25px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.enemy-info, .ally-info {
    min-width: 280px;
    background: #fff;
    border: 4px solid #000;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 0 #666;
}

.enemy-info h3, .ally-info h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.hp-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hp-bar {
    flex: 1;
    height: 25px;
    background: #f0f0f0;
    border: 3px solid #333;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hp-bar::before {
    content: 'HP';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: bold;
    color: #e67e22;
    z-index: 1;
}

.hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to bottom, #2ecc71 0%, #27ae60 100%);
    transition: width 0.5s, background 0.3s;
    border-right: 2px solid rgba(0, 0, 0, 0.2);
}

.hp-fill.low {
    background: linear-gradient(to bottom, #e74c3c 0%, #c0392b 100%) !important;
}

.hp-text {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: bold;
    min-width: 90px;
}

/* Menu de combat */
.battle-menu {
    height: 230px;
    background: #fff;
    border-top: 5px solid #000;
    padding: 15px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.message-box {
    background: #f8f9fa;
    border: 4px solid #333;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3rem;
    min-height: 70px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.message-box::before {
    content: '▶';
    margin-right: 10px;
    color: #e74c3c;
}

.action-menu, .attack-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-btn, .attack-btn {
    background: linear-gradient(to bottom, #fff 0%, #e8e8e8 100%);
    border: 3px solid #333;
    color: #2c3e50;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.1s;
    box-shadow: 0 4px 0 #666, 0 4px 8px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.action-btn:hover, .attack-btn:hover {
    background: linear-gradient(to bottom, #fff 0%, #d0d0d0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #666, 0 6px 12px rgba(0,0,0,0.4);
}

.action-btn:active, .attack-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #666, 0 2px 4px rgba(0,0,0,0.3);
}

.btn-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.back-btn {
    background: linear-gradient(to bottom, #ffcccc 0%, #ffaaaa 100%);
    border: 3px solid #c0392b;
    color: #c0392b;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.1s;
    grid-column: span 2;
    box-shadow: 0 4px 0 #a02820, 0 4px 8px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.back-btn:hover {
    background: linear-gradient(to bottom, #ffaaaa 0%, #ff8888 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #a02820, 0 6px 12px rgba(0,0,0,0.4);
}

.back-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #a02820, 0 2px 4px rgba(0,0,0,0.3);
}

.hidden {
    display: none !important;
}

/* Animations d'attaque */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px) rotate(-2deg); }
    20% { transform: translateX(10px) rotate(2deg); }
    30% { transform: translateX(-10px) rotate(-2deg); }
    40% { transform: translateX(10px) rotate(2deg); }
    50% { transform: translateX(-8px) rotate(-1deg); }
    60% { transform: translateX(8px) rotate(1deg); }
    70% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    90% { transform: translateX(-2px); }
}

.shake {
    animation: shake 0.6s;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
    50% { opacity: 1; }
}

.flash {
    animation: flash 0.3s 3;
}

@keyframes attack-slide {
    0% { transform: translateX(0); }
    50% { transform: translateX(100px); }
    100% { transform: translateX(0); }
}

.attack-slide {
    animation: attack-slide 0.5s ease-in-out;
}

@keyframes enemy-attack-slide {
    0% { transform: translateX(0); }
    50% { transform: translateX(-100px); }
    100% { transform: translateX(0); }
}

.enemy-attack-slide {
    animation: enemy-attack-slide 0.5s ease-in-out;
}

@keyframes hit-impact {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    25% { transform: scale(0.9); filter: brightness(2); }
    50% { transform: scale(1.1); filter: brightness(0.5); }
    75% { transform: scale(0.95); filter: brightness(1.5); }
}

.hit-impact {
    animation: hit-impact 0.4s;
}

@keyframes slide-in-enemy {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-ally {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-enemy {
    animation: slide-in-enemy 0.6s ease-out;
}

.slide-in-ally {
    animation: slide-in-ally 0.6s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fade-in 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.bounce {
    animation: bounce 0.5s;
}
