/* Rangers of Shadow Deep - Dark Fantasy Theme */

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    background-image:
        radial-gradient(ellipse at top, rgba(22, 33, 62, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(61, 41, 20, 0.2) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c9a227;
}

/* Tab buttons */
.tab-btn {
    padding: 0.75rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: #d4c4a8;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #c9a227;
}

.tab-btn-active {
    color: #c9a227;
    border-bottom-color: #c9a227;
    background: linear-gradient(to top, rgba(201, 162, 39, 0.1), transparent);
}

/* Card component */
.card {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a2e 100%);
    border: 1px solid #3d2914;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: #c9a227;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #3d2914;
}

/* Character card (parchment style) */
.character-card {
    background: linear-gradient(135deg, #f4e4bc 0%, #e8d4a8 50%, #d4c4a8 100%);
    border: 2px solid #5c4428;
    border-radius: 4px;
    padding: 1rem;
    color: #1a1a2e;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(139, 115, 85, 0.2);
    position: relative;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    border-radius: 4px;
}

.character-card-title {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: #3d2914;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, #c9a227 0%, #8b7355 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #d4b23a 0%, #9c8460 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #3d2914 0%, #2d2d2d 100%);
    color: #d4c4a8;
    border: 1px solid #5c4428;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4a3520 0%, #3d3d3d 100%);
    border-color: #8b7355;
}

.btn-danger {
    background: linear-gradient(135deg, #8b0000 0%, #5c0000 100%);
    color: #f4e4bc;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #a31621 0%, #6b0000 100%);
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
}

/* Stat adjustment buttons */
.btn-stat {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #3d2914 0%, #2d2d2d 100%);
    color: #d4c4a8;
    border: 1px solid #5c4428;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-stat:hover:not(:disabled) {
    background: linear-gradient(135deg, #4a3520 0%, #3d3d3d 100%);
    border-color: #8b7355;
}

.btn-stat:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-stat-sm {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    font-family: 'Crimson Text', serif;
    font-size: 0.875rem;
    font-weight: bold;
    line-height: 1;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #3d2914 0%, #2d2d2d 100%);
    color: #d4c4a8;
    border: 1px solid #5c4428;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-stat-sm:hover:not(:disabled) {
    background: linear-gradient(135deg, #4a3520 0%, #3d3d3d 100%);
    border-color: #8b7355;
}

.btn-stat-sm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Form inputs */
.input-field {
    background: #1a1a2e;
    border: 1px solid #3d2914;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: #f4e4bc;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: #c9a227;
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
}

.input-field::placeholder {
    color: #8b7355;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    color: #d4c4a8;
    margin-bottom: 0.25rem;
}

/* Select styling */
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c9a227' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Checkbox styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: #1a1a2e;
    border: 1px solid #3d2914;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: #c9a227;
    border-color: #c9a227;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1a1a2e;
    font-size: 0.875rem;
    font-weight: bold;
}

/* Stat display */
.stat-box {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid #3d2914;
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #8b7355;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: #c9a227;
}

/* Health bar */
.health-bar {
    height: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #3d2914;
}

.health-bar-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.health-bar-fill.healthy {
    background: linear-gradient(90deg, #2d5a27, #3d7a37);
}

.health-bar-fill.wounded {
    background: linear-gradient(90deg, #c9a227, #b8922a);
}

.health-bar-fill.critical {
    background: linear-gradient(90deg, #8b0000, #a31621);
}

/* Dice display */
.dice-result {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.2) 0%, transparent 70%);
    border-radius: 8px;
    animation: diceGlow 1s ease-out;
}

@keyframes diceGlow {
    0% {
        text-shadow: 0 0 20px #c9a227, 0 0 40px #c9a227;
    }
    100% {
        text-shadow: 0 0 5px rgba(201, 162, 39, 0.5);
    }
}

.dice-rolling {
    animation: diceRoll 0.1s linear infinite;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a2e 100%);
    border: 2px solid #3d2914;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Combat log */
.combat-log {
    background: linear-gradient(135deg, #f4e4bc 0%, #e8d4a8 100%);
    border: 2px solid #5c4428;
    border-radius: 4px;
    padding: 1rem;
    color: #1a1a2e;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Crimson Text', serif;
}

.combat-log-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(61, 41, 20, 0.3);
}

.combat-log-entry:last-child {
    border-bottom: none;
}

.combat-log-timestamp {
    font-size: 0.75rem;
    color: #8b7355;
}

/* Tags/chips - WCAG compliant contrast for parchment backgrounds */
.tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    background: #5c4428;
    color: #f4e4bc;
    border: 1px solid #3d2914;
    font-weight: 500;
}

/* Skills - dark green background with light text (7:1+ contrast) */
.tag-skill {
    background: #1e4620;
    border-color: #143016;
    color: #e8f5e9;
}

/* Heroic Abilities - dark amber/bronze background with light text (7:1+ contrast) */
.tag-ability {
    background: #7a5c1e;
    border-color: #5c4428;
    color: #fff8e1;
}

/* Spells - dark purple/indigo background with light text (7:1+ contrast) */
.tag-spell {
    background: #2e1a47;
    border-color: #1a0f2e;
    color: #ede7f6;
}

/* Creature/enemy styling */
.creature-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a2e 100%);
    border: 1px solid #8b0000;
    border-radius: 4px;
    padding: 0.75rem;
}

/* Utility classes */
.text-success {
    color: #2d5a27;
}

.text-danger {
    color: #a31621;
}

.text-warning {
    color: #c9a227;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .dice-result {
        font-size: 2.5rem;
    }
}

