/* Additional styles for battle mode rendering */
.battle-environment {
    background: rgba(15, 12, 41, 0.6);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.environment-backdrop {
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
}

.environment-backdrop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
    border-radius: 10px;
}

.environment-name {
    color: var(--secondary);
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.environment-description {
    color: var(--light);
    margin: 0;
    max-width: 80%;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Environment-specific backdrops */
.arena-backdrop {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="300" viewBox="0 0 800 300"><rect width="800" height="300" fill="%23302b63"/><circle cx="400" cy="150" r="100" stroke="%23ff9e00" stroke-width="3" fill="none"/><rect x="150" y="50" width="500" height="200" stroke="%23ff9e00" stroke-width="3" rx="5" ry="5" fill="none"/></svg>');
    background-size: cover;
}

.wasteland-backdrop {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="300" viewBox="0 0 800 300"><rect width="800" height="300" fill="%23302b63"/><polygon points="0,300 100,250 200,280 300,240 400,260 500,220 600,270 700,230 800,300" fill="%236a5acd"/><line x1="100" y1="200" x2="130" y2="150" stroke="%23666" stroke-width="5"/><line x1="300" y1="180" x2="320" y2="120" stroke="%23666" stroke-width="5"/><line x1="500" y1="190" x2="540" y2="130" stroke="%23666" stroke-width="5"/><line x1="700" y1="210" x2="720" y2="150" stroke="%23666" stroke-width="5"/></svg>');
    background-size: cover;
}

.forest-backdrop {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="300" viewBox="0 0 800 300"><rect width="800" height="300" fill="%23302b63"/><polygon points="100,280 150,180 200,280" fill="%23227722"/><polygon points="300,280 350,160 400,280" fill="%23227722"/><polygon points="500,280 550,170 600,280" fill="%23227722"/><polygon points="700,280 750,190 800,280" fill="%23227722"/><polygon points="200,280 250,200 300,280" fill="%23227722"/><polygon points="400,280 450,190 500,280" fill="%23227722"/><polygon points="600,280 650,210 700,280" fill="%23227722"/><polygon points="0,280 50,210 100,280" fill="%23227722"/></svg>');
    background-size: cover;
}

.city-backdrop {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="300" viewBox="0 0 800 300"><rect width="800" height="300" fill="%23302b63"/><rect x="100" y="180" width="50" height="120" fill="%23444"/><rect x="160" y="150" width="40" height="150" fill="%23444"/><rect x="210" y="100" width="60" height="200" fill="%23444"/><rect x="280" y="200" width="40" height="100" fill="%23444"/><rect x="330" y="80" width="70" height="220" fill="%23444"/><rect x="410" y="160" width="50" height="140" fill="%23444"/><rect x="470" y="140" width="40" height="160" fill="%23444"/><rect x="520" y="120" width="80" height="180" fill="%23444"/><rect x="610" y="190" width="30" height="110" fill="%23444"/><rect x="650" y="170" width="60" height="130" fill="%23444"/><rect x="720" y="140" width="40" height="160" fill="%23444"/></svg>');
    background-size: cover;
}

.battle-fighters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(15, 12, 41, 0.6);
    border-radius: 15px;
    padding: 20px;
    position: relative;
}

.battle-fighter {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.fighter-image {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--card-border);
}

.fighter-icon {
    font-size: 5rem;
    margin-bottom: 10px;
    background: rgba(36, 0, 70, 0.6);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.fighter-name {
    margin: 10px 0 5px;
    color: var(--light);
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    max-width: 200px;
}

.fighter-versus {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary);
    background: rgba(36, 0, 70, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    box-shadow: 0 0 20px rgba(255, 158, 0, 0.4);
    border: 2px solid var(--secondary);
}

.battle-results-content {
    margin-top: 20px;
}

.battle-simplified-note {
    background: rgba(255, 158, 0, 0.1);
    border-left: 3px solid var(--secondary);
    border-radius: 0 5px 5px 0;
    padding: 10px 15px;
    margin: 20px 0;
    font-style: italic;
}

.battle-control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0 10px;
}

.battle-back-btn {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(90, 24, 154, 0.4);
}

.battle-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 24, 154, 0.6);
}

.battle-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.battle-error-recovery {
    background: rgba(36, 0, 70, 0.6);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.battle-retry-btn, .battle-simplify-btn {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(90, 24, 154, 0.4);
}

.battle-retry-btn:hover, .battle-simplify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 24, 154, 0.6);
}

/* Responsive styles */
@media (max-width: 768px) {
    .battle-fighters {
        flex-direction: column;
        gap: 20px;
    }
    
    .fighter-versus {
        margin: 10px 0;
    }
    
    .battle-control-buttons {
        flex-direction: column;
        align-items: center;
    }
}

.battle-scene-image {
    width: 100%;
    height: 300px;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1s ease-in;
}

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

.battle-prelude {
    background: rgba(36, 0, 70, 0.6);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.prelude-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.tension {
    color: var(--secondary);
    font-style: italic;
}

.enhanced-battle-rounds {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.enhanced-battle-round {
    background: rgba(36, 0, 70, 0.5);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.5s ease-out;
}

.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.round-stats {
    display: flex;
    gap: 10px;
}

.move-type {
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.move-type.physical { background: #ff4757; }
.move-type.magic { background: #5352ed; }
.move-type.special { background: #ffa502; }
.move-type.ultimate { background: #2ed573; }

.damage-level {
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.damage-level.heavy { background: #ff4757; }
.damage-level.medium { background: #ffa502; }
.damage-level.light { background: #2ed573; }

.round-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.move-description {
    background: rgba(123, 44, 191, 0.3);
    padding: 15px;
    border-radius: 8px;
}

.battle-flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dramatic-moment {
    color: var(--secondary);
    font-style: italic;
}

.psychological-state {
    color: #ff9f43;
}

.counter-move {
    background: rgba(255, 71, 87, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.environment-effect {
    background: rgba(46, 213, 115, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.battle-climax {
    background: rgba(255, 71, 87, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 71, 87, 0.5);
}

.ultimate-move {
    background: rgba(255, 71, 87, 0.4);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    animation: pulse 2s infinite;
}

.character-growth {
    background: rgba(46, 213, 115, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.growth-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.winner-growth, .loser-growth {
    background: rgba(36, 0, 70, 0.5);
    padding: 15px;
    border-radius: 8px;
}

.winner-growth h4 {
    color: #2ed573;
}

.loser-growth h4 {
    color: #ff4757;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .round-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .growth-content {
        grid-template-columns: 1fr;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}