:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #bb86fc;
    --card-bg: #1e1e1e;
    --error-color: #cf6679;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

header {
    background: linear-gradient(135deg, #1a1a1a, #2a1a2a);
    padding: 1rem 0;
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

#status-bar,
#xp-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.separator {
    color: #555;
    font-size: 1.2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

/* Generation Selector */
.generation-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* Removed bg and padding to fit in stats-row */
    height: 100%;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #2a2a2a;
    border-radius: 4px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-divider {
    color: #555;
    font-size: 1.2rem;
    font-weight: lighter;
}

#gen-display-wrapper {
    font-size: 1rem;
    color: #ccc;
}

/* Generation Text Display (at top of page) */
.generation-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.gen-label {
    color: #888;
}

.gen-value {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Bloodline Text Display (at top of page) */
.bloodline-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid #444;
}

.bloodline-label {
    color: #888;
}

.bloodline-value {
    color: var(--gold, #d4af37);
    font-weight: bold;
}

.bloodline-separator {
    color: #555;
}

.bloodline-description {
    color: #aaa;
    font-style: italic;
    font-size: 0.9em;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Archetype Selector */
.archetype-selector {
    display: flex;
    flex-direction: column;
    /* Desc below */
    gap: 0.5rem;
    background: #2a2a2a;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    flex-grow: 1;
}

.arch-dropdown {
    background: #333;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 4px;
    border-radius: 4px;
}

.arch-desc {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
    min-height: 1.2em;
    /* Prevent jump */
}

/* Clan Selector */
#clan-container {
    background: #2a2a2a;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    height: 100%;
}

.clan-selector-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.selector-item {
    display: flex;
    flex-direction: column;
}

.discipline-display {
    border-top: 1px solid #444;
    padding-top: 0.25rem;
    font-size: 0.9rem;
    color: #ddd;
}

.label-small {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
}

.disc-list {
    font-weight: bold;
    color: var(--accent-color, #bb86fc);
}

.dots-container {
    display: flex;
    gap: 4px;
}

.gen-dot {
    width: 16px;
    height: 16px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.gen-dot.active {
    background-color: var(--accent-color);
}

/* XP Tracker */
#xp-container {
    gap: 1rem;
    justify-content: flex-end;
}

.xp-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #2a2a2a;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #444;
    min-width: 80px;
}

.xp-box.highlight {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(187, 134, 252, 0.2);
}

.xp-box.awarded {
    border-color: #22c55e;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.2);
}

.xp-box.awarded .xp-value {
    color: #4ade80;
}

.xp-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #fff;
}

.xp-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
}