/* Multi-select styling */
.multi-select {
    background: #1a1a2e;
    border: 1px solid #3d2914;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.multi-select-tall {
    max-height: 300px;
}

.multi-select-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.multi-select-option:hover {
    background: rgba(201, 162, 39, 0.1);
}

.multi-select-option.selected {
    background: rgba(201, 162, 39, 0.2);
}

/* Number input with +/- buttons */
.number-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.number-input-group input {
    width: 3rem;
    text-align: center;
    -moz-appearance: textfield;
}

.number-input-group input::-webkit-outer-spin-button,
.number-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: #1a1a2e;
    border: 1px solid #3d2914;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Character Sheet - Matching Official PDF Layout */

/* Overlay */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
    overflow-y: auto;
}

/* Main Container */
.sheet-container {
    background: #faf6f0;
    border: 1px solid #1a1a1a;
    width: 100%;
    max-width: 750px;
    max-height: 95vh;
    overflow-y: auto;
    color: #1a1a1a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    padding: 40px 30px 30px 30px;
}

/* Decorative Corner Flourishes */
.sheet-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0.7;
}

.sheet-corner-tl {
    top: 8px;
    left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M5 25 Q5 5 25 5 M15 25 Q15 15 25 15 M10 30 C10 10 10 10 30 10' stroke='%23333' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='8' cy='8' r='3' fill='%23333'/%3E%3Ccircle cx='5' cy='15' r='2' fill='%23333'/%3E%3Ccircle cx='15' cy='5' r='2' fill='%23333'/%3E%3C/svg%3E");
}

.sheet-corner-tr {
    top: 8px;
    right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M45 25 Q45 5 25 5 M35 25 Q35 15 25 15 M40 30 C40 10 40 10 20 10' stroke='%23333' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='42' cy='8' r='3' fill='%23333'/%3E%3Ccircle cx='45' cy='15' r='2' fill='%23333'/%3E%3Ccircle cx='35' cy='5' r='2' fill='%23333'/%3E%3C/svg%3E");
}

.sheet-corner-bl {
    bottom: 8px;
    left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M5 25 Q5 45 25 45 M15 25 Q15 35 25 35 M10 20 C10 40 10 40 30 40' stroke='%23333' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='8' cy='42' r='3' fill='%23333'/%3E%3Ccircle cx='5' cy='35' r='2' fill='%23333'/%3E%3Ccircle cx='15' cy='45' r='2' fill='%23333'/%3E%3C/svg%3E");
}

.sheet-corner-br {
    bottom: 8px;
    right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M45 25 Q45 45 25 45 M35 25 Q35 35 25 35 M40 20 C40 40 40 40 20 40' stroke='%23333' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='42' cy='42' r='3' fill='%23333'/%3E%3Ccircle cx='45' cy='35' r='2' fill='%23333'/%3E%3Ccircle cx='35' cy='45' r='2' fill='%23333'/%3E%3C/svg%3E");
}

/* Action Buttons */
.sheet-buttons {
    position: absolute;
    top: 10px;
    right: 70px;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

/* Main Content Area */
.sheet-content {
    position: relative;
    z-index: 1;
}

/* Table Styling */
.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.9rem;
}

.sheet-cell {
    border: 1px solid #c4a4a4;
    padding: 4px 8px;
    vertical-align: middle;
}

.sheet-label-cell {
    font-weight: 600;
    text-align: center;
    background: #faf6f0;
}

.sheet-value-cell {
    text-align: center;
    min-height: 28px;
    font-size: 1rem;
}

.sheet-stats-row .sheet-cell {
    height: 36px;
}

/* Header Table */
.sheet-header-table {
    margin-bottom: 12px;
}

