/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    min-height: 100vh;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-character-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
    align-items: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.validation-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    cursor: help;
    transition: all 0.3s ease;
    position: relative;
}

.validation-indicator:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#validation-icon {
    font-size: 14px;
    line-height: 1;
}

.validation-indicator.valid #validation-icon {
    color: #4CAF50;
}

.validation-indicator.invalid #validation-icon {
    color: #f44336;
}

.validation-indicator.checking #validation-icon {
    color: #FF9800;
    animation: spin 1s linear infinite;
}

.validation-messages {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 250px;
    font-size: 0.75rem;
    line-height: 1.2;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.25rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
}

.validation-message {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border-left: 3px solid;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.validation-message.error {
    border-left-color: #f44336;
    color: #d32f2f;
    background: rgba(244, 67, 54, 0.1);
}

.validation-message.warning {
    border-left-color: #FF9800;
    color: #e65100;
    background: rgba(255, 152, 0, 0.1);
}

.validation-message .element {
    font-weight: 600;
}

.validation-message .issue {
    font-style: italic;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}



/* Powers Page Styles */
.powers-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.powers-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.powers-header h3 {
    color: #2a5298;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.powers-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.power-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

/* D&D 4e Power Type Colors */
.tab-btn[data-type="at-will"] {
    border-left: 4px solid #4CAF50;
}

.tab-btn[data-type="at-will"]:hover {
    border-left-color: #45a049;
}

.tab-btn[data-type="at-will"].active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.tab-btn[data-type="encounter"] {
    border-left: 4px solid #f44336;
}

.tab-btn[data-type="encounter"]:hover {
    border-left-color: #d32f2f;
}

.tab-btn[data-type="encounter"].active {
    background: #f44336;
    border-color: #f44336;
}

.tab-btn[data-type="daily"] {
    border-left: 4px solid #9e9e9e;
}

.tab-btn[data-type="daily"]:hover {
    border-left-color: #757575;
}

.tab-btn[data-type="daily"].active {
    background: #9e9e9e;
    border-color: #9e9e9e;
}

.tab-btn[data-type="utility"] {
    border-left: 4px solid #ff9800;
}

.tab-btn[data-type="utility"]:hover {
    border-left-color: #f57c00;
}

.tab-btn[data-type="utility"].active {
    background: #ff9800;
    border-color: #ff9800;
}

.powers-display {
    margin-bottom: 2rem;
}

.powers-list {
    display: grid;
    gap: 1rem;
}

.power-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* D&D 4e Power Card Color Coding */
.power-card[data-power-type="at-will"] {
    border-top: 4px solid #4CAF50;
}

.power-card[data-power-type="encounter"] {
    border-top: 4px solid #f44336;
}

.power-card[data-power-type="daily"] {
    border-top: 4px solid #9e9e9e;
}

.power-card[data-power-type="utility"] {
    border-top: 4px solid #ff9800;
}

.power-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.power-card.selected {
    border-color: #4CAF50;
    background: #f8fff8;
}

.power-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.power-card.disabled .power-select-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

.power-limits-info {
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.power-limits-info p {
    margin: 0;
    font-weight: 500;
}

.power-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.power-name {
    color: #2a5298;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.power-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.power-type,
.power-action,
.power-attack,
.power-level {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
}

.power-type {
    background: #e3f2fd;
    color: #1976d2;
}

/* D&D 4e Power Type Badge Colors */
.power-type-badge.at-will {
    background: #4CAF50;
    color: white;
}

.power-type-badge.encounter {
    background: #f44336;
    color: white;
}

.power-type-badge.daily {
    background: #9e9e9e;
    color: white;
}

.power-type-badge.utility {
    background: #ff9800;
    color: white;
}

.power-action {
    background: #fff3e0;
    color: #f57c00;
}

.power-attack {
    background: #f3e5f5;
    color: #7b1fa2;
}

.power-level {
    background: #e8f5e8;
    color: #388e3c;
}

.power-description {
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.power-description p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    white-space: pre-line;
}

.power-mechanic {
    margin: 0.25rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.power-mechanic:last-child {
    border-bottom: none;
}

.power-mechanic strong {
    color: #2a5298;
    font-weight: 600;
    margin-right: 0.5rem;
}

.power-details {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.power-prerequisites,
.power-source,
.power-reference {
    margin-bottom: 0.5rem;
}

.power-prerequisites strong,
.power-source strong,
.power-reference strong {
    color: #333;
    font-weight: 600;
}

.power-reference a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 500;
}

.power-reference a:hover {
    text-decoration: underline;
    color: #1e3a8a;
}

.power-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.power-select-btn,
.power-details-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid #2a5298;
    color: #2a5298;
}

.btn-outline:hover {
    background: #2a5298;
    color: white;
}

.no-powers {
    text-align: center;
    padding: 2rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.no-powers h4 {
    color: #495057;
    margin-bottom: 1rem;
}

.no-powers p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.no-powers strong {
    color: #495057;
}

.no-powers em {
    color: #6c757d;
    font-style: italic;
}

.no-powers p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.no-powers h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.no-powers .btn {
    margin-top: 1rem;
}

.selected-powers-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.selected-powers-section h4 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.selected-powers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selected-power-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
}

.selected-power-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selected-power-info strong {
    color: #2a5298;
    font-weight: 600;
}

.power-type-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #f44336;
    background: #ffebee;
    border-radius: 8px;
}

.error-message p {
    margin: 0;
    font-size: 1.1rem;
}

/* Modal styles for power details */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    color: #2a5298;
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}



@media (max-width: 768px) {
    .powers-container {
        padding: 1rem;
    }
    
    .power-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .power-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .power-meta {
        justify-content: flex-start;
    }
    
    .power-actions {
        justify-content: flex-start;
    }
    
    .selected-power-item {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* Feats Page Styles */
.feats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.feats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.feats-header h3 {
    color: #2a5298;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.feat-slots-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.slots-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.slots-display span:first-child {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.slots-count {
    font-size: 2rem;
    font-weight: 700;
    color: #2a5298;
}

.selected-count {
    font-size: 2rem;
    font-weight: 700;
    color: #4CAF50;
}

.feat-slots-explanation {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.feat-slots-explanation h4 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feat-status-available,
.feat-status-unavailable {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.feat-status-available {
    background: #e8f5e8;
    border: 1px solid #4CAF50;
    color: #2e7d32;
}

.feat-status-unavailable {
    background: #fff3e0;
    border: 1px solid #ff9800;
    color: #e65100;
}

.status-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.status-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.next-feat-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.feat-slots-explanation ul {
    list-style: none;
    padding: 0;
}

.feat-slots-explanation li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.feat-slots-explanation li strong {
    color: #2a5298;
    font-weight: 600;
}

.no-feats-message {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.message-content h4 {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.message-content p {
    color: #888;
    line-height: 1.6;
}

.available-feats-section {
    margin-bottom: 2rem;
}

.feats-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

.feat-tier-group {
    margin-bottom: 2rem;
}

.tier-header {
    color: #2a5298;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.tier-feats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1rem;
}

.feat-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.feat-item:hover {
    border-color: #2a5298;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.15);
    transform: translateY(-2px);
}

.feat-item.selected {
    border-color: #4CAF50;
    background: #f8fff8;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.feat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.feat-name {
    color: #2a5298;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.feat-type {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.feat-prerequisites {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fff3e0;
    border-radius: 4px;
    border-left: 3px solid #ff9800;
}

.feat-prerequisites strong {
    color: #e65100;
    font-weight: 600;
}

.feat-benefit {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feat-benefit strong {
    color: #2a5298;
    font-weight: 600;
}

.feat-actions {
    display: flex;
    justify-content: flex-end;
}

.no-feats-available {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.selected-feats-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.selected-feats-section h4 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.selected-feats-list {
    min-height: 100px;
}

.no-selected-feats {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-style: italic;
}

.selected-feat-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: #f8fff8;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.selected-feat-info {
    flex: 1;
}

.selected-feat-info .feat-name {
    font-weight: 600;
    color: #2a5298;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.selected-feat-info .feat-type {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.selected-feat-info .feat-description {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
    max-height: 100px;
    overflow-y: auto;
}

.selected-feat-item:last-child {
    margin-bottom: 0;
}

.selected-feat-item .feat-name {
    font-weight: 600;
    color: #2a5298;
}

.remove-feat-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .feats-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .feat-slots-info {
        gap: 1rem;
    }
    
    .feats-filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .tier-feats {
        grid-template-columns: 1fr;
    }
    
    .feat-item {
        padding: 1rem;
    }
    
    .feat-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Navigation */
.main-nav {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: fixed;
    left: 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h3 {
    color: #2a5298;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.nav-section ul {
    list-style: none;
}

.nav-section li {
    margin: 0;
}

.nav-section a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    min-height: 44px; /* Touch-friendly minimum height */
    display: flex;
    align-items: center;
}

.nav-section a:hover {
    background: rgba(42, 82, 152, 0.1);
    color: #2a5298;
    border-left-color: #2a5298;
}

.nav-section a.active {
    background: rgba(42, 82, 152, 0.15);
    color: #2a5298;
    border-left-color: #2a5298;
    font-weight: 500;
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-section a:hover {
        background: transparent;
        color: #555;
        border-left-color: transparent;
    }
    
    .nav-section a:active {
        background: rgba(42, 82, 152, 0.1);
        color: #2a5298;
        border-left-color: #2a5298;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    margin-top: 80px;
    padding: 2rem;
    background: white;
    min-height: calc(100vh - 80px);
    border-radius: 10px 0 0 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

.subsection {
    display: none;
}

.subsection.active {
    display: block;
}

.subsection h2 {
    color: #2a5298;
    font-size: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.subsection p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

/* Welcome Screen */
#welcome {
    text-align: center;
    padding: 4rem 2rem;
}

#welcome h2 {
    font-size: 2.5rem;
    color: #2a5298;
    margin-bottom: 1rem;
}

#welcome p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .main-nav {
        width: 320px;
    }
    
    .main-content {
        margin-left: 320px;
        padding: 3rem;
    }
    
    .app-header {
        padding: 1.5rem 3rem;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .subsection h2 {
        font-size: 2.5rem;
    }
    
    .subsection p {
        font-size: 1.2rem;
    }
}

/* Medium Desktop (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .main-nav {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
        padding: 2rem;
    }
}

/* Small Desktop/Tablet Landscape (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .main-nav {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
        padding: 1.5rem;
    }
    
    .app-header {
        padding: 1rem 1.5rem;
    }
    
    .app-header h1 {
        font-size: 1.3rem;
    }
    
    .nav-section h3 {
        font-size: 1rem;
        padding: 0.5rem 1.2rem;
    }
    
    .nav-section a {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Tablet Portrait (481px to 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .app-container {
        flex-direction: column;
    }
    
    .main-nav {
        width: 100%;
        height: auto;
        position: relative;
        margin-top: 70px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding: 0.5rem 0;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
        border-radius: 0;
        padding: 1.5rem;
    }
    
    .app-header {
        padding: 0.8rem 1.5rem;
    }
    
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .header-character-info {
        font-size: 0.8rem;
        gap: 0.8rem;
    }
    
    .nav-section {
        margin-bottom: 1rem;
    }
    
    .nav-section h3 {
        padding: 0.4rem 1rem;
        font-size: 1rem;
    }
    
    .nav-section a {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .subsection h2 {
        font-size: 1.8rem;
    }
    
    .subsection p {
        font-size: 1rem;
    }
    
    #welcome h2 {
        font-size: 2rem;
    }
    
    #welcome p {
        font-size: 1.1rem;
    }
}

/* Mobile (320px to 480px) */
@media (max-width: 480px) {
    .app-container {
        flex-direction: column;
    }
    
    .main-nav {
        width: 100%;
        height: auto;
        position: relative;
        margin-top: 60px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding: 0.3rem 0;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
        border-radius: 0;
        padding: 1rem;
    }
    
    .app-header {
        padding: 0.6rem 1rem;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .header-character-info {
        font-size: 0.7rem;
        gap: 0.5rem;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .validation-messages {
        max-width: 200px;
        font-size: 0.7rem;
    }
    
    .nav-section {
        margin-bottom: 0.8rem;
    }
    
    .nav-section h3 {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .nav-section a {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .subsection h2 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }
    
    .subsection p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    #welcome {
        padding: 2rem 1rem;
    }
    
    #welcome h2 {
        font-size: 1.8rem;
    }
    
    #welcome p {
        font-size: 1rem;
    }
}

/* Extra Small Mobile (under 320px) */
@media (max-width: 319px) {
    .app-header {
        padding: 0.5rem 0.8rem;
    }
    
    .app-header h1 {
        font-size: 0.9rem;
    }
    
    .header-character-info {
        font-size: 0.6rem;
    }
    
    .main-content {
        padding: 0.8rem;
    }
    
    .nav-section a {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .subsection h2 {
        font-size: 1.3rem;
    }
    
    .subsection p {
        font-size: 0.8rem;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .app-header {
        padding: 0.4rem 1rem;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .main-nav {
        margin-top: 50px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .subsection h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .subsection p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

/* Scrollbar Styling */
.main-nav::-webkit-scrollbar {
    width: 6px;
}

.main-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.main-nav::-webkit-scrollbar-thumb {
    background: rgba(42, 82, 152, 0.3);
    border-radius: 3px;
}

.main-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(42, 82, 152, 0.5);
}

/* Responsive utilities for future content */
.responsive-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.responsive-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.responsive-flex > * {
    flex: 1 1 300px;
    min-width: 0;
}

/* Mobile-first responsive tables */
.responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.responsive-table table {
    min-width: 600px;
    width: 100%;
}

/* Responsive form elements */
.responsive-form {
    display: grid;
    gap: 1rem;
}

.responsive-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.responsive-form label {
    font-weight: 500;
    color: #333;
}

.responsive-form input,
.responsive-form select,
.responsive-form textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-height: 44px; /* Touch-friendly */
}

.responsive-form input:focus,
.responsive-form select:focus,
.responsive-form textarea:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

/* Responsive buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly */
    min-width: 44px; /* Touch-friendly */
}

.btn-primary {
    background: #2a5298;
    color: white;
}

.btn-primary:hover {
    background: #1e3c72;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Responsive card layout */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2a5298;
    margin: 0;
}

.deity-count {
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
    margin-left: 0.5rem;
}

/* Responsive breakpoint utilities */
@media (max-width: 767px) {
    .responsive-grid {
        grid-template-columns: 1fr;
    }
    
    .responsive-flex {
        flex-direction: column;
    }
    
    .responsive-flex > * {
        flex: 1 1 auto;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Class Header Section with Toggle */
.class-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.class-header-section h2 {
    margin: 0;
    color: #2a5298;
}

.hybrid-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #ff6b35;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Responsive adjustments for toggle */
@media (max-width: 767px) {
    .class-header-section {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .hybrid-toggle {
        align-self: flex-end;
    }
}

/* Hybrid Class Styling */
.hybrid-class {
    border-left: 4px solid #ff6b35 !important;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 100%);
}

.hybrid-class:hover {
    border-color: #ff6b35 !important;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.hybrid-badge {
    background: #ff6b35;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.hybrid-class .class-info p strong {
    color: #ff6b35;
}

.hybrid-class .btn-primary {
    background: #ff6b35;
    border-color: #ff6b35;
}

.hybrid-class .btn-primary:hover {
    background: #e55a2b;
    border-color: #e55a2b;
}

.hybrid-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 100%);
    border: 1px solid #ff6b35;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.hybrid-info h4 {
    color: #ff6b35;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.hybrid-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hybrid-info li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.hybrid-info li strong {
    color: #ff6b35;
}

/* Class Selection Styles */
.class-selection h2 {
    color: #2a5298;
    margin-bottom: 0.5rem;
}

.class-selection p {
    color: #666;
    margin-bottom: 2rem;
}

.class-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #2a5298;
}

.class-card.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.selected-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
}

.class-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.class-info p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.class-info strong {
    color: #2a5298;
}

.class-actions {
    margin-top: auto;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.breadcrumb-back {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.breadcrumb-separator {
    color: #666;
    font-weight: bold;
}

.breadcrumb-current {
    color: #2a5298;
    font-weight: 600;
}

/* Class Header */
.class-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.class-description {
    font-size: 1.1rem;
    color: #666;
    margin: 1rem 0;
}

.class-details {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-role {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-source {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Choice Sections */
.choice-section {
    margin-bottom: 1.5rem;
}

.choice-options {
    display: grid;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: #f8f9fa;
    border-color: #2a5298;
}

.option-item input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #2a5298;
}

.option-item label {
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.option-item input[type="radio"]:checked + label {
    color: #2a5298;
    font-weight: 600;
}

.no-options {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Class Actions */
.class-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

/* Confirmation Screen */
.class-confirmation {
    text-align: center;
}

.confirmation-details h3 {
    color: #2a5298;
    margin-bottom: 1rem;
}

.selected-options {
    text-align: left;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.selected-options h4 {
    color: #2a5298;
    margin-bottom: 1rem;
}

.selected-options ul {
    list-style: none;
    padding: 0;
}

.selected-options li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.selected-options li:last-child {
    border-bottom: none;
}

.confirmation-actions {
    margin-top: 2rem;
}

/* Responsive adjustments for class selection */
@media (max-width: 767px) {
    .class-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .class-actions {
        flex-direction: column;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .choice-options {
        grid-template-columns: 1fr;
    }
    
    .option-item {
        padding: 1rem;
    }
}

.race-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
}

.race-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #2a5298;
}

.race-card.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.race-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.race-info p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.race-info strong {
    color: #2a5298;
}

.race-actions {
    margin-top: auto;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

/* Responsive adjustments for race cards */
@media (max-width: 767px) {
    .race-actions {
        margin-top: 2rem;
        padding-top: 2rem;
    }
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    min-height: auto;
    line-height: 1.2;
}

/* Background Selection Styles */
.background-selection {
    max-width: 1200px;
    margin: 0 auto;
}

.background-sources {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.source-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.source-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.source-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.source-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.background-count {
    font-size: 0.9rem;
    color: #6c757d;
    background: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.expand-icon {
    font-size: 0.8rem;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.background-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.background-list.expanded {
    max-height: 500px;
    overflow-y: auto;
}

.background-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.background-option:last-child {
    border-bottom: none;
}

.background-option:hover {
    background-color: #f8f9fa;
}

.background-option.selected {
    border-left: 4px solid #2196f3;
}

.background-details {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(33, 150, 243, 0.05);
    border-radius: 6px;
    border-left: 3px solid #2196f3;
    font-size: 0.9rem;
    line-height: 1.5;
}

.background-details h4 {
    margin: 0 0 0.5rem 0;
    color: #1976d2;
    font-size: 1rem;
    font-weight: 600;
}

.background-details .description {
    margin-bottom: 0.75rem;
    color: #424242;
}

.background-details .prerequisites {
    font-style: italic;
    color: #ff9800;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    border-left: 3px solid #ff9800;
}

.background-details .element-specifics {
    color: #4caf50;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #4caf50;
}

.background-option input[type="radio"] {
    margin-right: 0.75rem;
    transform: scale(1.1);
}

.background-option input[type="checkbox"] {
    margin-right: 1rem;
    transform: scale(1.1);
}

.background-option label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.background-name {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.25rem;
}

.prerequisites {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.selected-background {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.selected-background h3 {
    margin: 0 0 1rem 0;
    color: #28a745;
    font-size: 1.2rem;
}

.selected-background p {
    margin: 0.5rem 0;
    color: #495057;
}

.clear-selection {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.clear-selection:hover {
    background: #c82333;
}

.background-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.background-actions .btn {
    min-width: 200px;
}

@media (max-width: 767px) {
    .source-header {
        padding: 0.75rem 1rem;
    }
    
    .source-header h3 {
        font-size: 1rem;
    }
    
    .background-option {
        padding: 0.5rem 1rem;
    }
    
    .selected-background {
        margin-top: 1.5rem;
        padding: 1rem;
    }
}

/* Theme Section Styles */
.theme-section {
    margin-top: 2rem;
}

.theme-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.theme-header:hover {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.theme-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #155724;
}

.theme-count {
    font-size: 0.9rem;
    color: #6c757d;
    background: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.theme-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.theme-list.expanded {
    max-height: 500px;
    overflow-y: auto;
}

.theme-option {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background-color: #f8f9fa;
}

.theme-option.selected {
    border-left: 4px solid #28a745;
}

.theme-details {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 6px;
    border-left: 3px solid #28a745;
    font-size: 0.9rem;
    line-height: 1.5;
}

.theme-details h4 {
    margin: 0 0 0.5rem 0;
    color: #155724;
    font-size: 1rem;
    font-weight: 600;
}

.theme-details .description {
    margin-bottom: 0.75rem;
    color: #424242;
}

.theme-details .prerequisites {
    font-style: italic;
    color: #ff9800;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    border-left: 3px solid #ff9800;
}

.theme-details .element-specifics {
    color: #4caf50;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #4caf50;
}

.theme-option input[type="checkbox"] {
    margin-right: 1rem;
    margin-top: 0.25rem;
    transform: scale(1.1);
}

.theme-option label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.theme-name {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.25rem;
}

.theme-source {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

/* Selected Choices Styles */
.selected-choices {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.selected-section {
    margin-bottom: 1.5rem;
}

.selected-section:last-child {
    margin-bottom: 1rem;
}

.selected-section h3 {
    margin: 0 0 0.75rem 0;
    color: #007bff;
    font-size: 1.1rem;
    font-weight: 600;
}

.selected-section ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.selected-section li {
    margin-bottom: 0.25rem;
    color: #495057;
    font-size: 0.95rem;
}

.clear-selection {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.clear-selection:hover {
    background: #c82333;
}

@media (max-width: 767px) {
    .theme-header {
        padding: 0.75rem 1rem;
    }
    
    .theme-header h3 {
        font-size: 1rem;
    }
    
    .theme-option {
        padding: 0.5rem 1rem;
    }
    
    .selected-choices {
        margin-top: 1.5rem;
        padding: 1rem;
    }
}

/* Ability Scores Builder Styles */
.ability-scores-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.generation-methods {
    background: #fff;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.generation-method-display {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.generation-method-display span {
    margin-right: 10px;
    font-weight: bold;
    color: #2c3e50;
}

#current-method {
    color: #27ae60;
    font-weight: bold;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;
}

.generation-methods h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 18px;
}

.method-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.method-buttons .btn {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
}

.ability-scores-main {
    background: #fff;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.scores-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.base-scores-section h4,
.ability-scores-section h4 {
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 14px;
    border-radius: 4px;
}

.base-scores-display {
    min-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #f9f9f9;
}

.scores-header {
    display: grid;
    grid-template-columns: 80px 100px 80px 100px;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
    font-size: 12px;
    color: #2c3e50;
}

.ability-scores-display {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.ability-score-row {
    display: grid;
    grid-template-columns: 80px 100px 80px 100px;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.ability-score-row:last-child {
    border-bottom: none;
}

.score-input input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 14px;
}

.score-input input.disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.score-input input.disabled:hover {
    background-color: #f8f9fa;
}

.score-input input.point-buy-input {
    background-color: #e8f5e8;
    border: 2px solid #4CAF50;
    color: #2e7d32;
    font-weight: 500;
}

.score-input input.point-buy-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.score-input input.manual-input {
    background-color: #fff;
    border: 2px solid #2196F3;
    color: #1976d2;
}

.score-input input.manual-input:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.ability-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.ability-modifier,
.mod-plus-level {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    color: #27ae60;
}

.point-buy-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.points-left {
    background: #fff;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 20px;
}

.points-left h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 16px;
}

.points-display {
    background: #d2b48c;
    color: #000;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.points-display.negative {
    background: #e74c3c;
    color: white;
}

.cost-table {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.cost-header {
    background: #34495e;
    color: white;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.cost-row {
    padding: 4px 8px;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}

.cost-row:nth-child(even) {
    background: #f9f9f9;
}

.cost-row:last-child {
    border-bottom: none;
}

.character-info {
    background: #fff;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row strong {
    min-width: 150px;
    color: #2c3e50;
    font-size: 14px;
}

.info-row span {
    color: #7f8c8d;
    font-size: 14px;
}

.info-row select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.level-up-section {
    margin-top: 20px;
}

.level-up-section h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.level-up-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #7f8c8d;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.modal-body {
    padding: 20px;
}

.array-option {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.array-option:hover {
    background: #f0f8ff;
    border-color: #3498db;
}

.array-option strong {
    color: #2c3e50;
}

/* Responsive Design for Ability Scores */
@media (max-width: 768px) {
    .scores-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .point-buy-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .scores-header,
    .ability-score-row {
        grid-template-columns: 70px 80px 70px 80px;
        gap: 5px;
        font-size: 11px;
    }
    
    .score-input input {
        width: 50px;
        font-size: 12px;
    }
    
    .method-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .method-buttons .btn {
        width: 200px;
    }
}

/* Skills Builder Styles */
.skills-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.skill-training-section,
.skill-checklist-section {
    background: #fff;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #34495e;
}

.section-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.choices-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.choices-info span {
    font-weight: bold;
    color: #2c3e50;
}

.choices-info span.negative {
    color: #e74c3c;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;
}

.btn-small .icon {
    font-weight: bold;
    font-size: 14px;
}

/* Skill Table Styles */
.skill-table-header {
    display: grid;
    grid-template-columns: 60px 1fr 60px 120px 80px 100px 60px;
    gap: 5px;
    padding: 8px 0;
    background: #34495e;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
}

.header-cell {
    padding: 4px 8px;
    text-align: center;
}

.header-cell.name-col {
    text-align: left;
}

.skill-selections {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: none !important;
    overflow-y: visible !important;
    background: #fff;
}

.skill-row {
    display: grid;
    grid-template-columns: 60px 1fr 60px 120px 80px 100px 60px;
    gap: 5px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.skill-row:last-child {
    border-bottom: none;
}

.skill-row:hover {
    background: #f8f9fa;
}

.skill-row.selected {
    background: #4682b4;
    color: white;
}

.skill-row.trained {
    background: #e8f5e8;
}

.skill-row.trained.selected {
    background: #4682b4;
}

.skill-row.disabled {
    color: #808080;
    cursor: not-allowed;
}

.skill-cell {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.skill-cell.name-cell {
    justify-content: flex-start;
    font-weight: bold;
}

.skill-cell.trained-cell {
    color: #228b22;
    font-weight: bold;
}

.skill-row.selected .skill-cell.trained-cell {
    color: white;
}

.selection-controls {
    padding: 15px 0;
    text-align: center;
}

/* Skill Checklist Styles */
.skill-checklist-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.granted-skills,
.skill-choices {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

.granted-skills h4,
.skill-choices h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.granted-skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.granted-skill-item:last-child {
    border-bottom: none;
}

.granted-skill-item .source {
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.granted-skill-item .skill-name {
    font-weight: bold;
    color: #2c3e50;
}

.skill-choice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.skill-choice-item:last-child {
    border-bottom: none;
}

.skill-choice-item .skill-name {
    font-weight: bold;
    color: #2c3e50;
}

.remove-skill-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-skill-btn:hover {
    background: #c0392b;
}

.no-skills,
.no-choices {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive Design for Skills */
@media (max-width: 768px) {
    .skill-table-header,
    .skill-row {
        grid-template-columns: 50px 1fr 80px 60px 80px 50px;
        font-size: 11px;
    }
    
    .skill-checklist-area {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .choices-info {
        align-self: flex-end;
    }
}

/* Loading Spinner */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 15px auto;
}

.loading-spinner + p {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #7f8c8d;
    text-align: center;
}

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

/* Class Details Section */
.class-details-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.class-details-section h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.class-details-content {
    min-height: 100px;
}

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

.detail-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
}

.detail-section h4 {
    color: #2c3e50;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.detail-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-item strong {
    color: #34495e;
    font-weight: 600;
}

.detail-content {
    margin-top: 5px;
    line-height: 1.5;
    color: #2c3e50;
}

.detail-content br {
    margin-bottom: 8px;
}

.error-message {
    text-align: center;
    color: #e74c3c;
    padding: 20px;
}

.error-message p {
    margin: 0;
    font-style: italic;
}

/* Responsive Design for Class Details */
@media (max-width: 768px) {
    .class-details-section {
        margin: 20px 0;
        padding: 15px;
    }
    
    .class-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .detail-section {
        padding: 12px;
    }
    
    .detail-section h4 {
        font-size: 15px;
    }
}

/* Race Details Section */
.race-details-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.race-details-section h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.race-details-content {
    min-height: 100px;
}

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

/* Responsive Design for Race Details */
@media (max-width: 768px) {
    .race-details-section {
        margin: 20px 0;
        padding: 15px;
    }
    
    .race-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Class Feature Details */
.feature-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.feature-details h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #3498db;
    padding-bottom: 8px;
}

.feature-details-content {
    min-height: 50px;
}

.feature-detail-section {
    margin-bottom: 15px;
}

.feature-detail-section:last-child {
    margin-bottom: 0;
}

.feature-detail-section h5 {
    color: #34495e;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.feature-detail-item {
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.feature-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.feature-detail-content {
    line-height: 1.5;
    color: #2c3e50;
    font-size: 14px;
}

.feature-detail-content br {
    margin-bottom: 6px;
}

.no-details {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* No Class Message */
.no-class-message {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.message-content {
    max-width: 400px;
    margin: 0 auto;
}

.message-content h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
}

.message-content p {
    color: #7f8c8d;
    margin: 0 0 20px 0;
    line-height: 1.5;
    font-size: 14px;
}

.message-content .btn {
    margin-top: 10px;
}

/* Responsive Design for Feature Details */
@media (max-width: 768px) {
    .feature-details {
        margin-top: 10px;
        padding: 12px;
    }
    
    .feature-details h4 {
        font-size: 15px;
    }
    
    .feature-detail-section h5 {
        font-size: 13px;
    }
    
    .feature-detail-content {
        font-size: 13px;
    }
    
    .no-class-message {
        padding: 30px 15px;
        margin: 15px 0;
    }
    
    .message-content h3 {
        font-size: 16px;
    }
    
    .message-content p {
        font-size: 13px;
    }
}

/* Feature Power Tabs and Cards */
.tab-btn[data-type^="feature-"] {
    background: #e8f4fd;
    border-color: #2196F3;
    color: #1976D2;
}

.tab-btn[data-type^="feature-"]:hover {
    background: #bbdefb;
    color: #1565C0;
}

.tab-btn[data-type^="feature-"].active {
    background: #2196F3;
    color: white;
    border-color: #1976D2;
}

.power-card[data-power-type="feature-power"] {
    border-left: 4px solid #2196F3;
}

.power-type-badge.feature-power {
    background: #2196F3;
    color: white;
}

.feature-power-group-header {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.feature-power-group-header h4 {
    color: #2196F3;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.feature-power-group-header p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive adjustments for feature power tabs */
@media (max-width: 768px) {
    .tab-btn[data-type^="feature-"] {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .feature-power-group-header {
        padding: 0.75rem;
    }
    
    .feature-power-group-header h4 {
        font-size: 1.1rem;
    }
}

.class-description-html {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 20px;
    width: 100%;
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.7;
    box-shadow: 0 2px 8px rgba(44,62,80,0.03);
}
.class-description-html p {
    margin: 0 0 12px 0;
}
.class-description-html strong {
    color: #34495e;
    font-weight: 600;
}
.class-description-html em {
    color: #7f8c8d;
}
.class-description-html ul, .class-description-html ol {
    margin: 0 0 12px 20px;
}
.class-description-html h4 {
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
    margin: 18px 0 10px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.race-description-html {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 20px;
    width: 100%;
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.7;
    box-shadow: 0 2px 8px rgba(44,62,80,0.03);
}

.race-description-html p {
    margin: 0 0 12px 0;
}

.race-description-html strong {
    color: #34495e;
    font-weight: 600;
}

.race-description-html em {
    color: #7f8c8d;
}

.race-description-html ul, .race-description-html ol {
    margin: 0 0 12px 20px;
}

.race-description-html h4 {
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
    margin: 18px 0 10px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* Compendium link styling */
.compendium-link {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid #3498db;
    transition: all 0.2s ease;
}

.compendium-link:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
    text-decoration: none;
}

.compendium-link:visited {
    color: #8e44ad;
    border-bottom-color: #8e44ad;
}

/* Equipment Page Styles */
.equipment-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h2 {
    color: #2a5298;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.equipment-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.category-section h3 {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.category-item.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.item-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    flex: 1;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-row:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.item-row.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.item-name {
    font-weight: 600;
}

.item-cost,
.item-weight,
.item-type,
.item-level {
    font-size: 0.9rem;
    color: #666;
}

.item-row.selected .item-cost,
.item-row.selected .item-weight,
.item-row.selected .item-type,
.item-row.selected .item-level {
    color: rgba(255, 255, 255, 0.8);
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.equipment-section,
.equipped-section,
.item-details-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.equipment-section h3,
.equipped-section h3,
.item-details-section h3 {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

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

.equipment-section h3,
.item-details-section h3 {
    margin: 0;
}

.character-equipment,
.equipped-items,
.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-detail-content h4 {
    color: #2a5298;
    margin: 0 0 0.5rem 0;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.item-description {
    margin: 1rem 0;
    line-height: 1.5;
}

.item-prerequisites {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 0.9rem;
}

.equipment-item,
.equipped-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.equipment-item:hover,
.equipped-item:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.equipment-item.selected,
.equipped-item.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.equipment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.equipment-item .item-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.equipment-item .item-name,
.equipped-item .item-name {
    font-weight: 600;
    color: #495057;
}

.equipment-item .item-quantity,
.equipped-item .item-quantity {
    color: #666;
    font-size: 0.9rem;
}

.equipment-item .item-cost {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

.empty-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading-message p {
    margin: 0;
    font-size: 1.1rem;
}

.bottom-controls {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1rem;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.quantity-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-section label {
    font-weight: 600;
    color: #495057;
}

.quantity-section input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
}

.search-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.search-section input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-section input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

.money-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.money-breakdown {
    display: flex;
    gap: 1rem;
    color: #666;
}

.total-gold {
    font-weight: 600;
    color: #28a745;
}

@media (max-width: 768px) {
    .equipment-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .bottom-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .quantity-section {
        justify-content: center;
    }
    
    .search-section input {
        width: 100%;
    }
    
    .money-display {
        text-align: center;
    }
    
    .item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .item-cost,
    .item-weight,
    .item-type,
    .item-level {
        font-size: 0.8rem;
    }
}

/* Rituals Page Styles */
.rituals-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.top-content {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    font-weight: 600;
    color: #495057;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    min-width: 100px;
}

.free-rituals {
    color: #dc3545;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.rituals-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.books-section,
.scrolls-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.books-section h3,
.scrolls-section h3 {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.books-list,
.scrolls-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-row,
.scroll-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.book-row:hover,
.scroll-row:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.book-row.selected,
.scroll-row.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.book-name,
.scroll-name {
    font-weight: 600;
}

.book-level,
.scroll-level,
.book-cost,
.scroll-cost,
.book-time,
.scroll-time,
.book-skill,
.scroll-skill {
    font-size: 0.9rem;
    color: #666;
}

.book-row.selected .book-level,
.book-row.selected .book-cost,
.book-row.selected .book-time,
.book-row.selected .book-skill,
.scroll-row.selected .scroll-level,
.scroll-row.selected .scroll-cost,
.scroll-row.selected .scroll-time,
.scroll-row.selected .scroll-skill {
    color: rgba(255, 255, 255, 0.8);
}

.book-item,
.scroll-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.book-item .book-name,
.scroll-item .scroll-name {
    font-weight: 600;
    color: #495057;
}

.book-item .book-quantity,
.scroll-item .scroll-quantity {
    color: #666;
    font-size: 0.9rem;
}

.book-item .book-cost,
.scroll-item .scroll-cost {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .rituals-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .book-row,
    .scroll-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .book-level {
        font-size: 0.9rem;
        opacity: 0.8;
    }
    
    .book-row.selected .book-level {
        opacity: 0.9;
    }
}

/* Alchemy Page Styles */
.alchemy-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.alchemy-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.category-section h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-item:hover {
    background: #e3f2fd;
    border-color: #2a5298;
}

.category-item.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.items-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.items-section h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
}

.item-row:hover {
    background: #e3f2fd;
    border-color: #2a5298;
}

.item-row.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.item-name {
    font-weight: 600;
}

.item-level,
.item-cost,
.item-type,
.item-effect {
    font-size: 0.9rem;
    opacity: 0.8;
}

.item-row.selected .item-level,
.item-row.selected .item-cost,
.item-row.selected .item-type,
.item-row.selected .item-effect {
    opacity: 0.9;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.formulas-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.formulas-section h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.formulas-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.formula-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
}

.formula-row:hover {
    background: #e3f2fd;
    border-color: #2a5298;
}

.formula-row.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.formula-name {
    font-weight: 600;
}

.formula-level,
.formula-cost,
.formula-time,
.formula-skill {
    font-size: 0.9rem;
    opacity: 0.8;
}

.formula-row.selected .formula-level,
.formula-row.selected .formula-cost,
.formula-row.selected .formula-time,
.formula-row.selected .formula-skill {
    opacity: 0.9;
}

.item-item,
.formula-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.item-item .item-name,
.formula-item .formula-name {
    font-weight: 600;
    color: #2a5298;
}

.item-item .item-quantity,
.formula-item .formula-quantity {
    background: #2a5298;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.item-item .item-cost,
.formula-item .formula-cost {
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .alchemy-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .item-row,
    .formula-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .item-name,
    .formula-name {
        grid-column: 1 / -1;
    }
    
    .item-level,
    .item-cost,
    .item-type,
    .item-effect,
    .formula-level,
    .formula-cost,
    .formula-time,
    .formula-skill {
        font-size: 0.8rem;
    }
}

/* Companion Page Styles */
.companion-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.companion-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.companion-type-selection {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.companion-type-selection h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.type-buttons {
    display: flex;
    gap: 1rem;
}

.companion-type-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.companion-type-btn:hover {
    background: #e3f2fd;
    border-color: #2a5298;
}

.companion-type-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.companion-list-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.companion-list-section h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.companion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.companion-item {
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.companion-item:hover {
    background: #e3f2fd;
    border-color: #2a5298;
}

.companion-item.selected {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

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

.companion-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.companion-tier {
    background: #4CAF50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.companion-description {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

.companion-item.selected .companion-description {
    opacity: 0.9;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.companion-details-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.companion-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.companion-details-header h3 {
    color: #2a5298;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.companion-customization {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

.companion-description-full {
    margin-bottom: 1.5rem;
}

.companion-description-full h4 {
    color: #2a5298;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.companion-stats {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
}

.companion-stats h4 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-item {
    font-size: 0.9rem;
    line-height: 1.4;
}

.stat-item strong {
    color: #2a5298;
    font-weight: 600;
}

.current-companions-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.current-companions-section h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.companions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.current-companion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.companion-info {
    flex: 1;
}

.companion-name-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2a5298;
    margin-bottom: 0.25rem;
}

.companion-type-badge {
    background: #2a5298;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.companion-appearance-display {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.remove-companion-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.remove-companion-btn:hover {
    background: #c82333;
}

.no-selection,
.no-companions {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .companion-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .type-buttons {
        flex-direction: column;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    .companion-details-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .current-companion-item {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Martial Practices Page Styles */
.martial-practices-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.martial-practices-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.martial-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.martial-category-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.martial-category-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.martial-category-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.martial-practices-search {
    margin-bottom: 1rem;
}

.martial-practices-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.martial-practices-search input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

.martial-practices-list {
    min-height: 200px;
}

.no-categories,
.no-practices {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .martial-practices-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .martial-categories {
        justify-content: center;
    }
}

/* Level Up Page Styles */
.level-up-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.level-up-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.level-selection-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.level-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.level-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-row label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
}

.level-row select,
.level-row input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.level-row select:focus,
.level-row input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

.level-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.level-actions .btn {
    flex: 1;
}

.character-status-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.status-content h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.valid {
    background: #28a745;
    color: white;
}

.status-badge.invalid {
    background: #dc3545;
    color: white;
}

.status-errors,
.status-warnings {
    margin-bottom: 1rem;
}

.status-errors h4,
.status-warnings h4 {
    color: #2a5298;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.status-errors h4 {
    color: #dc3545;
}

.status-warnings h4 {
    color: #ffc107;
}

.status-errors ul,
.status-warnings ul {
    margin: 0;
    padding-left: 1.5rem;
}

.status-errors li,
.status-warnings li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.status-errors li {
    color: #dc3545;
}

.status-warnings li {
    color: #856404;
}

.auto-build-section {
    margin-top: 1.5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .level-up-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .level-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .level-actions {
        flex-direction: column;
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Title Page Styles */
.title-page {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.title-header {
    margin-bottom: 3rem;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2a5298;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

.title-actions {
    margin-bottom: 3rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.action-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border-color: #2a5298;
}

.action-btn.primary {
    border-color: #2a5298;
    background: linear-gradient(135deg, #2a5298, #1e3a5f);
    color: white;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #1e3a5f, #2a5298);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.action-btn.primary .btn-icon {
    background: rgba(255,255,255,0.2);
}

.btn-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.btn-text p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.action-btn.primary .btn-text p {
    color: rgba(255,255,255,0.8);
}

.title-info {
    max-width: 600px;
    margin: 0 auto;
}

.info-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.info-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-card ul {
    text-align: left;
    color: #666;
    line-height: 1.8;
}

.info-card li {
    margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .title-page {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-btn {
        padding: 1.5rem;
    }
    
    .btn-content {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
}

/* Foundry export button styling */
#foundry-export {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    border: 1px solid #E55A2B;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

#foundry-export:hover {
    background: linear-gradient(135deg, #E55A2B 0%, #D87C1A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.4);
}

#foundry-export:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

/* ---------- Skill Page Tweaks ---------- */
/* Remove internal scrolling from skill list */
.skill-selections {
    max-height: none !important;
    overflow-y: visible !important;
}

/* Stack heading and info on separate lines */
.skill-training-section .section-header {
    flex-direction: column;
    align-items: flex-start;
}

/* ---------- Array Assignment Chips ---------- */
.score-chip-bank {
    display:flex;
    gap:8px;
    margin-bottom:15px;
}
.score-chip{
   background:#34495e;
   color:#fff;
   padding:6px 12px;
   border-radius:20px;
   cursor:grab;
   user-select:none;
}
.score-chip:active{cursor:grabbing;opacity:0.7;}
.assign-table{display:flex;flex-direction:column;gap:8px;}
.assign-row{display:flex;align-items:center;gap:10px;}
.drop-slot{
   flex:1;
   min-height:32px;
   border:2px dashed #bdc3c7;
   border-radius:6px;
   display:flex;
   align-items:center;
   justify-content:center;
   transition:background 0.2s;
}
.drop-slot.highlight{background:#ecf0f1;}

/* ---------- Class List Item ---------- */
.class-list{display:flex;flex-direction:column;gap:6px;}
.class-list-item{display:flex;align-items:center;gap:16px;padding:10px 14px;border:1px solid #bdc3c7;border-radius:6px;cursor:pointer;transition:background 0.2s;}
.class-list-item:hover{background:#ecf0f1;}
.class-list-item.selected{background:#2ecc71;color:#fff;}
.class-list-item .class-name{font-weight:bold;flex:1;}
.class-list-item .class-descriptor{font-style:italic;color:#555;}
.class-list-item .select-class-btn{margin-left:auto;}
.hybrid-badge{background:#8e44ad;color:#fff;padding:2px 6px;border-radius:4px;font-size:12px;}

/* ---------- Race List ---------- */
.race-list{display:flex;flex-direction:column;gap:6px;margin-top:10px;}
.race-list-item{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid #bdc3c7;border-radius:6px;cursor:pointer;transition:background 0.2s;}
.race-list-item:hover{background:#ecf0f1;}
.race-list-item.selected{background:#3498db;color:#fff;}
.race-list-item .race-name{font-weight:bold;flex:1;}
.race-list-item .race-desc{font-style:italic;color:#555;}
.race-list-item .select-race-btn{margin-left:auto;}

.choice-options.deity-list {
    max-height: 260px;
    overflow-y: auto;
}

/* Compact Feat Display */
.feat-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 600px;
    overflow-y: auto;
}

.feat-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 3fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.feat-row:hover {
    background: #f8f9fa;
    border-color: #2a5298;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feat-row.valid {
    border-left: 4px solid #28a745;
}

.feat-row.likely-valid {
    border-left: 4px solid #ffc107;
}

.feat-row.invalid {
    border-left: 4px solid #dc3545;
    opacity: 0.6;
}

.feat-row.unknown {
    border-left: 4px solid #6c757d;
    opacity: 0.8;
}

.feat-row.selected {
    background: #e8f5e8;
    border-color: #28a745;
}

.feat-name {
    font-weight: 600;
    color: #2a5298;
    font-size: 0.9rem;
}

.feat-type, .feat-tier {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.feat-prereq {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    line-height: 1.2;
}

.feat-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.feat-status.valid { 
    color: #28a745; 
}

.feat-status.likely-valid { 
    color: #ffc107; 
}

.feat-status.invalid { 
    color: #dc3545; 
}

.feat-status.unknown { 
    color: #6c757d; 
}

.feat-actions {
    text-align: center;
}

.feat-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-height: auto;
}

/* Feat validation summary */
.feat-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.feat-summary h4 {
    color: #2a5298;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.summary-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.stat-item.valid { color: #28a745; }
.stat-item.likely-valid { color: #ffc107; }
.stat-item.invalid { color: #dc3545; }
.stat-item.unknown { color: #6c757d; }

.stat-count {
    font-weight: 600;
}

/* Feat filters for validation status */
.feat-status-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.status-filter-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.status-filter-btn.active {
    color: white;
    border-color: transparent;
}

.status-filter-btn.valid.active { background: #28a745; }
.status-filter-btn.likely-valid.active { background: #ffc107; color: #333; }
.status-filter-btn.invalid.active { background: #dc3545; }
.status-filter-btn.unknown.active { background: #6c757d; }

.status-filter-btn:hover {
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feat-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .feat-name {
        font-size: 0.85rem;
    }
    
    .feat-type, .feat-tier, .feat-prereq, .feat-status {
        font-size: 0.75rem;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .feat-status-filter {
        flex-direction: column;
    }
}

/* Equipment Builder Layout Enhancements */
.equipment-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.top-section {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  height: 340px;
  min-height: 240px;
  max-height: 400px;
}

.category-list-section {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  background: #f8f8f8;
  border-radius: 6px;
  border: 1px solid #ddd;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  height: 100%;
  overflow: hidden;
}

.category-list {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 270px;
  margin-top: 0.5rem;
}

.item-list-section {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #ddd;
  padding: 0.5rem;
  height: 100%;
  overflow: hidden;
}

.search-section {
  margin-bottom: 0.5rem;
}

.item-list {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 270px;
}

.middle-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  margin: 0.5rem 0 0.5rem 0;
}

.bottom-section {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

.character-equipment-section,
.equipped-items-section {
  flex: 1 1 0;
  background: #f8f8f8;
  border-radius: 6px;
  border: 1px solid #ddd;
  padding: 0.5rem;
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.equipment-header, .equipped-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
  .top-section, .bottom-section {
    flex-direction: column;
    gap: 0.5rem;
  }
  .category-list-section, .item-list-section, .character-equipment-section, .equipped-items-section {
    max-height: 220px;
  }
}

/* Rituals List Section */
.rituals-list-section {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 2rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.rituals-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  font-weight: 700;
  background: #e9ecef;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #d1d5db;
}
.rituals-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 340px;
  overflow-y: auto;
}
.ritual-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.ritual-row:hover {
  background: #f8f9fa;
}
.ritual-row.selected {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}
.load-more-container {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
}
#rituals-load-more-btn {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
}
#rituals-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Owned Rituals Section */
.owned-section {
  margin-top: 2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.owned-books, .owned-scrolls {
  flex: 1 1 300px;
  min-width: 250px;
}
.owned-books .book-item, .owned-scrolls .scroll-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.owned-books .book-name, .owned-scrolls .scroll-name {
  font-weight: 600;
  color: #495057;
}
.owned-books .book-quantity, .owned-scrolls .scroll-quantity {
  color: #666;
  font-size: 0.9rem;
}
.owned-books .book-cost, .owned-scrolls .scroll-cost {
  color: #28a745;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Alchemy List Section */
.alchemy-list-section {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 2rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.alchemy-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  font-weight: 700;
  background: #e9ecef;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #d1d5db;
}
.alchemy-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 340px;
  overflow-y: auto;
}
.alchemy-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.alchemy-row:hover {
  background: #f8f9fa;
}
.alchemy-row.selected {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}
#alchemy-load-more-btn {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
}
#alchemy-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Owned Alchemy Section */
.owned-formulas, .owned-items {
  flex: 1 1 300px;
  min-width: 250px;
}
.owned-formulas .formula-item, .owned-items .item-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.owned-formulas .formula-name, .owned-items .item-name {
  font-weight: 600;
  color: #495057;
}
.owned-formulas .formula-cost, .owned-items .item-cost {
  color: #28a745;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Martial Practices List Section */
.martial-list-section {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 2rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.martial-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  font-weight: 700;
  background: #e9ecef;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #d1d5db;
}
.martial-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 340px;
  overflow-y: auto;
}
.martial-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.martial-row:hover {
  background: #f8f9fa;
}
.martial-row.selected {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}
#martial-load-more-btn {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
}
#martial-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Owned Martial Practices Section */
.owned-practices, .owned-scrolls {
  flex: 1 1 300px;
  min-width: 250px;
}
.owned-practices .practice-item, .owned-scrolls .scroll-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.owned-practices .practice-name, .owned-scrolls .scroll-name {
  font-weight: 600;
  color: #495057;
}
.owned-practices .practice-cost, .owned-scrolls .scroll-cost {
  color: #28a745;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Details Page Styles */
.details-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.details-container {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.details-header {
  background: #f8f9fa;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
}

.details-header h2 {
  margin: 0;
  color: #495057;
  font-size: 1.5rem;
}

.details-content {
  padding: 1.5rem;
}

.personal-details-section,
.campaign-details-section,
.optional-details-section {
  margin-bottom: 2rem;
}

.personal-details-section h3,
.campaign-details-section h3,
.optional-details-section h3 {
  color: #495057;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.form-row label {
  min-width: 150px;
  font-weight: 600;
  color: #495057;
}

.form-row input[type="text"],
.form-row select {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.9rem;
}

.form-row input[type="text"]:focus,
.form-row select:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.checkbox-row {
  align-items: flex-start;
}

.checkbox-row input[type="checkbox"] {
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}

.checkbox-row label {
  flex: 1;
  font-weight: normal;
  cursor: pointer;
}

#random-name-btn {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.optional-details-subtitle {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.optional-details-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1rem;
  background: #f8f9fa;
}

.optional-detail-item {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.optional-detail-checkbox-container {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.optional-detail-checkbox {
  margin-right: 0.5rem;
}

.optional-detail-name {
  font-weight: 600;
  color: #495057;
  cursor: pointer;
}

.optional-detail-summary {
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.character-status-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.character-status-section h3 {
  background: #f8f9fa;
  margin: 0;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
  color: #495057;
  font-size: 1.2rem;
}

.status-content {
  padding: 1.5rem;
}

.status-actions {
  margin-bottom: 1rem;
}

.status-actions .btn {
  margin-right: 1rem;
}

.status-messages {
  color: #6c757d;
  font-size: 0.9rem;
}