/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ff6600;
    --info-color: #17a2b8;
    
    --tier-s-plus: #ffcccc;
    --tier-s: #ffe6cc;
    --tier-a: #ffffcc;
    --tier-b: #e6ffcc;
    --tier-c: #ccffcc;
    --tier-d: #ccffe6;
    
    --free-bg: #e6f3ff;
    --hover-bg: #f0f8ff;
    
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --bg-primary: #f5f5f5;
    --bg-secondary: white;
}

/* Dark theme as default */
:root {
    --primary-color: #4a9eff;
    --primary-hover: #3a8eef;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --tier-s-plus: #8b4444;
    --tier-s: #8b6444;
    --tier-a: #8b8b44;
    --tier-b: #648b44;
    --tier-c: #448b44;
    --tier-d: #448b64;
    
    --free-bg: #2a3a4a;
    --hover-bg: #3a4a5a;
    
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    --border-color: #444;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
}

/* Manual theme classes */
body.light-theme {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ff6600;
    --info-color: #17a2b8;
    
    --tier-s-plus: #ffcccc;
    --tier-s: #ffe6cc;
    --tier-a: #ffffcc;
    --tier-b: #e6ffcc;
    --tier-c: #ccffcc;
    --tier-d: #ccffe6;
    
    --free-bg: #e6f3ff;
    --hover-bg: #f0f8ff;
    
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --bg-primary: #f5f5f5;
    --bg-secondary: white;
}

body.dark-theme {
    --primary-color: #4a9eff;
    --primary-hover: #3a8eef;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --tier-s-plus: #8b4444;
    --tier-s: #8b6444;
    --tier-a: #8b8b44;
    --tier-b: #648b44;
    --tier-c: #448b44;
    --tier-d: #448b64;
    
    --free-bg: #2a3a4a;
    --hover-bg: #3a4a5a;
    
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    --border-color: #444;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
}