/* Section Headers */
.sheet-section-header {
    background: linear-gradient(to bottom, #e8d4d4 0%, #dcc4c4 100%);
    font-weight: 600;
    text-align: center;
    padding: 6px 8px;
}

/* Two Column Layout */
.sheet-two-col {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.sheet-left-col {
    flex: 1;
}

.sheet-right-col {
    flex: 0 0 auto;
    width: 200px;
}

.sheet-left-col .sheet-table {
    border-right: none;
}

.sheet-left-col .sheet-cell {
    border-right: none;
}

.sheet-right-col .sheet-cell:first-child {
    border-left: 1px solid #c4a4a4;
}

/* Companion compact sheet */
.sheet-container-compact {
    max-width: 550px;
}

.sheet-right-col-companion {
    width: 160px;
}

/* List Cells */
.sheet-list-cell {
    min-height: 24px;
    padding: 3px 8px;
}

/* Skills */
.sheet-skill-name {
    padding: 3px 8px;
    width: auto;
}

.sheet-skill-value {
    width: 40px;
    text-align: center;
    padding: 3px 8px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Notes Table */
.sheet-notes-table {
    margin-top: 0;
}

.sheet-notes-table .sheet-cell {
    border-top: none;
}

.sheet-notes-cell {
    min-height: 120px;
    vertical-align: top;
    padding: 8px;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body * {
        visibility: hidden;
    }

    .sheet-overlay,
    .sheet-overlay * {
        visibility: visible;
    }

    .sheet-overlay {
        position: absolute;
        left: 0;
        top: 0;
        background: white;
        padding: 0;
        overflow: visible;
    }

    .sheet-container {
        max-width: 100%;
        max-height: none;
        box-shadow: none;
        margin: 0;
        padding: 30px;
        border: 1px solid #333;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .sheet-container {
        padding: 30px 15px 20px 15px;
    }

    .sheet-two-col {
        flex-direction: column;
    }

    .sheet-right-col {
        width: 100%;
    }

    .sheet-left-col .sheet-cell {
        border-right: 1px solid #c4a4a4;
    }

    .sheet-corner {
        width: 35px;
        height: 35px;
    }

    .sheet-buttons {
        right: 50px;
    }

    .sheet-table {
        font-size: 0.8rem;
    }
}

/* ===============================================
   Reference Modal - Mobile-Friendly Game Reference
   =============================================== */

.reference-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 300;
}

.reference-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #0d0d14 100%);
    width: 100%;
    max-width: 600px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 768px) {
    .reference-modal {
        max-height: 90vh;
        height: auto;
        margin: 2rem;
        border-radius: 8px;
        border: 2px solid #3d2914;
    }
}

.reference-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #3d2914;
    background: #1a1a2e;
    flex-shrink: 0;
}

.reference-close-btn {
    background: none;
    border: none;
    color: #d4c4a8;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.reference-close-btn:hover {
    color: #c9a227;
}

.reference-search {
    position: relative;
    padding: 0.75rem 1rem;
    background: #16213e;
    flex-shrink: 0;
}

.reference-search .input-field {
    padding-right: 2.5rem;
}

.reference-search-clear {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8b7355;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.reference-search-clear:hover {
    color: #c9a227;
}

.reference-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid #3d2914;
    background: #1a1a2e;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.reference-tabs::-webkit-scrollbar {
    display: none;
}

.reference-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #8b7355;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 70px;
}

.reference-tab:hover {
    color: #d4c4a8;
}

.reference-tab-active {
    color: #c9a227;
    border-bottom-color: #c9a227;
    background: linear-gradient(to top, rgba(201, 162, 39, 0.1), transparent);
}

.reference-tab-icon {
    font-size: 1.25rem;
}

.reference-tab-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Cinzel', serif;
}

.reference-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

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

.reference-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a2e 100%);
    border: 1px solid #3d2914;
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reference-card:hover {
    border-color: #8b7355;
}

.reference-card:active {
    border-color: #c9a227;
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.3);
}

.reference-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.reference-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: #f4e4bc;
}

.reference-card-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-basic {
    background: #2d5a27;
    color: #e8f5e9;
}

.badge-magic {
    background: #7a5c1e;
    color: #fff8e1;
}

.reference-card-type {
    font-size: 0.75rem;
    color: #8b7355;
    flex-shrink: 0;
}

.reference-card-stats {
    font-size: 0.8rem;
    color: #c9a227;
    margin-bottom: 0.25rem;
}

.reference-card-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3d2914;
    font-size: 0.9rem;
    color: #d4c4a8;
    line-height: 1.5;
}

.reference-card-props {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.reference-prop {
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    background: #16213e;
    border: 1px solid #3d2914;
    border-radius: 3px;
    color: #8b7355;
}

.reference-card-expand-hint {
    font-size: 0.7rem;
    color: #5c4428;
    text-align: center;
    margin-top: 0.5rem;
}

/* Reference button in header */
.reference-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #3d2914 0%, #2d2d2d 100%);
    border: 1px solid #5c4428;
    border-radius: 4px;
    color: #d4c4a8;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reference-btn:hover {
    background: linear-gradient(135deg, #4a3520 0%, #3d3d3d 100%);
    border-color: #8b7355;
    color: #c9a227;
}

.reference-btn-icon {
    font-size: 1rem;
}
