:root {
    --bg-dark: #1a1a1d;
    --bg-med: #2c2f33;
    --bg-light: #23272a;
    --text-main: #c5c6c7;
    --text-light: #99aab5;
    --accent-primary: #66fcf1;
    --accent-secondary: #2a625f;
    --accent-career: #92f7c7;
    --accent-warning: #f04747;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: auto;
    background: var(--bg-med);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

h1, h2, h3, h4 {
    color: var(--accent-primary);
    border-bottom: 2px solid var(--accent-secondary);
    padding-bottom: 10px;
}

h1 { font-size: 2.5em; text-align: center; border: none; margin-bottom: 20px; }
h2 { font-size: 1.8em; margin-top: 40px; }
h3 { font-size: 1.4em; border-bottom-style: dashed; margin-top: 30px; }
h4 { font-size: 1.2em; border: none; padding-bottom: 0; margin-bottom: 5px; }

section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 5px;
}

p { color: var(--text-light); }

.mode-switcher {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 20px;
}

.mode-switcher label {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-primary);
}

.mode-switcher p {
    font-size: 0.9em;
    margin-top: 5px;
}

.choice-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 15px; 
}

.gear-option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

.gear-choice-group {
    padding: 10px;
    border-left: 3px solid var(--accent-secondary);
}

.gear-choice-group label {
    margin-right: 20px;
}

.choice-item { 
    padding: 15px; 
    border: 1px solid var(--accent-secondary); 
    border-radius: 5px; 
    cursor: pointer; 
    transition: background-color 0.3s, transform 0.2s; 
}

.choice-item:hover { 
    background-color: #3a3e42; 
    transform: translateY(-2px); 
}

.choice-item.selected { 
    background-color: var(--accent-secondary); 
    color: #ffffff; 
    border-color: var(--accent-primary); 
}

.choice-item label { 
    font-weight: bold; 
    font-size: 1.1em; 
    display: block; 
    margin-bottom: 10px; 
    cursor: pointer; 
}

.choice-item .desc, .choice-item ul { 
    font-size: 0.9em; 
    margin: 5px 0 0; 
    color: var(--text-light); 
}

.choice-item.selected .desc, .choice-item.selected ul { 
    color: #becdd7; 
}

.choice-item ul { 
    padding-left: 20px; 
    margin-top: 5px; 
}

.talent-desc { 
    font-style: italic; 
}

/* Talent Accordion Styles */
.talent-accordion-title {
    background-color: var(--bg-med);
    color: var(--accent-primary);
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.3em;
    transition: 0.4s;
    border-radius: 5px;
    margin-top: 10px;
    border-bottom: 2px solid var(--accent-secondary);
}

.talent-accordion-title:hover, .talent-accordion-title.active {
    background-color: var(--accent-secondary);
    color: var(--bg-dark);
}

.talent-panel {
    padding: 0 18px;
    background-color: var(--bg-light);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-radius: 0 0 5px 5px;
    margin-bottom: 5px;
}
.talent-panel .choice-grid {
    padding-top: 15px;
    padding-bottom: 15px;
}


input[type="radio"], input[type="checkbox"] { 
    margin-right: 10px; 
    vertical-align: middle; 
}

.stat-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    gap: 20px; 
}

.skill-list { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px; 
}

.stat-item, .skill-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.stat-item label, .skill-item > label { 
    font-weight: bold; 
    color: var(--accent-primary); 
}

.skill-item.career-skill > label { 
    color: var(--accent-career); 
}
span.career-text {
    color: var(--accent-career);
    font-weight: bold;
}


.skill-item .free-skill-label { 
    font-size: 0.8em; 
    color: var(--text-light); 
}

input[type="number"], input[type="text"], textarea, select { 
    width: 80px; 
    padding: 8px; 
    margin-top: 5px; 
    background: #1f2833; 
    border: 1px solid var(--accent-secondary); 
    color: var(--text-main); 
    border-radius: 4px; 
    text-align: center; 
}

input[type="number"]:disabled { 
    background: #444; 
    color: #888; 
    cursor: not-allowed; 
}

textarea { 
    width: 95%; 
    text-align: left; 
    background: #1f2833; 
    border: 1px solid var(--accent-secondary); 
    color: var(--text-main); 
    border-radius: 4px; 
    padding: 10px; 
}

.cost, .derived-value { 
    font-size: 0.8em; 
    color: var(--text-light); 
}

.xp-tracker { 
    position: sticky; 
    top: 20px; 
    background: var(--bg-light); 
    padding: 15px; 
    text-align: center; 
    font-size: 1.5em; 
    z-index: 10; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    border: 1px solid var(--accent-primary); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
}

.xp-tracker .negative, #availableXpInput.negative { 
    color: var(--accent-warning); 
    font-weight: bold; 
}

button { 
    display: block; 
    width: 100%; 
    padding: 15px; 
    background-color: var(--accent-primary); 
    color: var(--bg-dark); 
    border: none; 
    border-radius: 5px; 
    font-size: 1.2em; 
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 20px; 
    transition: background-color 0.3s; 
}

button:hover { 
    background-color: var(--accent-secondary); 
}

button.small-button {
    font-size: 0.9em;
    padding: 8px;
    margin-top: 8px;
    width: auto;
}

.final-summary { 
    width: 98%; 
    height: 400px; 
    font-family: "Courier New", Courier, monospace; 
    white-space: pre; 
    background-color: #111; 
    border-color: #333; 
    margin-top: 15px; 
    padding: 1%;
}

#talent-warning, .advancement-note { 
    color: var(--accent-warning); 
    text-align: center; 
    font-weight: bold; 
    margin-top: 15px; 
    min-height: 1.2em; 
}

.hidden {
    display: none;
}

/* --- NEW STYLES FOR VISUAL ENHANCEMENT --- */

/* Banners for each section */
.section-banner {
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 5px 5px 0 0;
    /* Negative margins pull the banner out to the edges of the section's padding */
    margin: -20px -20px 25px -20px;
    box-shadow: inset 0 -10px 15px -10px rgba(0,0,0,0.5);
}

/* Adjustments for the parent choice item */
.choice-item {
    padding: 0; /* Remove old padding */
    display: flex; /* Use flexbox for better layout */
    flex-direction: column;
    background-color: var(--bg-light); 
    border: 1px solid var(--accent-secondary); 
    height: 100%; /* Ensure all cards in a row are the same height */
}

/* The new image header for Archetype/Career cards */
.choice-item-header {
    height: 160px; /* This makes the top part taller */
    background-size: cover;
    background-position: 50% 25%; /* Tends to focus on the upper part of an image */
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom: 2px solid var(--accent-secondary);
    transition: transform 0.3s ease-in-out;
}

.choice-item:hover .choice-item-header {
    transform: scale(1.05); /* A little zoom effect on hover */
}

/* A container for the text content to keep it organized */
.choice-item-content {
    padding: 15px;
    flex-grow: 1; /* Makes sure the content area fills remaining space */
    display: flex;
    flex-direction: column;
}

/* Make sure the description fills available space to align footers */
.choice-item .desc {
    flex-grow: 1;
}

/* Override hover effect on the main item to prevent background color change */
.choice-item:hover {
    background-color: var(--bg-light); /* Keeps the background consistent */
}

.choice-item.selected {
    /* Keep the border highlight, but not the background */
    border-color: var(--accent-primary);
}

.choice-item.selected .choice-item-header {
    border-bottom: 2px solid var(--accent-primary);
}