/* DND Adventure Designer - Main Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

/* === NAVIGATION === */
.main-nav {
    background: #12121f;
    border-bottom: 1px solid #334;
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand .brand-icon {
    font-size: 1.5rem;
}

.nav-brand h1 {
    font-size: 1.25rem;
    color: #e94560;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-link {
    color: #888;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #12121f;
        flex-direction: column;
        padding: 10px;
        border-bottom: 1px solid #334;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }
}

/* === MAIN CONTENT === */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 120px);
}

/* === FOOTER === */
.main-footer {
    background: #12121f;
    border-top: 1px solid #334;
    padding: 20px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: #e94560;
}

/* === CAMPAIGN CONNECTION === */
.campaign-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: #888;
}

.campaign-status:hover {
    background: rgba(255, 255, 255, 0.1);
}

.campaign-status.connected {
    color: #4ecca3;
}

.campaign-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.campaign-status.connected .status-dot {
    background: #4ecca3;
}

.campaign-status .role-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.campaign-status .role-badge.dm {
    background: rgba(233, 69, 96, 0.3);
    color: #e94560;
}

.campaign-status .role-badge.player {
    background: rgba(78, 204, 163, 0.3);
    color: #4ecca3;
}

/* === CAMPAIGN MODAL === */
.campaign-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.campaign-modal.active {
    display: flex;
}

.campaign-modal-content {
    background: #1a1a2e;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    border: 1px solid #334;
}

.campaign-modal-content h3 {
    color: #e94560;
    margin-bottom: 20px;
    text-align: center;
}

.campaign-modal-content .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.campaign-modal-content .tab {
    flex: 1;
    padding: 10px;
    background: #334;
    border: none;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.campaign-modal-content .tab.active {
    background: #e94560;
    color: white;
}

.campaign-modal-content .tab-content {
    display: none;
}

.campaign-modal-content .tab-content.active {
    display: block;
}

.campaign-modal-content label {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.campaign-modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #334;
    border-radius: 8px;
    background: #0f0f1a;
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 15px;
}

.campaign-modal-content input:focus {
    outline: none;
    border-color: #e94560;
}

.campaign-modal-content .hint {
    color: #666;
    font-size: 0.8rem;
    margin-top: -10px;
    margin-bottom: 15px;
}

.campaign-modal-content .error {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
    display: none;
}

.campaign-modal-content .error.show {
    display: block;
}

.campaign-modal-content label .required {
    color: #e94560;
    font-size: 0.75rem;
}

.campaign-modal-content label .optional {
    color: #666;
    font-size: 0.75rem;
    font-weight: normal;
}

.role-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.role-indicator.dm {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.role-indicator.player {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
}

.campaign-modal-content .btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* === BUTTONS === */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: #334;
    color: #e0e0e0;
}

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

.btn-danger {
    background: #661a1a;
    color: #ff6b6b;
}

.btn-danger:hover {
    background: #882222;
}

.btn-skip {
    background: transparent;
    color: #888;
    border: 1px solid #444;
}

.btn-skip:hover {
    border-color: #666;
    color: #aaa;
}

.btn-full {
    width: 100%;
}

/* === CARDS === */
.card {
    background: #1a1a2e;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #334;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #445;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-title {
    color: #fff;
    font-size: 1.2rem;
    margin: 0;
}

.card-subtitle {
    color: #888;
    font-size: 0.9rem;
}

/* === ADVENTURE LIST === */
.adventure-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.adventure-card {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #334;
    cursor: pointer;
    transition: all 0.3s ease;
}

.adventure-card:hover {
    border-color: #e94560;
    transform: translateY(-2px);
}

.adventure-card h3 {
    color: #fff;
    margin-bottom: 8px;
}

.adventure-card .meta {
    color: #666;
    font-size: 0.85rem;
    display: flex;
    gap: 15px;
}

.adventure-card .meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.adventure-card .progress-bar {
    height: 4px;
    background: #334;
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.adventure-card .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #ff6b6b);
    border-radius: 2px;
}

/* === WELCOME / HOME === */
.welcome-section {
    text-align: center;
    padding: 60px 20px;
}

.welcome-section h2 {
    color: #e94560;
    font-size: 2rem;
    margin-bottom: 15px;
}

.welcome-section p {
    color: #888;
    max-width: 500px;
    margin: 0 auto 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #334;
    text-align: left;
}

.feature-card .icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #fff;
    margin-bottom: 10px;
}

.feature-card p {
    color: #888;
    font-size: 0.9rem;
}

/* === DESIGNER SIDEBAR === */
.designer-layout {
    display: flex;
    gap: 20px;
}

.designer-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #12121f;
    border-radius: 12px;
    border: 1px solid #334;
    height: fit-content;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.designer-main {
    flex: 1;
    min-width: 0;
}

@media (max-width: 900px) {
    .designer-layout {
        flex-direction: column;
    }

    .designer-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
    }
}

/* Sidebar sections */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #334;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #12121f;
    z-index: 10;
}

.sidebar-header h3 {
    color: #e94560;
    font-size: 1rem;
    margin: 0;
}

.sidebar-content {
    padding: 10px 0;
}

.sidebar-section {
    border-bottom: 1px solid #252535;
}