/* Attributes */
.attr-category {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attr-main-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.header-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.attr-main-row h3 {
    margin: 0;
    color: var(--accent-color);
}

.cap-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.cap-btn {
    background: #333;
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cap-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cap-bonus-display {
    min-width: 16px;
    text-align: center;
    font-weight: bold;
    color: var(--accent-color);
}

.generation-bonus-tracker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(187, 134, 252, 0.1);
    border: 1px solid rgba(187, 134, 252, 0.3);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.generation-bonus-tracker .bonus-label {
    font-size: 0.85rem;
    color: #aaa;
}

.generation-bonus-tracker .bonus-value {
    font-weight: bold;
    color: var(--accent-color);
}

.dots-row {
    display: flex;
    gap: 2px;
}

.attr-dot {
    width: 12px;
    height: 12px;
    border: 1px solid #555;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.attr-dot:hover:not(.unaffordable) {
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    z-index: 20;
}

.attr-dot.filled {
    border-color: #555;
    /* Default fallback */
}

/* Visual Colors for Free/Purchased Dots */
.attr-dot.free {
    background-color: #9c27b0;
    /* Purple - filled */
    border-color: #9c27b0;
}

.attr-dot.free:hover:not(.unaffordable) {
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.8);
}

.attr-dot.spent {
    background-color: #fff;
    /* White - filled */
    border-color: #fff;
    border-width: 2px;
}

.attr-dot.spent:hover:not(.unaffordable) {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.focus-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    align-items: center;
}

.focus-item {
    font-size: 0.9rem;
    padding: 4px 8px;
    background: #333;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
}

.focus-item.selected {
    background: rgba(187, 134, 252, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Focus Tooltips */
.focus-item {
    position: relative;
}

.focus-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 0.75rem;
    background: linear-gradient(135deg, #2a1a3a, #1a1a2a);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.8rem;
    line-height: 1.4;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-align: left;
}

.focus-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--accent-color);
}

.focus-item:hover .focus-tooltip {
    display: block;
}

/* Lock Free Dots Button */
.lock-free-dots-btn {
    background: linear-gradient(135deg, var(--accent-color), #9c27b0);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    margin-left: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lock-free-dots-btn:hover {
    background: linear-gradient(135deg, #9c27b0, var(--accent-color));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.lock-indicator {
    margin-left: 1rem;
    font-size: 0.85rem;
    font-weight: bold;
}

.lock-indicator.locked {
    color: #4ade80;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.skill-column h3 {
    margin-top: 0;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
    color: #999;
}

.skill-row {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    /* Retained from original .skill-row */
    border-bottom: 1px solid #222;
    /* Retained from original .skill-row */
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.specialty-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
    border-left: 2px solid #444;
}

.spec-input {
    background: #222;
    border: 1px solid #444;
    color: #eee;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 2px;
}

.spec-input.invalid {
    border-color: #cf6679;
}

/* Merit-granted specialty inputs - Gold border */
.spec-input.merit-granted {
    border-color: #FFD700;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
}

.skill-name {
    font-size: 0.9rem;
    color: #ccc;
}

.skill-dots {
    display: flex;
    gap: 2px;
}

.skill-dot {
    width: 10px;
    height: 10px;
    border: 1px solid #555;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: all 0.2s ease;
}

.skill-dot:hover:not(.unaffordable) {
    transform: scale(1.5);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    z-index: 20;
}

.skill-dot.filled {
    border-color: #555;
    /* Default */
}

/* Free and Purchased dots for skills */
.skill-dot.free {
    background-color: #9c27b0;
    /* Purple - filled */
    border-color: #9c27b0;
}

.skill-dot.free:hover:not(.unaffordable) {
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.8);
}

.skill-dot.spent {
    background-color: #fff;
    /* White - filled */
    border-color: #fff;
    border-width: 2px;
}

.skill-dot.spent:hover:not(.unaffordable) {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Backgrounds */
.backgrounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.background-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #222;
    border-radius: 4px;
    border: 1px solid #333;
}

.bg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bg-descriptions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid #444;
}

.bg-input-row {
    width: 100%;
}

.bg-desc-input {
    width: 90%;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #eee;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 2px;
}

.dots-container.read-only {
    opacity: 0.7;
    pointer-events: none;
}

.dot.locked {
    cursor: default;
}

.dot {
    width: 12px;
    height: 12px;
    border: 1px solid #555;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot:hover:not(.unaffordable) {
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    z-index: 20;
}

.dot.filled {
    border-color: #555;
}

.dot.free {
    background-color: #9c27b0;
    /* Purple - filled */
    border-color: #9c27b0;
}

.dot.free:hover:not(.unaffordable) {
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.8);
}

.dot.spent {
    background-color: #fff;
    /* White - filled */
    border-color: #fff;
    border-width: 2px;
}

