* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #2c3e50;
    line-height: 1.6;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: #e0e6ed;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.router-link-active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.card h2 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #eaedf3;
    padding-bottom: 0.5rem;
}

.form-group {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    align-items: center;
    flex-wrap: wrap;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
}

.input-field {
    padding: 0.6rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    width: 200px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-primary {
    background-color: #2a5298;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1e3c72;
}

.btn-secondary {
    background-color: #4a5568;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #2d3748;
}

.btn-success {
    background-color: #2e7d32;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #1b5e20;
}

.nav-links a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.char-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #e0e6ed;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-outline {
    background: transparent;
    color: #2a5298;
    border: 1px solid #2a5298;
}

.btn-outline:hover {
    background: #2a5298;
    color: #ffffff;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.alert-info {
    background-color: #ebf8fa;
    color: #1a6473;
    border: 1px solid #c2e9ee;
}

.alert-danger {
    background-color: #fed7d7;
    color: #9b1c1c;
    border: 1px solid #feb2b2;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background-color: #f7fafc;
    color: #4a5568;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.character-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.detail-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
}

.detail-label {
    font-size: 0.825rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.detail-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 0.25rem;
    word-break: break-all;
}

.btn-danger {
    background-color: #e53e3e;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c53030;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-panel {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.75rem 2rem;
    width: 100%;
    max-width: 750px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #eaedf3;
    padding-bottom: 0.5rem;
}

.modal-header h3 {
    color: #1e3c72;
    font-size: 1.35rem;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    line-height: 1;
    padding: 0.25rem;
}

.modal-close-btn:hover {
    color: #2d3748;
}

.form-field {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    color: #2d3748;
}

.form-control:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eaedf3;
    flex-wrap: wrap;
    gap: 0.5rem;
}

footer {
    background: #2d3748;
    color: #a0aec0;
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.875rem;
}

/* Character View Flexible Grid & Stats */
.character-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.character-row {
    display: grid;
    gap: 1rem;
    align-items: center;
}

.character-row-1 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.character-row-stat {
    grid-template-columns: 140px 140px 1fr;
}

@media (max-width: 768px) {
    .character-row-stat {
        grid-template-columns: 1fr 1fr;
    }
    .stat-bar-col {
        grid-column: 1 / -1;
    }
}

.character-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.character-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value-box {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-value-box .stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value-box .stat-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
}

.stat-progress-container {
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 9999px;
    height: 1.75rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.stat-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.health-bar {
    background-color: #e53e3e;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
}

.mana-bar {
    background-color: #3182ce;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
}

.stat-progress-text {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a202c;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.stat-recent-text {
    font-size: 0.72rem;
    color: #718096;
    margin-top: 0.35rem;
    min-height: 1rem;
    padding-left: 0.25rem;
}

/* Resist Section */
.character-resist-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.resist-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.character-resist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
}

.resist-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.25rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.resist-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

.resist-value {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Defenses & Saves Section */
.character-defenses-saves-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .character-defenses-saves-row {
        grid-template-columns: 1fr;
    }
}

.section-heading-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.section-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3c72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eaedf3;
    text-align: center;
}

.character-defenses-section,
.character-saves-section {
    display: flex;
    flex-direction: column;
}

.defenses-container {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.defense-box-large {
    flex: 1;
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.defense-large-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a202c;
    text-align: center;
}

.defenses-small-boxes {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.defense-box-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.25rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.defense-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

.defense-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.defense-temp-input {
    width: 100%;
    max-width: 60px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    padding: 0.15rem 0.25rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: #ffffff;
}

.defense-temp-input:focus {
    border-color: #3182ce;
    outline: none;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

.saves-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    height: 100%;
}

.save-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.25rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.save-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

.save-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Conditions Section */
.character-conditions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .character-conditions-row {
        grid-template-columns: 1fr;
    }
}

.character-conditions-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.character-conditions-spacer {
    /* Empty spacer for the right half */
}

.conditions-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.conditions-select {
    flex: 1;
    min-width: 150px;
}

.conditions-severity-input {
    width: 80px;
    text-align: center;
}

.conditions-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.condition-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.condition-name {
    font-weight: 600;
    color: #2c3e50;
}

.condition-severity {
    font-size: 0.8rem;
    color: #718096;
}

.condition-remove-btn {
    margin-left: auto;
    padding: 0.15rem 0.45rem;
    font-size: 1rem;
    line-height: 1;
    border-radius: 4px;
    border: 1px solid #e53e3e;
    background: #fed7d7;
    color: #c53030;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.condition-remove-btn:hover {
    background: #e53e3e;
    color: #ffffff;
}

/* Health Notes Section */
.character-health-notes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.health-notes-list {
    display: flex;
    flex-direction: column;
}

.health-note-item {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

.health-note-item:last-child {
    border-bottom: none;
}

.health-note-item:first-child {
    border-top: 1px solid #e2e8f0;
}

/* Notes Row (two large boxes side by side) */
.character-notes-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.notes-box {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    overflow: hidden;
}

.notes-box-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    background: #edf2f7;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.notes-box-label:hover {
    background: #e2e8f0;
}

.notes-box-toggle {
    font-size: 0.75rem;
    color: #718096;
}

.notes-box-content {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #4a5568;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 2rem;
}

/* Attacks Section */
.attacks-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .attacks-row {
        grid-template-columns: 1fr;
    }
}

