[hideprofile][html]
<!-- Character Browser HTML Snippet -->
<div class="character-browser">
    <style>
        .character-browser {
            width: 100%;
            max-width: 100%;
            display: flex;
            flex-direction: column;
            margin: 0 auto;
            padding: 0 20px 20px;
            background: #f8f9fa;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            box-sizing: border-box;
        }

        .controls {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
            padding: 15px;
            background: white;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            flex-shrink: 0;
        }

        .letter-nav {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            justify-content: center;
            margin: 0 -20px 20px -20px;
            padding: 10px 20px;
            overflow-x: auto;
            -ms-overflow-style: none;
            scrollbar-width: none;
            background: white;
            border-top: 1px solid #e9ecef;
            border-bottom: 1px solid #e9ecef;
        }

        .letter-nav button {
            width: 36px;
            height: 36px;
            min-width: 36px;
            border: 1px solid #e0e0e0;
            background: white;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            padding: 0;
            margin: 0;
            transition: all 0.2s;
            box-sizing: border-box;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            position: relative;
            overflow: hidden;
        }

        .letter-nav button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: #f1f1f1;
        }

        .letter-nav button.active {
            background: #8B4E49;
            color: white;
        }

        .filter-buttons {
            display: flex;
            max-width: 300px;
            width: 100%;
            background: #f1f3f5;
            border-radius: 8px;
            padding: 0;
            position: relative;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
            border: 1px solid #e9ecef;
            height: 40px;
            overflow: hidden;
            margin-right: 15px;
            flex-shrink: 0;
        }

        .filter-btn {
            position: relative;
            padding: 0;
            margin: 0;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #495057;
            z-index: 1;
            transition: color 0.2s ease;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            line-height: 1.2;
            height: 100%;
            flex: 1;
            min-width: 0;
        }

        .filter-btn:first-child {
            border-top-left-radius: 7px;
            border-bottom-left-radius: 7px;
        }

        .filter-btn:last-child {
            border-top-right-radius: 7px;
            border-bottom-right-radius: 7px;
        }

        .filter-btn.active {
            color: white;
            font-weight: 500;
        }

        .filter-buttons::after {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 33.33%;
            background: #8B4E49;
            border-radius: 6px;
            transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
            z-index: 0;
        }

        .filter-buttons[data-active="all"]::after {
            transform: translateX(0);
        }

        .filter-buttons[data-active="taken"]::after {
            transform: translateX(100%);
        }

        .filter-buttons[data-active="needed"]::after {
            transform: translateX(200%);
        }

        .letter-nav button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: #f1f1f1;
        }

        .search-box {
            flex: 1 1 auto;
            min-width: 200px;
            width: 100%;
            padding: 12px 20px 12px 45px;
            border: 2px solid #8B4E49;
            border-radius: 25px;
            font-size: 15px;
            font-weight: 500;
            transition: all 0.2s ease;
            box-sizing: border-box;
            outline: none;
            background: #fff8f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238B4E49' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 18px center;
            box-shadow: 0 3px 8px rgba(139, 78, 73, 0.15);
            color: #2d3436;
            margin: 0 10px;
        }

        .search-box:focus {
            border-color: #e74c3c;
            background-color: #ffffff;
            box-shadow: 0 0 0 4px rgba(139, 78, 73, 0.25);
            transform: translateY(-1px);
        }

        .search-box::placeholder {
            color: #a0a0a0;
            font-weight: normal;
        }

        .filter-select {
            flex: 1;
            min-width: 150px;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: white;
            font-size: 14px;
        }

        .fandoms-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            grid-auto-rows: 400px;
            /* This ensures all rows have the same height */
            gap: 15px;
            padding: 15px;
            overflow-y: auto;
            flex: 1;
            margin: 0;
            height: calc(100vh - 150px);
        }

        .fandom-section {
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            height: 100%;
            /* Make it take full height of grid cell */
            position: relative;
        }

        .character-browser .fandom-header,
        .character-browser .punbb .multipage .topic h2.fandom-header {
            background-color: #f8f9fa !important;
            padding: 12px 15px !important;
            font-size: 18px !important;
            font-weight: 600 !important;
            color: #2c3e50 !important;
            border-bottom: 1px solid #e9ecef !important;
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            position: sticky !important;
            top: 0 !important;
            z-index: 1 !important;
            flex-shrink: 0 !important;
            margin: 0;
        }

        .fandom-characters {
            padding: 0 15px 15px;
            flex: 1;
            overflow-y: auto;
            max-height: calc(100% - 50px);
            /* Account for header height */
            scrollbar-width: thin;
            scrollbar-color: #c1c1c1 #f1f1f1;
            display: flex;
            flex-direction: column;
        }

        .fandom-characters::-webkit-scrollbar {
            width: 6px;
        }

        .fandom-characters::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .fandom-characters::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        .character-row {
            display: block;
            padding: 8px 0;
            margin: 0;
            flex-shrink: 0;
        }

        .characters-list {
            display: block;
            width: 100%;
        }
       
        .needed-row {
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid #e0e0e0;
        }
       
        .character-row-header {
            font-size: 14px;
            font-weight: 600;
            color: #555;
            margin: 10px 0 5px 0;
            width: 100%;
        }

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

        .character-card {
            display: flex;
            flex-direction: row-reverse;
            padding: 8px 12px;
            margin: 4px 0;
            border-radius: 4px;
            transition: all 0.2s;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            position: relative;
        }

        .character-card:hover {
            background: #f1f3f5;
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .character-card a {
            color: #2d3436;
            text-decoration: none;
            padding: 0;
            transition: all 0.2s;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            font-size: 15px;
            font-weight: 500;
        }

        .taken-badge {
            background-color: rgba(139, 78, 73, 0.15);
            color: #8B4E49;
            padding: 2px 8px;
            border-radius: 8px;
            font-size: 11px;
            margin-left: 6px;
            vertical-align: middle;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .char-count {
            font-size: 14px;
            color: #666;
            margin-left: 8px;
            font-weight: normal;
        }

        .fandom-characters>div {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        }

        /* Moved to character-card rule */

        .character-name {
            margin: 0;
            color: #2c3e50;
            font-size: 0.9em;
        }

        /* Hide race and class, only showing names */
        .character-race,
        .character-class {
            display: none;
        }

        /* Quick nav removed for better space efficiency */

        .no-results {
            text-align: center;
            padding: 30px;
            color: #7f8c8d;
            font-style: italic;
            grid-column: 1 / -1;
        }

        .hidden {
            display: none;
        }

        @media (max-width: 768px) {
            .fandoms-container {
                grid-template-columns: 1fr;
                padding: 10px;
            }

            .letter-nav {
                margin-left: -15px;
                margin-right: -15px;
                padding: 5px 15px;
                gap: 3px;
            }

            .letter-nav button {
                width: 28px;
                height: 28px;
                min-width: 28px;
                font-size: 12px;
            }

            .controls {
                flex-direction: column;
            }

            .search-box,
            .filter-select {
                width: 100%;
                margin-bottom: 10px;
            }

            .fandom-characters {
                grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
                gap: 8px;
                padding: 8px;
            }
        }

        #letterNav {
            display: flex;
            overflow-x: auto;
            white-space: nowrap;
            padding: 8px 12px;
            background: #f5f5f5;
            border-bottom: 1px solid #e0e0e0;
            scrollbar-width: none;
            /* Hide scrollbar for Firefox */
            -ms-overflow-style: none;
            /* Hide scrollbar for IE/Edge */
        }

        #letterNav::-webkit-scrollbar {
            display: none;
            /* Hide scrollbar for Chrome/Safari */
        }

        #letterNav button {
            flex: 0 0 auto;
            margin: 0 2px;
        }
    </style>
    <div class="letter-nav" id="letterNav">
        <!-- Will be populated by JavaScript -->
    </div>
    <div class="controls">
        <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px; width: 100%;">
            <div class="filter-buttons">
                <button id="filterAll" class="filter-btn active">Все</button>
                <button id="filterTaken" class="filter-btn">Занятые</button>
                <button id="filterNeeded" class="filter-btn">Нужные</button>
            </div>
            <div style="flex: 1; min-width: 200px; position: relative;">
                <input type="text" id="searchInput" class="search-box" placeholder="Поиск по имени персонажа или фандому..."
                    style="width: 100%;">
            </div>
        </div>
    </div>

    <div id="characterList" class="fandoms-container"
        style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; min-height: 200px; position: relative;">
        <div id="loadingIndicator" style="display: flex; flex-direction: column; align-items: center; justify-content: center; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.9); z-index: 10; border-radius: 8px;">
            <div style="width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #8B4E49; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px;"></div>
            <div style="font-size: 16px; color: #2d3436; font-weight: 500;">Загрузка данных...</div>
            <div id="errorMessage" style="color: #e74c3c; margin-top: 10px; display: none; max-width: 80%; text-align: center;"></div>
        </div>
        <!-- Will be populated by JavaScript -->
    </div>
    <style>
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>

    <!-- Quick nav removed for better space efficiency -->
</div>
[/html]