/* Light theme for users who prefer light mode */
@media (prefers-color-scheme: light) {
    :root {
        --primary-color: #0066cc;
        --primary-hover: #0052a3;
        --success-color: #28a745;
        --danger-color: #dc3545;
        --warning-color: #ff6600;
        --info-color: #17a2b8;
        
        --tier-s-plus: #ffcccc;
        --tier-s: #ffe6cc;
        --tier-a: #ffffcc;
        --tier-b: #e6ffcc;
        --tier-c: #ccffcc;
        --tier-d: #ccffe6;
        
        --free-bg: #e6f3ff;
        --hover-bg: #f0f8ff;
        
        --text-primary: #333;
        --text-secondary: #666;
        --text-muted: #999;
        
        --border-color: #ddd;
        --shadow: 0 2px 10px rgba(0,0,0,0.1);
        --bg-primary: #f5f5f5;
        --bg-secondary: white;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.version {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.version:hover {
    background: var(--primary-hover);
    color: white;
}

.github-link,
.donation-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.github-link:hover {
    color: var(--primary-color);
}

.donation-link:hover {
    color: var(--warning-color);
}

/* Filter Styles */
.filters {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.action-group {
    display: flex;
    gap: 10px;
}

.search-box, .filter-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.search-box {
    width: 300px;
}

.search-box:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

#themeToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 10px;
}

#themeToggle svg {
    transition: transform 0.2s ease;
}

#themeToggle:hover svg {
    transform: rotate(180deg);
}

/* Legend Styles */
.legend {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.legend h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.legend-header:hover {
    color: var(--primary-hover);
}

.collapse-indicator {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.legend.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

.legend-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.legend.collapsed .legend-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

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

.legend-section h4 {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.legend-item {
    margin: 8px 0;
    color: var(--text-secondary);
}

.legend-key {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 5px;
}

.free-note {
    color: var(--warning-color);
    font-weight: 500;
}

/* Stats Bar */
.stats {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    font-size: 0.9em;
}

.stat-item {
    color: var(--text-secondary);
}

.stat-item span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Column Visibility Controls */
.column-controls {
    background: var(--bg-secondary);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.column-groups {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 5px;
}

.group-toggle {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.group-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.group-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toggle-icon {
    font-size: 0.8rem;
    font-weight: 700;
}


/* Column Visibility - CSS-based approach */
.hidden {
    display: none !important;
}

/* Column group hiding via table classes */
.hide-ownership .column-group-ownership {
    display: none !important;
}

.hide-tiers .column-group-tiers {
    display: none !important;
}

.hide-core .column-group-core {
    display: none !important;
}

.hide-awakening .column-group-awakening {
    display: none !important;
}

.hide-combat .column-group-combat {
    display: none !important;
}

.hide-acquisition .column-group-acquisition {
    display: none !important;
}

.hide-notes .column-group-notes {
    display: none !important;
}

/* Always visible columns are never hidden */
.always-visible {
    display: table-cell !important;
}

/* N/A Stones for 3★/4★ characters */
.na-stone {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
}

/* Table Styles */
.table-container {
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

th.sortable:hover {
    background: var(--primary-hover);
}

.sort-indicator {
    position: absolute;
    right: 10px;
    opacity: 0.5;
}

.sort-asc .sort-indicator::after {
    content: "▲";
    opacity: 1;
}

.sort-desc .sort-indicator::after {
    content: "▼";
    opacity: 1;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--hover-bg);
}

tr.free-char {
    background: var(--free-bg);
    font-style: italic;
}

tr.free-char:hover {
    background: #d9ecff;
}

/* Tier Colors */
.tier-s-plus { background: var(--tier-s-plus) !important; font-weight: 600; }
.tier-s { background: var(--tier-s); font-weight: 600; }
.tier-a { background: var(--tier-a); }
.tier-b { background: var(--tier-b); }
.tier-c { background: transparent; }
.tier-d { background: transparent; }

/* Tier colors on hover - blend with hover background */
tr:hover .tier-s-plus { background: var(--tier-s-plus); opacity: 0.8; }
tr:hover .tier-s { background: var(--tier-s); opacity: 0.8; }
tr:hover .tier-a { background: var(--tier-a); opacity: 0.8; }
tr:hover .tier-b { background: var(--tier-b); opacity: 0.8; }

/* Stone Priority Colors */
.u10 { color: var(--danger-color); font-weight: 600; }
.a1, .a2, .a3, .a4 { color: var(--primary-color); }
.a4 { font-weight: 600; }
.shard { color: var(--text-primary); font-weight: 500; opacity: 0.8; }
.keep { color: var(--success-color); font-weight: 600; }
.no-shard { color: var(--warning-color); text-decoration: line-through; }


/* Text shadows for better readability on hover */
tr:hover td {
    text-shadow: 0 0 2px var(--bg-secondary), 0 0 4px var(--bg-secondary);
}

/* Visual Group Headers */
.group-header {
    background: var(--primary-color) !important;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 56px; /* Height of table header */
    z-index: 50;
}

.group-header:hover {
    background: var(--primary-hover) !important;
}

.group-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.group-title {
    padding: 12px 15px !important;
    font-size: 1.1em;
    text-align: left;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-icon {
    font-size: 0.9em;
    transition: transform 0.2s ease;
    min-width: 12px;
}

.group-name {
    font-weight: 700;
    flex: 1;
}

.group-count {
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 400;
}

/* Group member visibility */
.group-member.hidden {
    display: none !important;
}

/* Add spacing between groups */
.group-header + .character-row {
    border-top: 3px solid var(--primary-color);
}

/* Ownership and Level Controls */
.ownership-header {
    width: 60px;
    text-align: center;
}

.ownership-checkbox {
    cursor: pointer;
    transform: scale(1.2);
}

.level-input {
    width: 50px;
    padding: 2px 4px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    font-size: 0.8rem;
}

.level-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.character-row.owned {
    background-color: var(--hover-bg);
    opacity: 1;
}

.character-row.owned:hover {
    background-color: var(--hover-bg);
    filter: brightness(1.1);
}

.character-row.not-owned {
    opacity: 0.6;
}

/* Credits Section */
.credits {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.credits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
    font-size: 1.3em;
    margin-bottom: 0;
    color: var(--primary-color);
}

.credits-header:hover {
    color: var(--primary-hover);
}

.credits-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.credits-content.expanded {
    max-height: 800px;
    opacity: 1;
    margin-top: 20px;
}

.credits.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.credits-section h4 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.credits-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credits-section li {
    margin: 8px 0;
    color: var(--text-secondary);
    padding-left: 15px;
    position: relative;
}

.credits-section li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.credits-section strong {
    color: var(--text-primary);
}

.disclaimer {
    background: var(--hover-bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
}

.disclaimer p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
}

/* Navigation Link Styling */
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Loading State */
.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 30px;
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

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

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .meta-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .action-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        justify-content: space-around;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .filters, .action-group, footer {
        display: none;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    header, .legend, .table-container {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
    
    tr.free-char {
        font-style: normal;
    }
    
    tr.free-char td:first-child::after {
        content: " (Free)";
    }
}

/* Character Details Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-primary);
}

.modal-title h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-content {
    position: relative;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.modal-loading {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.modal-body {
    padding: 16px;
    line-height: 1.5;
}

/* Character Details Content - Compact Layout */
.character-overview {
    margin-bottom: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 16px;
}

.character-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stats-table h4,
.attributes-table h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stats-table td {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
}

.stats-table td:first-child,
.stats-table td:nth-child(3) {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    width: 25%;
}

.stats-table td:nth-child(2),
.stats-table td:nth-child(4) {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.attribute-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.attribute-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.attribute-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Compact skill items */
.skill-item {
    margin: 8px 0;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.section-content {
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Markdown Content Styling */
.modal-body h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.modal-body h2:first-child {
    margin-top: 0;
}

.modal-body h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 12px 0;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-body aside {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.modal-body aside p {
    margin: 0;
}

.skill-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.skill-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.skill-details {
    flex: 1;
}

.skill-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.skill-description {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Image fallbacks */
.skill-icon-fallback {
    width: 40px;
    height: 40px;
    background: var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

/* Character name clickable styling */
.character-name-link {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.character-name-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Modal responsive design */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .character-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-table table {
        font-size: 0.8rem;
    }
    
    .stats-table td {
        padding: 3px 6px;
    }
    
    .attribute-icons {
        gap: 6px;
    }
    
    .attribute-icon {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .attribute-icon img {
        width: 14px;
        height: 14px;
    }
    
    .skill-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .skill-icon, .skill-icon-fallback {
        margin-bottom: 8px;
    }
}