.attack-slot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attack-select {
    width: 100%;
}

.attack-stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.attack-stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

.attack-damage {
    flex: 2;
}

.attack-notes {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #4a5568;
    font-style: italic;
    min-height: 2.5rem;
}

/* Effects and Conditions Row */
.character-effects-conditions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .character-effects-conditions-row {
        grid-template-columns: 1fr;
    }
}

.effects-conditions-section {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    overflow: hidden;
}

.effects-list {
    padding: 0.25rem 0;
    max-height: 200px;
    overflow-y: auto;
}

.effects-list-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #a0aec0;
    font-style: italic;
}

.effect-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-bottom: 1px solid #edf2f7;
}

.effect-item:last-child {
    border-bottom: none;
}

.effect-item-info {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.effect-item-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: #4a5568;
    white-space: nowrap;
    min-width: 75px;
}

.effect-item-description {
    font-size: 0.7rem;
    font-weight: 400;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.effect-item-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.effect-item-multiply {
    width: 3rem;
    padding: 0.15rem 0.25rem;
    font-size: 0.7rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    text-align: center;
}

.effect-item-checkbox {
    flex-shrink: 0;
}

/* Stats Section */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

.stat-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #e2e8f0;
}

.stat-modifier-box {
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-details {
    display: flex;
    gap: 0.4rem;
    align-items: flex-end;
}

.stat-detail-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #718096;
    text-align: center;
    text-transform: uppercase;
}

.stat-detail-input {
    width: 100%;
    padding: 0.25rem 0.35rem;
    font-size: 0.8rem;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.stat-detail-value {
    padding: 0.25rem 0.35rem;
    font-size: 0.8rem;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #4a5568;
    font-weight: 600;
}

.stat-total-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}

.stat-total-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
}

.stat-total-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
}

/* Skills Controls - Sort and Filter */
.skills-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.skills-controls-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skills-controls-left label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.skills-controls-left .form-control {
    width: auto;
    min-width: 120px;
}

.skills-controls-right {
    flex: 1;
    max-width: 300px;
}

.skills-controls-right .form-control {
    width: 100%;
}

/* Skills Accordion Section */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.skill-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.skill-accordion:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.skill-accordion-header {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: #f8fafc;
    transition: background-color 0.2s ease;
    user-select: none;
}

.skill-accordion-header:hover {
    background: #edf2f7;
}

/* Items Accordion Section */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.item-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.item-accordion:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.item-accordion-header {
    display: flex;
    flex-direction: column;
    padding: 0.3rem 1.25rem;
    cursor: pointer;
    background: #f8fafc;
    transition: background-color 0.2s ease;
    user-select: none;
}

.item-accordion-header:hover {
    background: #edf2f7;
}

.skill-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.skill-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3c72;
}

.skill-action-icon {
    height: 15px;
    margin-left: 0.4rem;
    margin-bottom: 0.3rem;
    vertical-align: middle;
}

.effect-description {
    font-size: 0.9rem;
    font-weight: 300;
    color: #a0aec0;
    margin-left: 0.5rem;
    max-width: 500px;
    margin-left: 20px;
}

.skill-xp-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.xp-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #a0aec0;
    background: transparent;
    transition: background-color 0.2s ease;
}

.xp-dot-filled {
    background-color: #4a90d9;
    border-color: #4a90d9;
}