.sidebar-section-header {
    padding: 12px 20px;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar-section-header:hover {
    background: #1a1a2e;
    color: #e94560;
}

.sidebar-section-header.active {
    color: #e94560;
    background: #1a1a2e;
}

.sidebar-section-header .arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.sidebar-section-header.expanded .arrow {
    transform: rotate(90deg);
}

.sidebar-section-header .progress-badge {
    background: #334;
    color: #888;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.sidebar-section-header.active .progress-badge {
    background: #e94560;
    color: white;
}

.sidebar-questions {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #0f0f1a;
}

.sidebar-questions.expanded {
    max-height: 2000px;
}

.sidebar-question {
    padding: 10px 20px 10px 30px;
    color: #666;
    font-size: 0.8rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-question:hover {
    color: #aaa;
    background: #151525;
}

.sidebar-question.current {
    color: #e94560;
    border-left-color: #e94560;
    background: #1a1a2e;
}

.sidebar-question.answered {
    color: #4ecca3;
}

.sidebar-question.answered::before {
    content: "\2713 ";
}

.sidebar-add-note {
    padding: 10px 20px 10px 30px;
    color: #e94560;
    font-size: 0.8rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.sidebar-add-note:hover {
    opacity: 1;
    background: #151525;
}

.sidebar-note {
    padding: 8px 20px 8px 30px;
    color: #b8860b;
    font-size: 0.75rem;
    cursor: pointer;
    border-left: 2px solid #b8860b;
    background: rgba(184, 134, 11, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-note:hover {
    background: rgba(184, 134, 11, 0.2);
}

/* === QUESTION CARD === */
.question-card {
    background: #1a1a2e;
    border-radius: 15px;
    padding: 40px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #334;
}

.question-section {
    color: #e94560;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.question-hint {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 25px;
    font-style: italic;
}

/* === PROGRESS BAR === */
.progress-container {
    background: #1a1a2e;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 8px;
    background: #334;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #ff6b6b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #888;
}

.section-indicator {
    color: #e94560;
    font-weight: bold;
}

/* === INPUTS === */
textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #334;
    border-radius: 10px;
    background: #0f0f1a;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #e94560;
}

textarea::placeholder {
    color: #555;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #334;
    border-radius: 8px;
    background: #0f0f1a;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #e94560;
}

/* === BUTTON GROUP === */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* === MODE SELECTION === */
.mode-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.mode-card {
    background: #1a1a2e;
    border: 2px solid #334;
    border-radius: 15px;
    padding: 30px;
    width: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    border-color: #e94560;
    transform: translateY(-5px);
}

.mode-card.selected {
    border-color: #e94560;
    background: #1f1f3a;
}

.mode-card h3 {
    color: #fff;
    margin-bottom: 10px;
}

.mode-card p {
    color: #888;
    font-size: 0.9rem;
}

/* === SECTION DIVIDER === */
.section-divider {
    text-align: center;
    padding: 60px 20px;
    border: 2px dashed #334;
    border-radius: 15px;
    margin: 30px 0;
}

.section-divider h2 {
    color: #e94560;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.section-divider p {
    color: #888;
    max-width: 500px;
    margin: 0 auto;
}

/* === EXPORT SCREEN === */
.export-screen {
    text-align: center;
    padding: 40px;
}

.export-screen h2 {
    color: #4ecca3;
    font-size: 2rem;
    margin-bottom: 20px;
}

.export-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.export-btn {
    padding: 15px 30px;
    background: #1a1a2e;
    border: 2px solid #334;
    border-radius: 10px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    border-color: #4ecca3;
    background: #1f1f3a;
}

.export-btn .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* === STATS === */
.stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    color: #4ecca3;
    font-weight: bold;
}

.stat-label {
    color: #888;
    font-size: 0.9rem;
}

/* === MODALS === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    background: #1a1a2e;
    max-width: 900px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: #e94560;
}

.preview-content {
    background: #0f0f1a;
    padding: 20px;
    border-radius: 10px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 60vh;
    overflow-y: auto;
    color: #c0c0c0;
}

/* Note Modal */
.note-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.note-modal.active {
    display: flex;
}

.note-modal-content {
    background: #1a1a2e;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #334;
}

.note-modal-content h3 {
    color: #e94560;
    margin-bottom: 15px;
}

.note-modal-content textarea {
    min-height: 120px;
    margin-bottom: 15px;
}

.note-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* === FLOATING BUTTONS === */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-btn:hover {
    transform: scale(1.1);
}

.float-btn.save {
    background: #4ecca3;
    color: #1a1a2e;
}

.float-btn.load {
    background: #334;
    color: #e0e0e0;
}

.float-btn.load:hover {
    background: #445;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: #4ecca3;
    color: #1a1a2e;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 300;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #e94560;
    color: white;
}

/* === LOADING === */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #334;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* === UTILITY === */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: #888;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .question-card {
        padding: 25px;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }

    .mode-card {
        width: 100%;
    }

    .welcome-section h2 {
        font-size: 1.5rem;
    }
}

/* === PAGE TRANSITIONS === */
.page-exit-active {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.page-enter-active {
    animation: fadeIn 0.3s ease;
}

/* === REFERENCE PANEL === */
.ref-panel-toggle {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1a1a2e;
    border: 2px solid #334;
    color: #e0e0e0;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.ref-panel-toggle:hover {
    border-color: #e94560;
    transform: scale(1.05);
}

.ref-panel-toggle.active {
    background: #e94560;
    border-color: #e94560;
}

.ref-panel {
    position: fixed;
    right: -360px;
    top: 60px;
    width: 350px;
    height: calc(100vh - 60px);
    background: #12121f;
    border-left: 1px solid #334;
    z-index: 140;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ref-panel.open {
    right: 0;
}

.ref-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #334;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #12121f;
}

.ref-panel-header h3 {
    color: #e94560;
    font-size: 1rem;
    margin: 0;
}

.ref-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-panel-close:hover {
    color: #e94560;
}

.ref-panel-search {
    padding: 15px;
    border-bottom: 1px solid #334;
}

.ref-panel-search input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #334;
    border-radius: 8px;
    background: #0f0f1a;
    color: #e0e0e0;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.ref-panel-search input:focus {
    outline: none;
    border-color: #e94560;
}

.ref-filter-tabs {
    display: flex;
    gap: 5px;
}

.ref-filter {
    flex: 1;
    padding: 6px 8px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ref-filter:hover {
    border-color: #445;
    color: #e0e0e0;
}

.ref-filter.active {
    background: #e94560;
    border-color: #e94560;
    color: white;
}

.ref-panel-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ref-empty-state {
    text-align: center;
    padding: 30px 15px;
    color: #888;
}

.ref-empty-state p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.ref-result {
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ref-result:hover {
    border-color: #445;
}

.ref-result.expanded {
    border-color: #e94560;
}

.ref-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.ref-result-name {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.ref-result-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.ref-result-badge.monster {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.ref-result-badge.spell {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
}

.ref-result-badge.item {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.ref-result-badge.item.rare {
    background: rgba(0, 112, 221, 0.2);
    color: #0070dd;
}

.ref-result-badge.item.very\ rare {
    background: rgba(163, 53, 238, 0.2);
    color: #a335ee;
}

.ref-result-badge.item.legendary {
    background: rgba(255, 128, 0, 0.2);
    color: #ff8000;
}

.ref-result-badge.item.artifact {
    background: rgba(230, 204, 128, 0.2);
    color: #e6cc80;
}

.ref-result-badge.deity {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.ref-result-badge.background {
    background: rgba(139, 90, 43, 0.2);
    color: #cd853f;
}

.ref-result-badge.feat {
    background: rgba(147, 112, 219, 0.2);
    color: #9370db;
}

.ref-result-badge.condition {
    background: rgba(255, 99, 71, 0.2);
    color: #ff6347;
}

.ref-result-badge.race {
    background: rgba(64, 224, 208, 0.2);
    color: #40e0d0;
}

.ref-result-badge.class {
    background: rgba(255, 140, 0, 0.2);
    color: #ff8c00;
}

/* Mode tabs (Search vs Browse) */
.ref-mode-tabs {
    display: flex;
    padding: 0 15px;
    margin-bottom: 10px;
    gap: 5px;
}

.ref-mode-tab {
    flex: 1;
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ref-mode-tab:hover {
    background: #252540;
    color: #e0e0e0;
}

.ref-mode-tab.active {
    background: #e94560;
    border-color: #e94560;
    color: white;
}

/* Browse mode */
.ref-panel-browse {
    padding: 0 15px 10px;
}

.ref-browse-tabs {
    display: flex;
    gap: 5px;
}

.ref-browse-tab {
    flex: 1;
    padding: 8px 10px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ref-browse-tab:hover {
    background: #252540;
    color: #e0e0e0;
}

.ref-browse-tab.active {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    color: #e94560;
}

/* Subclass tags */
.ref-subclass-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ref-subclass-tag {
    padding: 4px 8px;
    background: rgba(255, 140, 0, 0.15);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 4px;
    color: #ff8c00;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ref-subclass-tag:hover {
    background: rgba(255, 140, 0, 0.3);
    border-color: #ff8c00;
}

.ref-hint {
    font-size: 0.7rem;
    color: #666;
    font-weight: normal;
}

/* Expanded subclass view */
.ref-subclass-expanded {
    width: 100%;
    background: rgba(255, 140, 0, 0.08);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.ref-subclass-header {
    padding: 8px 12px;
    background: rgba(255, 140, 0, 0.15);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ff8c00;
}

.ref-subclass-header:hover {
    background: rgba(255, 140, 0, 0.25);
}

.ref-collapse-hint {
    font-size: 0.7rem;
    opacity: 0.7;
}

.ref-subclass-features {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.ref-feature {
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

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

.ref-feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ref-feature-name {
    font-weight: bold;
    color: #e0e0e0;
}

.ref-feature-level {
    font-size: 0.7rem;
    color: #888;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.ref-feature-desc {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.5;
}

.ref-result-meta {
    color: #666;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ref-source {
    color: #555;
    font-size: 0.7rem;
    font-style: italic;
}

/* Adjust designer layout when panel is open */
body.ref-panel-open .designer-layout {
    margin-right: 360px;
}

body.ref-panel-open .main-content {
    max-width: calc(1000px + 180px);
}

/* Sheet body already uses 2 columns, resource sidebar is hidden via .resource-sidebar rule */

/* === REFERENCE PANEL DETAIL VIEW === */
.ref-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #334;
    font-size: 0.8rem;
    line-height: 1.5;
}

.ref-stat-block {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.ref-stat-row {
    background: #0f0f1a;
    padding: 6px 8px;
    border-radius: 4px;
    text-align: center;
}

.ref-stat-label {
    display: block;
    color: #888;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.ref-stat-value {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.8rem;
}

.ref-ability-scores {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.ref-ability {
    background: #0f0f1a;
    padding: 6px 4px;
    border-radius: 4px;
    text-align: center;
}

.ref-ability .label {
    display: block;
    color: #888;
    font-size: 0.6rem;
    font-weight: 600;
}

.ref-ability .score {
    display: block;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-weight: 600;
}

.ref-ability .mod {
    display: block;
    color: #4ecca3;
    font-size: 0.7rem;
}

.ref-info-row {
    color: #c0c0c0;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.ref-info-row strong {
    color: #e94560;
}

.ref-info-note {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    padding: 8px 10px;
    background: rgba(78, 204, 163, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
}

.ref-section-title {
    color: #e94560;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin: 12px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #334;
}

.ref-ability-entry {
    color: #c0c0c0;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.ref-ability-entry strong {
    color: #e0e0e0;
}

.ref-ability-entry em {
    color: #4ecca3;
    font-style: normal;
}

.ref-spell-info,
.ref-item-info {
    background: #0f0f1a;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.ref-description {
    color: #c0c0c0;
    font-size: 0.75rem;
    line-height: 1.6;
}

.ref-description em {
    color: #4ecca3;
    font-style: normal;
}

.ref-description strong {
    color: #e0e0e0;
}

.ref-higher-levels {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #334;
    color: #c0c0c0;
    font-size: 0.75rem;
}

.ref-higher-levels strong {
    color: #e94560;
}

@media (max-width: 1100px) {
    .ref-panel-toggle {
        right: 15px;
        top: 75px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .ref-panel {
        width: 100%;
        right: -100%;
    }

    body.ref-panel-open .designer-layout {
        margin-right: 0;
    }

    body.ref-panel-open .main-content {
        max-width: 1000px;
    }
}

/* === PORTAL PAGES === */
.dm-portal {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
}

/* Override main-content constraints for player portal */
.main-content:has(.player-portal) {
    max-width: none;
    padding: 0;
    margin: 0;
}

.player-portal {
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: calc(100vh - 60px);
    width: 100%;
}

.player-center-content {
    flex: 1;
    margin-left: 200px;
    margin-right: 280px;
    padding: 15px 20px 20px;
    min-width: 0;
}

.player-portal .portal-header {
    margin: 0 0 15px;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.portal-header-left h2 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
}

.portal-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back {
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-back:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.portal-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-badge.dm {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.portal-badge.player {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-label {
    color: #888;
    font-size: 0.85rem;
}

/* Portal Tabs */
.portal-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #334;
    margin-bottom: 20px;
}

.portal-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.portal-tab:hover {
    color: #e0e0e0;
}

.portal-tab.active {
    color: #e94560;
    border-bottom-color: #e94560;
}

.portal-tab .count-badge {
    background: #334;
    color: #888;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.portal-tab.active .count-badge {
    background: rgba(233, 69, 96, 0.3);
    color: #e94560;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Players Tab */
.players-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.players-empty h3 {
    color: #e0e0e0;
    margin-bottom: 10px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.character-card-mini {
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.character-card-mini:hover {
    border-color: #e94560;
    transform: translateY(-2px);
}

.char-card-header h4 {
    color: #fff;
    margin: 0 0 4px;
}

.char-card-header .char-player {
    color: #666;
    font-size: 0.8rem;
}

.char-card-body {
    margin-top: 10px;
}

.char-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.char-hp {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hp-bar {
    flex: 1;
    height: 6px;
    background: #334;
    border-radius: 3px;
    overflow: hidden;
}

.hp-bar .hp-fill {
    height: 100%;
    transition: width 0.3s;
}

.hp-bar.hp-good .hp-fill {
    background: #4ecca3;
}

.hp-bar.hp-warn .hp-fill {
    background: #ffc107;
}

.hp-bar.hp-danger .hp-fill {
    background: #e94560;
}

.hp-text {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}

.char-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.condition-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(255, 99, 71, 0.2);
    color: #ff6347;
    border-radius: 10px;
}

.char-dm-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #334;
    font-size: 0.8rem;
    color: #888;
}

/* === PLAYER PORTAL LAYOUT === */

.character-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #12121f;
    border-radius: 0 12px 12px 0;
    border: 1px solid #334;
    border-left: none;
    padding: 15px;
    height: calc(100vh - 140px);
    position: fixed;
    left: 0;
    top: 80px;
    overflow-y: auto;
    z-index: 50;
}

.resource-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #12121f;
    border-radius: 12px 0 0 12px;
    border: 1px solid #334;
    border-right: none;
    padding: 15px;
    height: calc(100vh - 140px);
    position: fixed;
    right: 0;
    top: 80px;
    overflow-y: auto;
    z-index: 50;
}

.resource-sidebar .section-box {
    margin-bottom: 12px;
}

/* Hide right sidebar when reference panel is open */
body.ref-panel-open .resource-sidebar {
    display: none;
}

.character-sidebar h3 {
    color: #e94560;
    font-size: 0.9rem;
    margin: 0 0 15px;
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-list-item {
    padding: 10px 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.character-list-item:hover {
    border-color: #445;
}

.character-list-item.selected {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

.char-list-name {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.85rem;
}

.char-list-meta {
    color: #666;
    font-size: 0.7rem;
    margin-top: 2px;
}

.character-sheet-area {
    flex: 1;
    min-width: 0;
}

.no-character-message {
    text-align: center;
    padding: 60px 20px;
    background: #1a1a2e;
    border-radius: 12px;
    border: 1px solid #334;
}

.no-character-message h3 {
    color: #e0e0e0;
    margin-bottom: 10px;
}

@media (max-width: 1200px) {
    .character-sidebar {
        width: 180px;
    }

    .resource-sidebar {
        width: 250px;
    }

    .player-center-content {
        margin-left: 180px;
        margin-right: 250px;
    }
}

@media (max-width: 900px) {
    .player-portal {
        flex-direction: column;
    }

    .player-center-content {
        margin-left: 0;
        margin-right: 0;
        order: 2;
    }

    .character-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        left: 0;
        height: auto;
        border-radius: 12px;
        border-left: 1px solid #334;
        max-height: none;
        order: 1;
    }

    .resource-sidebar {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        height: auto;
        border-radius: 12px;
        border-right: 1px solid #334;
        order: 3;
    }

    .character-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .character-list-item {
        flex: 1;
        min-width: 150px;
    }

    .sheet-body {
        grid-template-columns: 1fr;
    }

    .sheet-column.middle {
        min-width: 0;
    }

    .sheet-column.left {
        width: 100%;
        border-right: 1px solid #334;
    }
}

/* === CHARACTER SHEET === */
.character-sheet {
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 12px;
    padding: 20px;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 15px;
    border-bottom: 2px solid #e94560;
    margin-bottom: 20px;
}

.sheet-header-main {
    flex: 1;
}

.sheet-name-input {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0;
    margin-bottom: 10px;
    width: 100%;
}

.sheet-name-input:focus {
    outline: none;
    border-bottom: 1px solid #e94560;
}

.sheet-header-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sheet-field {
    flex: 1;
    min-width: 100px;
}

.sheet-field.small {
    flex: 0 0 70px;
    min-width: 70px;
}

.sheet-field input {
    width: 100%;
    padding: 6px 10px;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
}

.sheet-field input:focus {
    outline: none;
    border-color: #e94560;
}

.sheet-field label {
    display: block;
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    margin-top: 4px;
    text-align: center;
}

.sheet-actions {
    display: flex;
    gap: 10px;
}

/* Sheet Body Layout */
.sheet-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

.sheet-column.middle {
    min-width: 400px;
}

.sheet-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-box {
    background: #12121f;
    border: 1px solid #334;
    border-radius: 8px;
    padding: 12px;
}

.section-box h4 {
    color: #e94560;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #334;
}

.section-box textarea {
    min-height: 80px;
    font-size: 0.8rem;
    padding: 10px;
}

/* Ability Scores */
.ability-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ability-score {
    background: #12121f;
    border: 1px solid #334;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.ability-name {
    color: #888;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ability-race-bonus {
    color: #4ecca3;
    font-size: 0.65rem;
    background: rgba(78, 204, 163, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
}

.ability-feat-bonus {
    color: #f0a500;
    font-size: 0.65rem;
    background: rgba(240, 165, 0, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 2px;
}

.ability-score.has-bonus {
    border-color: rgba(78, 204, 163, 0.4);
}

.ability-mod {
    color: #4ecca3;
    font-size: 1.2rem;
    font-weight: bold;
}

.ability-value {
    width: 50px;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
    text-align: center;
    padding: 4px;
    margin-top: 4px;
}

.ability-value:focus {
    outline: none;
    border-color: #e94560;
}

.ability-value.locked {
    background: transparent;
    border: none;
    font-weight: bold;
}

/* Saving throw proficiency indicator */
.save-prof-indicator {
    font-size: 0.7rem;
    width: 16px;
    text-align: center;
    color: #666;
}

.save-row.proficient .save-prof-indicator {
    color: #4ecca3;
}

.save-row.proficient .save-name {
    color: #4ecca3;
}

/* Edit mode button styles */
.btn-edit-character.active {
    background: #4ecca3;
    border-color: #4ecca3;
    color: #0f0f1a;
}

.btn-edit-character.secondary {
    margin-top: 8px;
    font-size: 0.75rem;
    padding: 6px 12px;
}

/* Proficiency Bonus */
.prof-bonus-box {
    background: #e94560;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.prof-value {
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    display: block;
}

.prof-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.65rem;
    text-transform: uppercase;
}

/* Saving Throws */
.save-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.save-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #e94560;
}

.save-mod {
    color: #e0e0e0;
    font-size: 0.8rem;
    width: 30px;
    text-align: right;
}

.save-name {
    color: #888;
    font-size: 0.8rem;
}

/* Skills */
.skills {
    max-height: 350px;
    overflow-y: auto;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.75rem;
}

.skill-row input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #e94560;
}

.skill-row .skill-prof {
    accent-color: #e94560;
}

.skill-row .skill-expert {
    accent-color: #4ecca3;
}

.skill-mod {
    color: #e0e0e0;
    width: 25px;
    text-align: right;
}

.skill-name {
    color: #888;
    flex: 1;
}

.skill-ability {
    color: #555;
    font-size: 0.65rem;
}

/* Combat Stats */
.combat-stats {
    display: flex;
    gap: 10px;
}

.combat-stat {
    flex: 1;
    background: #12121f;
    border: 1px solid #334;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.combat-stat input,
.combat-stat .stat-value {
    display: block;
    width: 100%;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    padding: 8px;
}

.combat-stat .stat-value {
    background: transparent;
    border: none;
}

.combat-stat input:focus {
    outline: none;
    border-color: #e94560;
}

.combat-stat label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    margin-top: 6px;
}

/* HP Section */
.hp-section {
    display: flex;
    gap: 10px;
}

.hp-max, .hp-current, .hp-temp {
    flex: 1;
    text-align: center;
}

.hp-section label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.hp-section input {
    width: 100%;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
    text-align: center;
    padding: 8px;
}

.hp-section input:focus {
    outline: none;
    border-color: #e94560;
}

/* Hit Dice & Death Saves */
.hd-death-row {
    display: flex;
    gap: 10px;
}

.hit-dice-box, .death-saves-box {
    flex: 1;
}

.hit-dice-box input {
    width: 100%;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.9rem;
    padding: 8px;
    text-align: center;
}

.death-save-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.death-save-row span {
    color: #888;
    font-size: 0.75rem;
    width: 60px;
}

.death-save-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4ecca3;
}

/* Currency */
.currency-row {
    display: flex;
    gap: 8px;
}

.currency {
    flex: 1;
    text-align: center;
}

.currency input {
    width: 100%;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
    text-align: center;
    padding: 6px 4px;
}

.currency input:focus {
    outline: none;
    border-color: #e94560;
}

.currency label {
    display: block;
    font-size: 0.6rem;
    color: #888;
    margin-top: 4px;
}

/* Spellcasting */
.spell-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.spell-stat {
    flex: 1;
    text-align: center;
}

.spell-stat select {
    width: 100%;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
    padding: 6px;
}

.spell-stat .stat-value {
    background: #0f0f1a;
    border-radius: 4px;
    padding: 6px;
    color: #4ecca3;
    font-weight: bold;
}

.spell-stat label {
    display: block;
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
    margin-top: 4px;
}

.spells-known textarea {
    min-height: 100px;
}

.spellcasting-box.collapsed {
    opacity: 0.6;
}

.spellcasting-box.collapsed h4 {
    cursor: pointer;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.add-hint {
    font-weight: normal;
    color: #666;
    font-size: 0.65rem;
}

/* Level Progression Section */
.level-progression {
    margin-top: 15px;
}

.level-progression h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-add-level {
    padding: 4px 10px;
    background: rgba(78, 204, 163, 0.1);
    border: 1px solid #4ecca3;
    border-radius: 4px;
    color: #4ecca3;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: normal;
    transition: all 0.2s;
}

.btn-add-level:hover {
    background: rgba(78, 204, 163, 0.2);
}

.level-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.level-row {
    display: grid;
    grid-template-columns: 30px 1fr auto 24px;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    background: #0f0f1a;
    border-radius: 6px;
    border: 1px solid #334;
    font-size: 0.85rem;
}

.level-row.current {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.level-row.race-row {
    border-style: dashed;
    background: #12121f;
}

.level-row.race-row.empty {
    border-color: #4ecca3;
    border-style: dashed;
}

.level-row.race-row .level-num {
    color: #666;
}

.level-num {
    color: #888;
    font-weight: bold;
    text-align: center;
}

.level-class {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.level-class strong {
    color: #e0e0e0;
}

.level-subclass {
    color: #4ecca3;
    font-size: 0.8rem;
}

.class-level-tag {
    font-size: 0.7rem;
    color: #888;
    background: #1a1a2e;
    padding: 2px 6px;
    border-radius: 3px;
}

.level-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.feature-tag {
    font-size: 0.7rem;
    color: #ccc;
    background: #252538;
    padding: 2px 6px;
    border-radius: 3px;
}

.feature-tag.ability-bonus {
    background: #1a3a2e;
    color: #4ecca3;
    font-weight: bold;
}

.btn-remove-level {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    transition: color 0.2s;
}

.btn-remove-level:hover {
    color: #e94560;
}

/* Class display in header */
.class-summary {
    flex: 2;
}

.class-display {
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e0e0e0;
    font-size: 0.9rem;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.class-display .placeholder {
    color: #666;
}

.level-display {
    position: relative;
}

.level-display .level-value {
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 6px;
    padding: 8px 12px;
    color: #4ecca3;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-level-header {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4ecca3;
    color: #0f0f1a;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.btn-add-level-header:hover {
    background: #6fe0b8;
    transform: scale(1.1);
}

/* Add Level Modal */
.level-class-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-class-option {
    padding: 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.level-class-option:hover:not(.disabled) {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.level-class-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-class-option.existing {
    border-color: #4ecca3;
    border-style: dashed;
}

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

.lco-header strong {
    color: #e0e0e0;
}

.lco-info {
    color: #888;
    font-size: 0.85rem;
}

.lco-level {
    color: #4ecca3;
    margin-left: 8px;
}

.lco-detail {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.lco-req {
    font-size: 0.8rem;
    color: #e94560;
    margin-top: 4px;
}

.lco-subclass-note {
    font-size: 0.75rem;
    color: #b366ff;
    margin-top: 4px;
}

/* Subclass selection modal */
.subclass-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subclass-option {
    padding: 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.subclass-option:hover {
    border-color: #b366ff;
    background: rgba(179, 102, 255, 0.1);
}

.subclass-option strong {
    color: #e0e0e0;
}

.sc-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.sc-feature {
    font-size: 0.75rem;
    color: #888;
    background: #252538;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Race Selection Field */
.race-field {
    position: relative;
}

.race-field.selectable {
    cursor: pointer;
    border: 1px dashed #4ecca3 !important;
}

.race-field.selectable:hover {
    background: rgba(78, 204, 163, 0.1);
}

.race-field.locked {
    cursor: default;
}

.race-display {
    min-height: 1.5em;
}

.race-display .placeholder {
    color: #4ecca3;
    font-style: italic;
}

/* Race Selection Modal */
.race-search-box {
    margin-bottom: 15px;
}

.race-search-box input {
    width: 100%;
    padding: 10px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.race-search-box input:focus {
    outline: none;
    border-color: #4ecca3;
}

.race-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.race-option {
    padding: 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.race-option:hover {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.race-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.race-option-header strong {
    color: #e0e0e0;
}

.race-source {
    font-size: 0.75rem;
    color: #888;
    background: #252538;
    padding: 2px 6px;
    border-radius: 3px;
}

.race-option-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: #aaa;
}

.race-option-header {
    cursor: pointer;
}

.race-expand-icon {
    font-size: 0.7rem;
    color: #666;
    margin-left: auto;
    padding-left: 10px;
}

.race-option.expanded {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.05);
}

.race-option.expanded .race-expand-icon {
    color: #4ecca3;
}

/* Race Details Panel */
.race-details-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #334;
}

.race-details-section {
    margin-bottom: 12px;
}

.race-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.race-stat {
    font-size: 0.85rem;
    color: #ccc;
}

.race-stat strong {
    color: #888;
}

.race-traits-header {
    font-size: 0.85rem;
    font-weight: bold;
    color: #4ecca3;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.race-traits-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.race-trait {
    background: #0f0f1a;
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 2px solid #4ecca3;
}

.race-trait-name {
    font-weight: bold;
    color: #e0e0e0;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.race-trait-desc {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.4;
}

.race-details-actions {
    margin-top: 12px;
    text-align: center;
}

.race-details-actions .btn-primary {
    min-width: 150px;
}

/* Custom Origin Form */
.custom-origin-form {
    padding: 15px;
}

.custom-origin-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-field label {
    font-size: 0.85rem;
    color: #aaa;
}

.custom-field input[type="text"],
.custom-field input[type="number"],
.custom-field select,
.custom-field textarea {
    padding: 8px 12px;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.custom-field input:focus,
.custom-field select:focus,
.custom-field textarea:focus {
    outline: none;
    border-color: #4ecca3;
}

.custom-field input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-field textarea {
    resize: vertical;
    min-height: 60px;
}

.custom-field-row {
    display: flex;
    gap: 15px;
}

.custom-field-row .custom-field {
    flex: 1;
}

.custom-field.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.custom-field.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: #e0e0e0;
    cursor: pointer;
}

.custom-field.checkbox-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4ecca3;
}

.custom-field.checkbox-field input[type="number"] {
    width: 70px;
}

.field-suffix {
    font-size: 0.85rem;
    color: #888;
    margin-left: 4px;
}

.race-option.custom-origin .race-option-summary {
    color: #4ecca3;
    font-style: italic;
}

/* Background Selection Styles */
.background-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.background-source-group {
    border: 1px solid #334;
    border-radius: 8px;
    overflow: hidden;
}

.source-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #1a1a2e;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.source-group-header:hover {
    background: #252540;
}

.source-group-icon {
    font-size: 0.8rem;
    color: #888;
    width: 12px;
}

.source-group-name {
    font-weight: 600;
    color: #e0e0e0;
}

.source-group-count {
    font-size: 0.85rem;
    color: #888;
    margin-left: auto;
}

.source-group-contents {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.background-option {
    padding: 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.background-option:hover {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.background-option.expanded {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.05);
}

.background-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.background-option-header strong {
    color: #e0e0e0;
}

.background-source {
    font-size: 0.8rem;
    color: #888;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.bg-expand-icon {
    font-size: 0.8rem;
    color: #888;
    margin-left: auto;
    padding-left: 10px;
}

.background-option.expanded .bg-expand-icon {
    color: #4ecca3;
}

.background-option-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #888;
}

.background-details-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #334;
}

.background-details-section {
    margin-bottom: 12px;
}

.bg-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bg-stat {
    font-size: 0.9rem;
    color: #ccc;
}

.bg-description {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
}

.background-details-actions {
    margin-top: 12px;
    text-align: center;
}

.background-option.custom-bg .background-option-summary {
    color: #4ecca3;
    font-style: italic;
}

.custom-bg-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Feat Selection Styles */
.feat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feat-option {
    padding: 12px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.feat-option:hover {
    border-color: #f0a500;
    background: rgba(240, 165, 0, 0.1);
}

.feat-option.expanded {
    border-color: #f0a500;
    background: rgba(240, 165, 0, 0.05);
}

.feat-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.feat-option-header strong {
    color: #e0e0e0;
}

.feat-asi-badge {
    font-size: 0.75rem;
    color: #4ecca3;
    background: rgba(78, 204, 163, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.feat-source {
    font-size: 0.8rem;
    color: #888;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.feat-expand-icon {
    font-size: 0.8rem;
    color: #888;
}

.feat-option.expanded .feat-expand-icon {
    color: #f0a500;
}

.feat-option-summary {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #888;
}

.feat-prereq {
    color: #e94560;
}

.feat-details-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #334;
}

.feat-description {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
    white-space: pre-wrap;
}

.feat-asi-selection {
    padding: 10px;
    background: rgba(78, 204, 163, 0.1);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 6px;
}

.feat-asi-selection label {
    display: block;
    margin-bottom: 8px;
    color: #4ecca3;
}

.feat-asi-selection select {
    width: 100%;
    padding: 8px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.feat-details-actions {
    margin-top: 12px;
    text-align: center;
}

/* Edit Character Section & Modal */
.edit-character-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #334;
    text-align: center;
}

.btn-edit-character {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-edit-character:hover {
    border-color: #e94560;
    color: #e94560;
}

.edit-char-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.edit-char-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #1a1a2e;
    border-radius: 6px;
}

.edit-char-row span {
    color: #ccc;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.btn-danger {
    border-color: #e94560;
    color: #e94560;
}

.btn-danger:hover {
    background: rgba(233, 69, 96, 0.2);
}

/* Ability Score Selection Modal */
.ability-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ability-select-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ability-select-row label {
    min-width: 100px;
    color: #ccc;
}

.ability-select-row select {
    flex: 1;
    padding: 10px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
    cursor: pointer;
}

.ability-select-row select:focus {
    outline: none;
    border-color: #4ecca3;
}

.ability-select-row select option:disabled {
    color: #666;
}

/* Race Reference Info */
.race-ref-info {
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.race-ref-info .ref-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.race-ref-info .ref-value {
    color: #4ecca3;
    font-weight: 500;
}

/* Ability Bonus Grid */
.ability-bonus-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.ability-bonus-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ability-bonus-input label {
    font-size: 0.75rem;
    color: #888;
    font-weight: bold;
}

.ability-bonus-input input {
    width: 50px;
    padding: 8px 4px;
    text-align: center;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: bold;
}

.ability-bonus-input input:focus {
    outline: none;
    border-color: #4ecca3;
}

.ability-bonus-input input:not([value="0"]) {
    border-color: #4ecca3;
    color: #4ecca3;
}

/* Bonus Preview */
.bonus-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #0f0f1a;
    border-radius: 6px;
    min-height: 40px;
    align-items: center;
}

.bonus-tag {
    background: #1a3a2e;
    color: #4ecca3;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* Base Stats Modal - Method Selector */
.stat-method-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.method-radio {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.method-radio:hover {
    border-color: #4ecca3;
}

.method-radio.selected {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.method-radio input[type="radio"] {
    display: none;
}

.method-name {
    font-weight: bold;
    color: #e0e0e0;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.method-hint {
    color: #888;
    font-size: 0.7rem;
}

.method-radio.selected .method-name {
    color: #4ecca3;
}

/* Method Info Box */
.method-info {
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #ccc;
}

.method-info strong {
    color: #4ecca3;
}

.point-cost-table {
    margin: 8px auto 0;
    border-collapse: collapse;
    font-size: 0.75rem;
    width: 100%;
    max-width: 400px;
}

.point-cost-table th,
.point-cost-table td {
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #334;
}

.point-cost-table th {
    background: #252538;
    color: #888;
}

.point-cost-table tr:first-child td {
    color: #e0e0e0;
    font-weight: bold;
}

.point-cost-table tr:last-child td {
    color: #4ecca3;
}

/* Array Remaining */
.array-remaining {
    text-align: center;
    padding: 8px;
    background: #1a1a2e;
    border-radius: 6px;
    color: #888;
    font-size: 0.85rem;
}

.array-remaining span {
    color: #4ecca3;
    font-weight: bold;
}

/* Base Stats Entry */
.base-stats-entry {
    background: #0f0f1a;
    border-radius: 8px;
    padding: 15px;
}

.base-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.base-stat-input {
    text-align: center;
}

.base-stat-input label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    font-weight: bold;
    margin-bottom: 6px;
}

.base-stat-input .racial-bonus {
    color: #4ecca3;
    font-size: 0.65rem;
    margin-left: 2px;
}

.stat-input-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.base-stat-input input {
    width: 50px;
    padding: 8px 4px;
    text-align: center;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: bold;
}

.base-stat-input input:focus {
    outline: none;
    border-color: #4ecca3;
}

.base-stat-input select {
    width: 60px;
    padding: 8px 4px;
    text-align: center;
    background: #1a1a2e;
    border: 1px solid #334;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

.base-stat-input select:focus {
    outline: none;
    border-color: #4ecca3;
}

.base-stat-input select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

.base-stat-input select option:disabled {
    color: #555;
}

.stat-equals {
    color: #666;
    font-size: 0.8rem;
}

.stat-total {
    color: #4ecca3;
    font-weight: bold;
    font-size: 1.1rem;
    background: rgba(78, 204, 163, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.point-buy-counter {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    padding: 8px;
    background: #1a1a2e;
    border-radius: 6px;
}

.point-buy-counter.exact {
    color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.point-buy-counter.over {
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

/* Personality */
.personality-field {
    margin-bottom: 10px;
}

.personality-field:last-child {
    margin-bottom: 0;
}

.personality-field label {
    display: block;
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.personality-field textarea {
    min-height: 50px;
}

/* Responsive Sheet */
@media (max-width: 1200px) {
    .sheet-body {
        grid-template-columns: 180px 1fr;
    }
}

@media (max-width: 768px) {
    .sheet-body {
        grid-template-columns: 1fr;
    }

    .ability-scores {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ability-score {
        flex: 1;
        min-width: 60px;
    }

    .combat-stats {
        flex-wrap: wrap;
    }

    .combat-stat {
        min-width: 80px;
    }

    .portal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-header-left,
    .portal-header-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* === REFERENCE PANEL ADD BUTTONS === */
.ref-add-to-sheet {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #4ecca3 0%, #3db38e 100%);
    border: none;
    border-radius: 6px;
    color: #0f0f1a;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ref-add-to-sheet:hover {
    background: linear-gradient(135deg, #5fd4af 0%, #4ecca3 100%);
    transform: translateY(-1px);
}

.ref-add-to-sheet.btn-add-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
    margin: 8px 0;
}

/* === CHARACTER SHEET CLEAR BUTTONS === */
.sheet-field.with-clear {
    position: relative;
}

.sheet-field.with-clear input[readonly] {
    background: rgba(78, 204, 163, 0.1);
    border-color: #4ecca3;
    padding-right: 30px;
}

.btn-clear {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 22px;
    height: 22px;
    background: rgba(233, 69, 96, 0.8);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-clear:hover {
    background: #e94560;
}

/* === TRAITS SECTIONS === */
.traits-box, .feats-box {
    background: #12121f;
    border: 1px solid #334;
    border-radius: 8px;
    padding: 12px;
}

.traits-box h4, .feats-box h4 {
    color: #e94560;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #334;
    display: flex;
    align-items: center;
    gap: 8px;
}

.traits-source {
    color: #888;
    font-weight: normal;
    text-transform: none;
    font-size: 0.7rem;
}

.traits-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.trait-tag {
    background: rgba(78, 204, 163, 0.15);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.75rem;
    color: #4ecca3;
}

.trait-languages {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
}

.traits-list, .feats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trait-item, .feat-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px;
}

.trait-header, .feat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.trait-header strong, .feat-header strong {
    color: #e0e0e0;
    font-size: 0.85rem;
}

.trait-level {
    background: #e94560;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
}

.trait-desc, .feat-desc {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.5;
}

.trait-desc em, .feat-desc em {
    color: #4ecca3;
}

.trait-desc strong, .feat-desc strong {
    color: #e94560;
}

.feat-prereq {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin-bottom: 6px;
}

.btn-remove-feat {
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid rgba(233, 69, 96, 0.4);
    color: #e94560;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-feat:hover {
    background: #e94560;
    color: white;
}

/* === LIVE CALCULATION ANIMATIONS === */
@keyframes valueFlash {
    0% {
        color: #4ecca3;
        transform: scale(1.15);
    }
    100% {
        color: inherit;
        transform: scale(1);
    }
}

.value-changed {
    animation: valueFlash 0.3s ease-out;
}

.ability-mod.value-changed {
    animation: valueFlash 0.3s ease-out;
    color: #4ecca3;
}

.save-mod.value-changed,
.skill-mod.value-changed {
    animation: valueFlash 0.3s ease-out;
}

.prof-value.value-changed {
    animation: valueFlash 0.4s ease-out;
}

[data-initiative].value-changed {
    animation: valueFlash 0.3s ease-out;
}

/* === SKILL SOURCE TRACKING === */
.skill-row {
    position: relative;
}

.skill-row.has-expertise {
    background: rgba(179, 102, 255, 0.1);
    border-radius: 3px;
    margin: -2px -4px;
    padding: 2px 4px;
}

.skill-row.is-proficient:not(.has-expertise) {
    background: rgba(78, 204, 163, 0.05);
    border-radius: 3px;
    margin: -2px -4px;
    padding: 2px 4px;
}

.skill-source {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    padding: 1px 4px;
    background: #0f0f1a;
    border: 1px solid #334;
    border-radius: 3px;
    color: #888;
    cursor: pointer;
}

.skill-source:focus {
    outline: none;
    border-color: #e94560;
}

.skill-budget-mini {
    font-size: 0.65rem;
    color: #888;
    font-weight: normal;
    margin-left: 8px;
}

/* === RESOURCE TRACKERS === */
.resource-trackers {
    background: #12121f;
}

.resource-trackers h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-rest {
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.4);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-rest:hover {
    background: rgba(78, 204, 163, 0.4);
}

.tracker-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    margin: 12px 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tracker-label:first-of-type {
    margin-top: 0;
}

/* Spell Slots */
.spell-slots-tracker {
    margin-bottom: 10px;
}

.slot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.slot-level {
    font-size: 0.75rem;
    color: #888;
    width: 28px;
}

.slot-pips {
    display: flex;
    gap: 4px;
    flex: 1;
}

.slot-pip {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #4a9eff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.slot-pip.filled {
    background: linear-gradient(135deg, #4a9eff 0%, #3a7ecc 100%);
    box-shadow: 0 0 6px rgba(74, 158, 255, 0.4);
}

.slot-pip.empty {
    background: transparent;
}

.slot-pip:hover {
    transform: scale(1.1);
    border-color: #6ab0ff;
}

.slot-count {
    font-size: 0.7rem;
    color: #666;
    width: 30px;
    text-align: right;
}

.slot-edit {
    background: none;
    border: none;
    color: #555;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px;
}

.slot-edit:hover {
    color: #888;
}

/* Custom Resources */
.custom-resources {
    margin-top: 10px;
}

.btn-add-resource {
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.4);
    color: #4ecca3;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-resource:hover {
    background: rgba(78, 204, 163, 0.4);
}

.resource-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 0.8rem;
}

.resource-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-pips {
    display: flex;
    gap: 3px;
}

.resource-pip {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #b366ff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.resource-pip.filled {
    background: linear-gradient(135deg, #b366ff 0%, #9945e6 100%);
}

.resource-pip.empty {
    background: transparent;
}

.resource-pip:hover {
    transform: scale(1.1);
}

.resource-count {
    font-size: 0.65rem;
    color: #666;
    width: 26px;
    text-align: right;
}

.resource-recharge {
    font-size: 0.6rem;
    color: #666;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 4px;
    border-radius: 2px;
}

.resource-remove {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.resource-remove:hover {
    color: #e94560;
}

/* Passive Scores */
.passive-scores {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #334;
}

.passive-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.8rem;
}

.passive-name {
    color: #888;
}

.passive-value {
    font-weight: bold;
    color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}
