/* ==================================================================== */
/* BASE STYLES AND LAYOUT */
/* ==================================================================== */
body {
    font-family: 'Georgia', serif;
    background-color: #2c3e50; /* Dark blue/slate background for atmosphere */
    color: #ecf0f1; /* Light text */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#game-container {
    width: 90%;
    max-width: 800px;
    background-color: #34495e; /* Slightly lighter background for the game box */
    border: 5px solid #f39c12; /* Golden border for an RPG feel */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    padding: 20px;
}

h1 {
    text-align: center;
    color: #f1c40f;
    text-shadow: 1px 1px 2px #000;
    margin-bottom: 20px;
}

h3 {
    color: #bdc3c7;
    margin-top: 0;
    margin-bottom: 10px;
}

/* ==================================================================== */
/* BUTTONS AND MENUS */
/* ==================================================================== */
.menu-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px dashed #5a7d9b;
}

.btn {
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #2980b9;
    color: white;
}
.btn-primary:hover {
    background-color: #3498db;
}

.btn-info {
    background-color: #16a085;
    color: white;
}
.btn-info:hover {
    background-color: #1abc9c;
}

.btn-warning {
    background-color: #d35400;
    color: white;
}
.btn-warning:hover {
    background-color: #e67e22;
}

.btn-secondary {
    background-color: #7f8c8d;
    color: white;
}
.btn-secondary:hover {
    background-color: #95a5a6;
}

/* New: Highlight Merged Magic ability (danger/special color) */
.btn-danger {
    background-color: #c0392b;
    color: white;
    border: 2px solid #f1c40f; /* Extra highlight */
}
.btn-danger:hover {
    background-color: #e74c3c;
}

.btn:disabled {
    background-color: #49545c;
    color: #95a5a6;
    cursor: not-allowed;
}


/* ==================================================================== */
/* STATUS PANELS AND IMAGES */
/* ==================================================================== */
#party-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.status-panel {
    width: 48%; /* Takes up half the space with a small gap */
    background-color: #2c3e50;
    padding: 15px;
    border: 2px solid #3498db;
    display: flex; /* Keep flex for image and stats */
    gap: 15px;
    align-items: flex-start;
    position: relative; /* Needed for potential absolute positioning later, or just for z-index */
    overflow: hidden; /* Hide parts of image if it extends beyond panel */
}

/* Image Styling - INCREASED SIZE HERE */
.character-image {
    width: 120px;  /* Increased width */
    height: 120px; /* Increased height */
    min-width: 120px; /* Prevent shrinking */
    background-size: cover;
    background-position: center;
    border: 3px solid #f1c40f; /* Gold border for heroes */
    border-radius: 5px; /* Slight rounding */
    background-color: #1a242f; /* Fallback color if image is missing */

    /* Optional: If you want it truly "behind" and possibly overlapping */
    /*
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2; // Make it semi-transparent
    z-index: 0; // Ensure it's behind text
    */
}

/* Specific Image Paths (Customize these URLs) */
#julie-image {
    background-image: url('julie.png'); 
}
#robin-image {
    background-image: url('robin.png');
}

.stat-info {
    flex-grow: 1;
    font-size: 0.9em;
    position: relative; /* Ensure text is above image if image is absolute */
    z-index: 1;
}

.status-effects span {
    display: inline-block;
    background-color: #9b59b6; /* Purple for status effects */
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-right: 5px;
}


/* ==================================================================== */
/* ENEMY SECTION & HP BARS */
/* ==================================================================== */
#enemy-section {
    text-align: center;
    margin-bottom: 20px;
}

.hp-bar-container {
    width: 80%;
    margin: 10px auto;
    background-color: #2980b9;
    border: 1px solid #3498db;
    height: 25px;
    position: relative;
    font-size: 0.8em;
    line-height: 25px;
    color: white;
    text-align: right;
    padding: 0 5px;
}

.hp-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%; /* Default 100% when starting */
    background-color: #e74c3c; /* Red HP */
    transition: width 0.5s ease-out;
    z-index: 1;
}

/* Make HP text visible over the bar */
#enemy-hp {
    position: relative;
    z-index: 2;
    padding-left: 5px; /* Ensures space between HP text and bar end */
}

/* ==================================================================== */
/* GAME LOG */
/* ==================================================================== */
#game-log {
    height: 150px;
    background-color: #1a242f; /* Very dark log background */
    border: 2px solid #5a7d9b;
    overflow-y: scroll;
    padding: 10px;
    margin-top: 20px;
}

#game-log p {
    margin: 5px 0;
    padding: 0;
    border-bottom: 1px dotted #49545c;
    font-size: 0.9em;
    line-height: 1.3;
}

/* Log Message Colors */
.log-default { color: #ecf0f1; } /* White */
.log-primary { color: #3498db; } /* Blue (Attack/Damage) */
.log-danger { color: #e74c3c; font-weight: bold; } /* Red (Enemy action/Critical) */
.log-success { color: #2ecc71; } /* Green (Heal/Victory) */
.log-info { color: #f1c40f; } /* Yellow (Buff/Status) */
.log-warning { color: #e67e22; } /* Orange (Low MP/Action failed) */
.log-turn { color: #bdc3c7; font-style: italic; border-bottom: none !important; }

/* ==================================================================== */
/* WORLD SCREEN (Start screen) */
/* ==================================================================== */
#world-screen {
    text-align: center;
    padding: 50px 20px;
}

#world-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

#world-screen .btn {
    font-size: 1.5em;
    padding: 15px 30px;
}