.xp-dot-big {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.skill-type-badge {
    display: inline-block;
    width: 65px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    margin-right: 0.75rem;
    white-space: nowrap;
}

.skill-type-base-weapon {
    color: #ea580c;
    background-color: #fff7ed;
    border: 1px solid #fed7aa;
}

.skill-type-special-weapon {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

.skill-type-magic {
    color: #3b82f6;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
}

.skill-type-defense {
    color: #16a34a;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.skill-type-other {
    color: #9333ea;
    background-color: #faf5ff;
    border: 1px solid #e9d5ff;
}

.skill-type-passive {
    color: #374151;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
}

.skill-accordion-body {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    min-height: 2rem;
}

/* Effect Status Buttons */
.effect-status-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.effect-toggle-btn {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #6b46c1;
    background-color: #6b46c1;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.effect-toggle-btn:hover {
    background-color: #553c9a;
    border-color: #553c9a;
}

.effect-toggle-btn.not-in-play {
    background-color: #a0aec0;
    border-color: #a0aec0;
    color: #ffffff;
}

.effect-toggle-btn.not-in-play:hover {
    background-color: #718096;
    border-color: #718096;
}

.effect-active-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #22c55e;
    background-color: #22c55e;
    color: #ffffff;
    white-space: nowrap;
}

.effect-active-badge.inactive {
    background-color: #a0aec0;
    border-color: #a0aec0;
    color: #ffffff;
}

/* Skill XP Controls Container */
.skill-xp-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Skill XP Adjustment Buttons */
.skill-xp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.skill-xp-btn:hover {
    background: #edf2f7;
    color: #1e3c72;
}

.skill-xp-btn:active {
    background: #e2e8f0;
}

.skill-xp-btn-minus {
    color: #e53e3e;
}

.skill-xp-btn-minus:hover {
    background: #fff5f5;
    color: #c53030;
}

.skill-xp-btn-plus {
    color: #38a169;
}

.skill-xp-btn-plus:hover {
    background: #f0fff4;
    color: #276749;
}

/* Skill Detail Rows (expanded accordion body) */
.skill-detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.skill-detail-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.skill-detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.skill-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
}

.skill-description-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.skill-description-value {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    min-height: 3rem;
}

/* Skill Effects List - effects inside skill accordion body */
.skill-effects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Add Effect button inside skill effects list */
.skill-effects-list .btn {
    display: block;
    margin: 0 auto;
}

/* Edit Skill Button */
.skill-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #f7fafc;
    color: #718096;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    margin-right: 0.5rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.skill-edit-btn:hover {
    background: #edf2f7;
    color: #1e3c72;
}

.skill-edit-btn:active {
    background: #e2e8f0;
}

/* Skill Rank Badge - displayed in accordion header */
.skill-rank-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2c3e50;
    background-color: #f7fafc;
    border: 1px solid #cbd5e0;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    margin-right: 0.5rem;
    white-space: nowrap;
}

/* Form Row - Grid layout for modal form fields */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Form Row with exactly 5 columns - for Attack Type row in skill modal */
.form-row-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Form Row with Duration - Flex layout instead of grid */
.form-row-duration {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row-duration .form-field {
    flex: 2;
}

.form-row-duration .form-field-duration {
    flex: 3;
}

/* Duration input group - number box + unit dropdown side by side */
.duration-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.duration-number-input {
    width: 80px;
    flex-shrink: 0;
}

.duration-unit-select {
    flex: 1;
}

/* Level Row - Level input with Gain XP button */
.level-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.level-row .form-control {
    flex: 1;
}

.btn-gain-xp {
    white-space: nowrap;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    background-color: #805ad5;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-gain-xp:hover {
    background-color: #6b46c1;
}

/* XP Bonus Row - Bold calculated text */
.xp-bonus-row {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
}

/* Checkbox Wrapper for Real Person */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.8rem;
}

.form-control-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.95rem;
    color: #2d3748;
    cursor: pointer;
    user-select: none;
}

/* Effect Bonus Row */
.effect-bonuses {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.effect-bonus-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.5fr 2fr auto;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .effect-bonus-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .effect-bonus-row {
        grid-template-columns: 1fr;
    }
}

.effect-bonus-row .form-control {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
}

.effect-bonus-row select:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.effect-bonus-row-invalid {
    background-color: #fee2e2;
    border-radius: 4px;
    padding: 0.25rem;
}

