/* RPG Battle Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    background-color: #05050a;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#bg-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('../../assets/images/rpg.png') center/cover no-repeat;
    filter: blur(3px) brightness(0.4);
    z-index: -1;
}

#game-wrapper {
    width: 100%;
    max-width: 1000px;
    height: 100%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

/* Battle Log */
#battle-log {
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid #8a2be2;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Battle Scene */
#battle-scene {
    flex-grow: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
}

.character {
    position: relative;
    text-align: center;
}

.sprite {
    font-size: 10rem;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.8));
    transition: transform 0.2s;
}

.hero { animation: float 3s ease-in-out infinite; }
.monster { animation: float 4s ease-in-out infinite reverse; filter: drop-shadow(0 0 30px rgba(255,0,0,0.4)); }

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

/* Animations for attacks */
.anim-attack { animation: rush 0.3s ease-in-out; }
.anim-hit { animation: shake 0.3s ease-in-out; filter: brightness(2) drop-shadow(0 0 30px red); }
.anim-magic { animation: pulse-magic 0.5s ease-out; }
.anim-heal { animation: pulse-heal 0.5s ease-out; }

@keyframes rush {
    0% { transform: translateX(0); }
    50% { transform: translateX(50px); }
    100% { transform: translateX(0); }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

@keyframes pulse-magic {
    0% { filter: brightness(1) drop-shadow(0 0 0px orange); transform: scale(1); }
    50% { filter: brightness(1.5) drop-shadow(0 0 50px orange); transform: scale(1.1); }
    100% { filter: brightness(1) drop-shadow(0 0 0px orange); transform: scale(1); }
}

@keyframes pulse-heal {
    0% { filter: drop-shadow(0 0 0px #00ffcc); transform: scale(1); }
    50% { filter: drop-shadow(0 0 40px #00ffcc); transform: scale(1.1); }
    100% { filter: drop-shadow(0 0 0px #00ffcc); transform: scale(1); }
}

.damage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.dmg-up { animation: floatUp 1s forwards; }

@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    20% { transform: translate(-50%, -80%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

/* UI Panel */
#ui-panel {
    background: rgba(15, 15, 20, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}

.stats-box h3 {
    margin: 0 0 10px 0;
    color: #d4af37; /* Gold */
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-right { text-align: right; }

.bar-bg {
    background: #2a2a35;
    height: 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    overflow: hidden;
    border: 1px solid #000;
}

.bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease-out;
}

.hp-fill { background: linear-gradient(90deg, #ff0055, #ff3333); width: 100%; }
.enemy-hp { background: linear-gradient(90deg, #aa0000, #ff0000); }
.mp-fill { background: linear-gradient(90deg, #0055ff, #00bbff); width: 100%; }

.stat-text {
    font-size: 0.9rem;
    color: #a0a0b0;
    margin-bottom: 10px;
}

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

.action-btn {
    background: #252530;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.action-btn.attack:hover { border-color: #ff3333; box-shadow: 0 0 15px rgba(255, 51, 51, 0.4); }
.action-btn.magic:hover { border-color: #ffaa00; box-shadow: 0 0 15px rgba(255, 170, 0, 0.4); }
.action-btn.heal:hover { border-color: #00ffcc; box-shadow: 0 0 15px rgba(0, 255, 204, 0.4); }
.action-btn.flee { background: transparent; }
.action-btn.flee:hover { border-color: #fff; }

/* Overlay */
.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.overlay-content {
    background: #13131c;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #d4af37;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
}

.overlay-content h2 {
    font-size: 3rem;
    color: #d4af37;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.overlay-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #a0a0b0;
}

.overlay-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.overlay-actions .action-btn {
    background: linear-gradient(135deg, #d4af37, #b5952f);
    color: #000;
    border: none;
}
.overlay-actions .action-btn.back {
    background: transparent;
    border: 2px solid #a0a0b0;
    color: #fff;
}

.hidden { display: none !important; }