.dot.spent:hover:not(.unaffordable) {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Merit-granted dots - Gold */
.dot.merit,
.skill-dot.merit,
.attr-dot.merit {
    background-color: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.dot.merit:hover:not(.unaffordable),
.skill-dot.merit:hover:not(.unaffordable),
.attr-dot.merit:hover:not(.unaffordable) {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.9);
    transform: scale(1.4);
}

/* Merit note banner (similar to "Free Dots Saved") */
.merit-note {
    color: #FFD700;
    font-style: italic;
    font-weight: bold;
    margin-left: 15px;
    font-size: 0.9em;
}

/* Merit-granted focus */
.focus-item.merit-focus {
    color: #FFD700;
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    font-weight: bold;
}

/* XP Affordance - Unaffordable Dots */
.dot.unaffordable,
.attr-dot.unaffordable,
.skill-dot.unaffordable {
    cursor: not-allowed;
    border-color: var(--error-color) !important;
    background-color: transparent !important;
    opacity: 0.6;
    box-shadow: 0 0 4px rgba(207, 102, 121, 0.5);
}

/* Restricted dots (out-of-clan during character creation) */
.dot.restricted {
    opacity: 0.3;
    cursor: not-allowed;
    border: 1px dashed #666 !important;
}

.dot.restricted:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Restricted dropdown options */
option.restricted-option {
    color: #666;
    font-style: italic;
}

option.restricted-option:disabled {
    opacity: 0.5;
}

.dot.unaffordable:hover,
.attr-dot.unaffordable:hover,
.skill-dot.unaffordable:hover {
    transform: none;
    box-shadow: 0 0 8px rgba(207, 102, 121, 0.8);
}

/* Disciplines */
.disciplines-section {
    padding: 1rem;
}

.disc-group {
    margin-bottom: 1.5rem;
}

.disc-group h4 {
    margin: 0 0 0.5rem 0;
    color: #999;
    border-bottom: 1px solid #333;
    padding-bottom: 0.25rem;
}

.disc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.disc-item {
    background: #222;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #333;
}

.disc-item.in-clan {
    border-left: 3px solid var(--accent-color);
}

.disc-item.out-clan {
    border-left: 3px solid var(--error-color);
}

.disc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.disc-name {
    font-size: 0.9rem;
    color: #ccc;
}

.caitiff-selector {
    background: #2a2a2a;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 2px solid var(--accent-color);
}

.caitiff-selector h4 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
}

.caitiff-dropdowns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.caitiff-disc-select {
    background: #333;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 0.5rem;
    border-radius: 4px;
    flex: 1;
    min-width: 150px;
}

.add-discipline {
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px dashed #555;
    border-radius: 4px;
}

.add-disc-select {
    background: #333;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 0.5rem;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
}

.validation-warning {
    background: rgba(207, 102, 121, 0.2);
    border: 1px solid var(--error-color);
    border-radius: 4px;
    padding: 0.75rem;
    margin-top: 1rem;
    color: var(--error-color);
    font-weight: bold;
    text-align: center;
}

/* Merits and Flaws */
.merits-flaws-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1rem;
}

.merits-section,
.flaws-section {
    background: #222;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #333;
}

.merits-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
}

.flaws-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--error-color);
}

.points-display {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1rem;
    font-weight: bold;
}

.selected-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.merit-item,
.flaw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #444;
}

.merit-name,
.flaw-name {
    flex: 1;
    font-size: 0.9rem;
}

.merit-cost,
.flaw-cost {
    font-size: 0.85rem;
    color: #999;
    margin-right: 0.5rem;
}

.remove-btn {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #d32f2f;
}