/* Effect Bonus Header Row */
.effect-bonus-header {
    display: grid;
    grid-template-columns: 1fr 1fr 0.5fr 2fr auto;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0.25rem;
}

.effect-bonus-header-cell {
    font-size: 0.75rem;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .effect-bonus-header {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .effect-bonus-header {
        grid-template-columns: 1fr;
    }
}

/* Effect Delete Button */
.effect-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #e53e3e;
    border-radius: 4px;
    background: #fed7d7;
    color: #c53030;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.effect-delete-btn:hover {
    background: #e53e3e;
    color: #ffffff;
}

/* Effect Add Row Button */
.effect-add-row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem auto 0;
    padding: 0.4rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
    background: #f7fafc;
    color: #4a5568;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.effect-add-row-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    color: #2d3748;
}

/* Hotbar Container */
.hotbar-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hotbar-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.hotbar-slot {
    flex: 1;
    max-width: 180px;
}

.hotbar-button {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.3rem 0.4rem;
    min-height: 40px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
}

.hotbar-button:hover:not(:disabled) {
    border-color: #3182ce;
    background: linear-gradient(180deg, #ebf8ff 0%, #bee3f8 100%);
    box-shadow: 0 2px 6px rgba(49, 130, 206, 0.2);
    transform: translateY(-1px);
}

.hotbar-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hotbar-button-empty {
    background: linear-gradient(180deg, #f7fafc 0%, #edf2f7 100%);
    border-color: #e2e8f0;
    cursor: pointer;
    opacity: 0.7;
}

.hotbar-button-empty:hover {
    border-color: #3182ce;
    background: linear-gradient(180deg, #ebf8ff 0%, #bee3f8 100%);
    box-shadow: 0 2px 6px rgba(49, 130, 206, 0.2);
    transform: translateY(-1px);
    opacity: 1;
}

.hotbar-slot-number {
    font-size: 0.65rem;
    font-weight: 700;
    color: #a0aec0;
    position: absolute;
    top: 2px;
    left: 4px;
}

.hotbar-action-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.hotbar-empty-text {
    font-size: 0.75rem;
    color: #a0aec0;
    font-style: italic;
}

.hotbar-action-icon {
    height: 12px;
    flex-shrink: 0;
}

.hotbar-cooldown-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-left: 2px;
    cursor: default;
}

.hotbar-slot-empty .hotbar-button {
    background: #f7fafc;
    border-color: #e2e8f0;
}

@media (max-width: 768px) {
    .hotbar-row {
        gap: 0.25rem;
    }
    .hotbar-button {
        min-height: 33px;
        padding: 0.25rem 0.3rem;
    }
    .hotbar-action-name {
        font-size: 0.7rem;
    }
}

/* Hotbar Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 400px;
    max-width: 500px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
}

.modal-field {
    margin-bottom: 1rem;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .modal-content {
        min-width: 300px;
        width: 95%;
    }
    .modal-header {
        padding: 0.75rem 1rem;
    }
    .modal-body {
        padding: 1rem;
    }
}

/* Base Weapon Row Styling */
.hotbar-row-base {
    margin-top: 0.5rem;
}

.hotbar-button-base {
    background: linear-gradient(180deg, #f0fff4 0%, #c6f6d5 100%);
    border-color: #9ae6b4;
    color: #22543d;
}

.hotbar-button-base:hover {
    background: linear-gradient(180deg, #c6f6d5 0%, #9ae6b4 100%);
    border-color: #48bb78;
    box-shadow: 0 2px 6px rgba(72, 187, 120, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-base:active {
    background: linear-gradient(180deg, #9ae6b4 0%, #68d391 100%);
    transform: translateY(0);
}

.hotbar-button-swap {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
    color: #744210;
    font-weight: 600;
}

.hotbar-button-swap:hover {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-swap:active {
    background: linear-gradient(180deg, #fde68a 0%, #fbbf24 100%);
    transform: translateY(0);
}

/* Hotbar Button Skill Type Colors */

/* Base Weapon - Orange */
.hotbar-button-type-base-weapon {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #ea580c;
    color: #ea580c;
}

.hotbar-button-type-base-weapon:hover {
    background: linear-gradient(180deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #c2410c;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-type-base-weapon:active {
    background: linear-gradient(180deg, #fed7aa 0%, #fdba74 100%);
    transform: translateY(0);
}

/* Special Weapon - Red */
.hotbar-button-type-special-weapon {
    background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #dc2626;
    color: #dc2626;
}

.hotbar-button-type-special-weapon:hover {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    border-color: #b91c1c;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-type-special-weapon:active {
    background: linear-gradient(180deg, #fecaca 0%, #fca5a5 100%);
    transform: translateY(0);
}

/* Magic - Blue */
.hotbar-button-type-magic {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    color: #3b82f6;
}

.hotbar-button-type-magic:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-type-magic:active {
    background: linear-gradient(180deg, #bfdbfe 0%, #93c5fd 100%);
    transform: translateY(0);
}

/* Defense - Green */
.hotbar-button-type-defense {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #16a34a;
    color: #16a34a;
}

.hotbar-button-type-defense:hover {
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #15803d;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-type-defense:active {
    background: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
    transform: translateY(0);
}

/* Other - Purple */
.hotbar-button-type-other {
    background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #9333ea;
    color: #9333ea;
}

.hotbar-button-type-other:hover {
    background: linear-gradient(180deg, #f3e8ff 0%, #e9d5ff 100%);
    border-color: #7e22ce;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-type-other:active {
    background: linear-gradient(180deg, #e9d5ff 0%, #d8b4fe 100%);
    transform: translateY(0);
}

/* Passive - Gray */
.hotbar-button-type-passive {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #374151;
    color: #374151;
}

.hotbar-button-type-passive:hover {
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #1f2937;
    box-shadow: 0 2px 6px rgba(55, 65, 81, 0.3);
    transform: translateY(-1px);
}

.hotbar-button-type-passive:active {
    background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(0);
}

/* Selected Skill Display Area */

.selected-skill-area {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.selected-skill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.selected-skill-row:last-child {
    margin-bottom: 0;
}

.selected-skill-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 100px;
    flex: 1;
}

.selected-skill-box-name {
    flex: 3;
}

.selected-skill-box-damage {
    flex: 2;
}

.selected-skill-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.selected-skill-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.die-roll-icon {
    height: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.die-roll-icon:hover {
    opacity: 1;
}

.die-roll-result {
    font-weight: 700;
    color: #a41414;
}

.selected-skill-spend-mp {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.selected-skill-use-btn {
    padding: 0.3rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.selected-skill-use-btn:hover {
    background: #2563eb;
}

.selected-skill-use-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.selected-skill-use-btn:disabled:hover {
    background: #9ca3af;
}

.selected-skill-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.selected-skill-cooldown-icon {
    font-size: 0.9rem;
    cursor: default;
}

.selected-skill-notes {
    flex: 4;
    min-width: auto;
}

.selected-skill-notes .selected-skill-value {
    font-weight: 400;
    font-style: italic;
    color: #475569;
}

/* Selected Item Display Area */

.selected-item-area {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.selected-item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.selected-item-row:last-child {
    margin-bottom: 0;
}

.selected-item-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 100px;
    flex: 1;
}

.selected-item-box-name {
    flex: 3;
}

.selected-item-box-dice {
    flex: 2;
}

.selected-item-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.selected-item-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.selected-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.selected-item-quantity-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 1.5rem;
    text-align: center;
}

.selected-item-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #64748b;
    border: 1px solid #475569;
    border-radius: 4px;
    cursor: pointer;
}

.selected-item-qty-btn:hover {
    background: #475569;
}

.selected-item-qty-btn:active {
    background: #334155;
}

.selected-item-notes {
    flex: 4;
    min-width: auto;
}

.selected-item-notes .selected-item-value {
    font-weight: 400;
    font-style: italic;
    color: #475569;
}

.selected-item-consume {
    flex: 1;
    min-width: auto;
    align-items: center;
}

.selected-item-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.selected-item-use-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.selected-item-use-btn:hover {
    background: #1d4ed8;
}

.selected-item-use-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.selected-item-use-btn:disabled:hover {
    background: #9ca3af;
}

.selected-item-cooldown-icon {
    font-size: 0.9rem;
    cursor: default;
}

/* Item Accordion Styles */

.item-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.item-header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.item-header-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.item-usable-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 4px;
}

.item-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 50px;
}

.item-category-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.item-quantity-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 1.5rem;
    text-align: center;
}

.item-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #64748b;
    border: 1px solid #475569;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    user-select: none;
}

.item-qty-btn:hover {
    background: #475569;
    transform: scale(1.1);
}

.item-qty-btn:active {
    background: #334155;
    transform: scale(1);
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.item-detail-value {
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.5;
}

/* Equipment Accordion Styles */

.item-slot-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7c3aed;
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    border-radius: 4px;
    margin-right: 0.25rem;
}

.equipment-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.equipment-detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.equipment-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.equipment-detail-value {
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.5;
}

/* Equipment Section Layout */

.equipment-section {
    margin-bottom: 2rem;
}

.equipment-section-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3c72;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.equipment-empty {
    padding: 0.5rem 0;
    font-style: italic;
}

/* Equipment Equip/Unequip Buttons */

.equip-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
    white-space: nowrap;
    margin-left: 0.25rem;
}

.equip-btn-equip {
    background: #16a34a;
    border-color: #15803d;
}

.equip-btn-equip:hover {
    background: #15803d;
    transform: scale(1.05);
}

.equip-btn-equip:active {
    background: #166534;
    transform: scale(1);
}

.equip-btn-unequip {
    background: #dc2626;
    border-color: #b91c1c;
}

.equip-btn-unequip:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.equip-btn-unequip:active {
    background: #991b1b;
    transform: scale(1);
}

.equip-btn-full {
    background: #64748b;
    border-color: #475569;
    cursor: not-allowed;
    opacity: 0.6;
}

.equip-btn-full:hover {
    transform: none;
}

/* Pass Time Row */

.pass-time-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.pass-time-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e3c72;
    text-transform: uppercase;
    white-space: nowrap;
}

.pass-time-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pass-time-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #8b5cf6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.pass-time-btn:hover {
    background: #7c3aed;
}

/* Humanity View - Attributes Row */

.humanity-attributes-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.humanity-attr-box {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.humanity-attr-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.humanity-attr-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
}

.humanity-attr-input {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.humanity-attr-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Humanity View - Stress and Sanity Bars */

.stress-bar {
    background-color: #8b5cf6;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
}

.sanity-bar {
    background-color: #eab308;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
}

/* Humanity View - Inured Row */

.humanity-inured-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.humanity-inured-dropdowns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.humanity-inured-box {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.humanity-inured-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.humanity-inured-select {
    font-size: 1rem;
    font-weight: 400;
    color: #2c3e50;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.humanity-inured-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Humanity View - Personality Section */

.humanity-personality-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


.humanity-personality-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.humanity-personality-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.personality-label-bold {
    font-size: 18px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
}

.humanity-personality-textarea {
    font-size: 0.95rem;
    color: #2c3e50;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.humanity-personality-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Notes View - Textarea */

.notes-textarea-container {
    display: flex;
    flex-direction: column;
}

.notes-textarea {
    font-size: 0.95rem;
    color: #2c3e50;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 400px;
    line-height: 1.6;
}

.notes-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Login Screen */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0f172a;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
}

.login-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    color: #f1f5f9;
    font-weight: 700;
}

.login-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input-group {
    display: flex;
}

.login-input {
    flex: 1;
    font-size: 1rem;
    color: #f1f5f9;
    padding: 0.7rem 1rem;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input::placeholder {
    color: #64748b;
}

.login-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.login-btn {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    padding: 0.7rem 1.5rem;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover:not(:disabled) {
    background: #1d4ed8;
}

.login-btn:disabled {
    background: #475569;
    cursor: not-allowed;
    opacity: 0.6;
}

.login-error {
    color: #f87171;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.25rem;
}

/* Logout button in navbar */

.nav-logout-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.nav-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Character list — styled like accordion headers */

.character-list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.character-list-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.character-list-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.character-list-item-selected {
    border-color: #28a745;
}

.character-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 1.25rem;
    background: #f8fafc;
    transition: background-color 0.2s ease;
    user-select: none;
}

.character-list-item:hover .character-list-item-header {
    background: #edf2f7;
}

.character-list-item-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3c72;
}

.character-open-btn {
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Graveyard section */

.graveyard-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #555;
}

.graveyard-section h3 {
    color: #555;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.character-list-item-dead {
    background: #e9ecef;
    border-color: #ced4da;
}

.character-list-item-dead .character-list-item-header {
    background: #dee2e6;
}

.character-dead-name {
    color: #6c757d;
    font-style: italic;
}