.add-section select {
    width: 100%;
    background: #333;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.add-section select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Submit to Storyteller Button */
.submit-btn {
    background: linear-gradient(135deg, var(--accent-color), #9c27b0);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #9c27b0, var(--accent-color));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

.merits-flaws-btn {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.merits-flaws-btn:hover {
    background: linear-gradient(135deg, #8e24aa, #6a1b9a);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.in-the-blood-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.in-the-blood-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Penance Styles */

/* Character Page Penance Display */
.penance-display {
    margin: 1rem 0;
}

.penance-section {
    background: rgba(207, 102, 121, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.penance-section h3 {
    margin: 0 0 1rem 0;
    color: var(--error-color);
    font-size: 1.2rem;
}

.penance-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.penance-item {
    background: #1a1a1a;
    border-left: 4px solid var(--error-color);
    border-radius: 4px;
    padding: 1rem;
}

.penance-item.minor {
    border-left-color: #ff9800;
}

.penance-item.major {
    border-left-color: var(--error-color);
}

.penance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.penance-type {
    font-weight: bold;
    color: var(--error-color);
}

.penance-item.minor .penance-type {
    color: #ff9800;
}

.penance-date {
    font-size: 0.85rem;
    color: #999;
}

.penance-description {
    margin: 0.5rem 0;
    color: #ccc;
    line-height: 1.5;
}

.penance-st {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

/* ST Dashboard Penance Management */
.penance-management-section {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 2rem;
}

.penance-management-section h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.penance-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
}

.penance-form input,
.penance-form select,
.penance-form textarea {
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.penance-form input:focus,
.penance-form select:focus,
.penance-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.penance-form textarea {
    resize: vertical;
}

/* Clan and Bloodline Description Styles */
.clan-desc,
.bloodline-desc {
    margin: 10px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
    font-style: italic;
}

.bloodline-desc {
    border-left-color: #764ba2;
    background: rgba(118, 75, 162, 0.1);
}

/* Thaumaturgy Path Selector */
.thaum-path-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(187, 134, 252, 0.1);
    border-radius: 4px;
}

.thaum-path-selector label {
    font-size: 0.85rem;
    color: #aaa;
    font-weight: bold;
}

.thaum-path-select {
    background: #333;
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    flex: 1;
    font-size: 0.85rem;
}

.thaum-path-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(187, 134, 252, 0.3);
}

/* Discipline Powers Display */
.discipline-powers {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-left: 2px solid #555;
}

.power-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.power-level {
    color: var(--accent-color);
    font-weight: bold;
    flex-shrink: 0;
}

.power-name {
    color: #ddd;
    font-weight: bold;
    flex-shrink: 0;
}

.power-desc {
    color: #999;
    font-style: italic;
}

/* Enhanced Power Descriptions */
.power-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.power-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.4rem;
    background: #1a1a1a;
    border-radius: 4px;
    border-left: 2px solid var(--accent-color);
}

.power-level {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75rem;
}

.power-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

/* Thaumaturgy specific styles */
.thaumaturgy-special,
.necromancy-special {
    grid-column: 1 / -1;
}

.thaum-paths,
.necro-paths {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.thaum-path-row,
.necro-path-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #333;
}

.thaum-path-select,
.necro-path-select {
    background: #333;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.thaum-path-label,
.necro-path-label {
    font-weight: bold;
    color: var(--accent-color);
    padding: 0.4rem;
}

.thaum-path-label.locked,
.necro-path-label.locked {
    opacity: 0.8;
}

/* Primary Path Star Indicator */
.primary-star {
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
    user-select: none;
}

.primary-star:hover {
    color: #ffd700;
}

.primary-star.active {
    color: #ffd700;
}

/* Save Primary Path Button */
.save-primary-path-container {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

.save-primary-path-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-primary-path-btn:hover {
    background: linear-gradient(135deg, #ffb700, #ff9500);
    transform: translateY(-1px);
}

/* Primary Path Locked Badge */
.primary-locked-badge {
    font-size: 0.75rem;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

/* ========== NECROMANCY STYLING ========== */

/* Necromancy Skull Primary Path Indicator */
.primary-skull {
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.3rem;
    user-select: none;
    filter: grayscale(0.5);
}

.primary-skull:hover {
    filter: grayscale(0);
}

.primary-skull.active {
    filter: grayscale(0);
}

/* Necromancy Save Primary Path Button */
.save-primary-necro-container {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(100, 80, 150, 0.15);
    border-radius: 4px;
    border: 1px dashed rgba(138, 43, 226, 0.4);
}

.save-primary-necro-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-primary-necro-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    transform: translateY(-1px);
}

/* Necromancy Locked Badge */
.necro-locked-badge {
    font-size: 0.75rem;
    background: rgba(138, 43, 226, 0.2);
    color: #a78bfa;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

/* Necromancy Rituals Section */
.necro-rituals {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(138, 43, 226, 0.3);
}

/* Distribution Hint */
.distribution-hint {
    grid-column: 1 / -1;
    /* Span all columns in grid */
    padding: 0 0 0.5rem 0;
    margin: 0;
    background: transparent;
    border: none;
    font-style: italic;
    color: #ffffff;
}

.distribution-hint .hint {
    color: #ffffff;
    font-size: 0.9rem;
    font-style: italic;
}

/* General hint styling */
.hint {
    font-style: italic;
}

.downtime-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.downtime-btn:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.challenge-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.challenge-btn:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Finalize Creation Button */
.btn-finalize {
    background-color: #2e7d32;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 1rem;
    align-self: center;
    transition: background-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-finalize:hover {
    background-color: #388e3c;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

/* Ensure XP container aligns items */
#xp-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Standardized Distribution Hint */
.distribution-hint {
    color: #cccccc;
    font-style: italic;
    font-size: 0.9em;
    margin-bottom: 8px;
    margin-left: 2px;
}

/* Ensure consistent Dot Free vs Spent styling */
/* Generic Dot */
.dot.filled,
.attr-dot.filled,
.skill-dot.filled {
    background-color: #e0e0e0 !important;
    /* Force White/Light Grey for SPENT */
    border: none !important;
    /* Remove outline look */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.dot.filled.free,
.attr-dot.filled.free,
.skill-dot.filled.free {
    background-color: #9c27b0 !important;
    /* Purple for FREE (Restore Priority) */
    box-shadow: 0 0 8px #9c27b0;
    border-color: #ba68c8 !important;
}

/* Gold styling for MERIT-GRANTED dots */
.dot.filled.merit,
.attr-dot.filled.merit,
.skill-dot.filled.merit {
    background-color: #FFD700 !important;
    /* Gold for MERIT-GRANTED */
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
    border-color: #FFA500 !important;
}

/* Ensure empty dots are distinct */
.dot.empty,
.attr-dot.empty,
.skill-dot.empty {
    background: transparent;
    border: 1px solid #444;
    /* Dark grey border */
}

/* Discipline Power Info */
.power-info {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(50, 50, 60, 0.5), rgba(30, 30, 40, 0.5));
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

.powers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.powers-list .power-info {
    margin-top: 0;
    /* Remove margin when inside powers-list since gap handles it */
}

.power-name {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.power-desc {
    color: #ccc;
    font-style: italic;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.power-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.power-focus {
    color: #60a5fa;
    /* Blue for focus */
    cursor: help;
}

.power-focus:hover {
    text-decoration: underline dotted;
}

.power-cost {
    color: #f87171;
    /* Red for blood cost */
}

.power-buff {
    color: #4ade80;
    /* Green for buff/effect */
}

/* Thaumaturgy and Necromancy path rows with power info */
.thaum-path-row,
.necro-path-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.thaum-path-row:last-child,
.necro-path-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Thaumaturgy Rituals Section */
.thaum-rituals {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.rituals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rituals-title {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 1rem;
}

.rituals-count {
    font-size: 0.85rem;
    color: #888;
    background: #222;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.ritual-hint {
    font-style: italic;
    color: #888;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.ritual-level {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.ritual-level.locked {
    opacity: 0.6;
}

.ritual-level-header {
    font-weight: bold;
    color: #9966ff;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(153, 102, 255, 0.3);
}

.ritual-locked-msg {
    font-style: italic;
    color: #666;
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

.ritual-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ritual-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    border: 1px solid transparent;
}

.ritual-item.known {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
}

.ritual-item.unavailable {
    opacity: 0.5;
}

.ritual-info {
    flex: 1;
    min-width: 0;
}

.ritual-name {
    display: block;
    font-weight: bold;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.ritual-item.known .ritual-name {
    color: #4ade80;
}

.ritual-desc {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.3;
}

.ritual-add-btn,
.ritual-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ritual-add-btn {
    background: #4ade80;
    color: #000;
}

.ritual-add-btn:hover {
    background: #22c55e;
    transform: scale(1.1);
}

.ritual-remove-btn {
    background: #f87171;
    color: #000;
}

.ritual-remove-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.ritual-blocked {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: help;
    flex-shrink: 0;
}

/* Merit Choice Modal */
.merit-choice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.merit-choice-modal.hidden {
    display: none;
}

.merit-choice-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.merit-choice-content {
    position: relative;
    background: #1a1a2e;
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.merit-choice-content h2 {
    color: #FFD700;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.merit-choice-description {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.merit-choice-description strong {
    color: #FFD700;
}

.merit-choice-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.merit-choice-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.merit-choice-option:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.merit-choice-option input[type="radio"] {
    accent-color: #FFD700;
    width: 18px;
    height: 18px;
}

.merit-choice-option span {
    color: #fff;
    font-size: 1rem;
}

.merit-choice-buttons {
    display: flex;
    justify-content: center;
}

.merit-choice-confirm {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.merit-choice-confirm:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.merit-choice-confirm:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* ========== TECHNIQUES GRID ========== */

.techniques-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.techniques-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    color: #aaa;
}

.techniques-info strong {
    color: var(--accent-color);
}

.tech-slots-label {
    background: #222;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.tech-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
}

/* Header row */
.tech-header-row {
    display: grid;
    grid-template-columns: 36px 1fr 1.2fr 60px;
    gap: 1px;
    background: rgba(100, 60, 140, 0.25);
    border-bottom: 2px solid #4a2e5c;
}

.tech-header-row .tech-cell {
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #b399d4;
    padding: 0.5rem 0.5rem;
}

/* Data rows */
.tech-row {
    display: grid;
    grid-template-columns: 36px 1fr 1.2fr 60px;
    gap: 1px;
    background: rgba(20, 20, 30, 0.6);
    transition: background 0.15s ease;
}

.tech-row:not(.tech-header-row):hover {
    background: rgba(40, 30, 60, 0.5);
}

.tech-cell {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.tech-cell-slot {
    justify-content: center;
    font-weight: bold;
    color: #666;
    font-size: 0.8rem;
}

.tech-cell-name {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.2rem;
}

.tech-cell-reqs {
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tech-cell-action {
    justify-content: center;
}

/* Purchased row styling */
.tech-row-purchased {
    background: rgba(74, 222, 128, 0.06);
    border-left: 3px solid #4ade80;
}

.tech-row-purchased .tech-cell-slot {
    color: #4ade80;
}

.tech-purchased-name {
    font-weight: bold;
    color: #4ade80;
    font-size: 0.9rem;
}

/* Empty row styling */
.tech-row-empty {
    border-left: 3px solid transparent;
}

.tech-row-selected {
    border-left-color: var(--accent-color);
    background: rgba(100, 60, 140, 0.1);
}

/* Technique description text */
.tech-desc {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    line-height: 1.3;
}

/* Dropdown styling */
.tech-slot-select {
    width: 100%;
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #444;
    padding: 0.35rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.tech-slot-select:hover {
    border-color: #666;
}

.tech-slot-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 4px rgba(187, 134, 252, 0.3);
}

/* Requirement badges */
.tech-req-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tech-req-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.tech-req-badge.req-met {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.tech-req-badge.req-missing {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.tech-req-badge.req-owned {
    background: rgba(187, 134, 252, 0.15);
    color: #b399d4;
    border: 1px solid rgba(187, 134, 252, 0.2);
}

.tech-req-badge .req-current {
    font-weight: normal;
    opacity: 0.7;
    font-size: 0.7rem;
}

.tech-reqs-empty {
    font-size: 0.75rem;
    color: #555;
    font-style: italic;
}

/* Action buttons */
.tech-learn-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tech-learn-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.tech-remove-btn {
    width: 26px;
    height: 26px;
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tech-remove-btn:hover {
    background: #f87171;
    color: #000;
    transform: scale(1.1);
}

.tech-action-blocked {
    font-size: 1rem;
    cursor: help;
    opacity: 0.6;
}