:root {
    --bg: #f0f0f0;
    --surface: #ffffff;
    --accent: #4a5c6d;
    --accent-hover: #354353;
    --accent-light: #e0e5eb;
    --text-main: #2b2f42;
    --text-muted: #6b7280;
    --border: #d1d5db;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

    /* Цвета для кнопок действий в светлой теме */
    --edit-bg: #e0e5eb;
    --delete-bg: #fee2e2;
    --delete-text: #b91c1c;
}

[data-theme="dark"] {
    --bg: #1e212e;
    --surface: #2b2f42;
    --accent: #e5cc98;
    --accent-hover: #d2a969;
    --accent-light: #3a415c;
    --text-main: #ece5d8;
    --text-muted: #8c90a8;
    --border: #3a415c;
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);

    /* Цвета для кнопок действий в темной теме */
    --edit-bg: #3a415c;
    --delete-bg: #3d1f1f;
    --delete-text: #ff8080;
}

/* Изменим немного градиент заглушки для темной темы */
[data-theme="dark"] .post-no-img-placeholder {
    background: linear-gradient(135deg, var(--accent) 0%, var(--surface) 100%);
}

/* Плавный переход при смене темы */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card, .header, .footer, .btn, input, textarea {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Отступ между луной и гамбургером */
    z-index: 1100; /* Чтобы кнопки были над выезжающим меню */
}

/* Стиль кнопки переключателя */
.theme-toggle {
    background: var(--accent-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.3s;
    color: var(--accent);
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px; /* Боковые поля сайта */
}

/* --- НАВИГАЦИЯ --- */
/* --- ЛОГОТИП (Terminal Style) --- */
.logo {
    font-family: 'Fira Code', monospace; /* Моноширинный шрифт для IT-стиля */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo .cursor {
    color: var(--accent);
    margin-right: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* --- ШАПКА АДАПТИВНАЯ --- */
.header {
    background: var(--surface);
    padding: 0.8rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

/* --- ВЫПАДАЮЩЕЕ МЕНЮ --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: 0.3s;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}

.dropdown-btn:hover {
    background: var(--bg);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--surface);
    min-width: 180px;
    box-shadow: var(--shadow);
    border-radius: 12px;
    border: 1px solid var(--border);
    z-index: 1000;
    overflow: hidden;
    margin-top: 5px;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    transition: 0.2s;
    font-size: 0.95rem;
    margin: 4px;
    border-radius: 8px;
}

.dropdown-content a:hover {
    background-color: var(--bg);
    color: var(--accent);
}

.dropdown-content.show {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: 0.3s;
}

/* Кнопка бургера (скрыта на ПК) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1100;
}

.mobile-menu-btn .bar {
    width: 25px;
    height: 3px;
    background-color: var(--accent);
    border-radius: 10px;
    transition: 0.3s;
}

/* --- МОБИЛЬНЫЕ СТИЛИ (Media Query) --- */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Скрыто за экраном */
        width: 80%;
        height: 100vh;
        background: var(--surface);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: 0.4s ease-in-out;
        padding: 100px 40px;
        z-index: 1050;
    }

    .nav-menu.active {
        right: 0; /* Выезжает при активации */
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }

    .nav-links li { width: 100%; }

    .nav-links a {
        font-size: 1.2rem;
        display: block;
        width: 100%;
    }

    .btn { width: 100%; }

    /* Анимация бургера в крестик */
    .mobile-menu-btn.is-active .bar:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .mobile-menu-btn.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
    
    /* Дополнительные правки для трекера на мобилках */
    .dashboard-grid, .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .card {
        padding: 20px !important;
        border-radius: 16px !important;
    }
    
    .logo {
        font-size: 1.2rem;
    }

    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: var(--bg);
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

/* --- УНИФИЦИРОВАННЫЕ КНОПКИ --- */
.btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 0.95rem;
    border: none;
}

/* Основная кнопка (теперь и для входа, и для регистрации) */
.btn-solid {
    background-color: var(--accent-light); /* Переменная */
    color: var(--accent) !important;
}

.btn-solid:hover {
    background: var(--accent);
    color: var(--surface) !important;
    transform: translateY(-2px);

}

/* Вспомогательная кнопка (например, для выхода) */
.btn-outline {
    background-color: var(--accent-light); /* Переменная */
    color: var(--accent) !important;
}

.btn-outline:hover {
    background-color: var(--accent);
    color: var(--surface) !important; /* На темном фоне текст станет цветом карточки */
}

/* --- ГЛАВНЫЙ КОНТЕНТ (Home Page) --- */
.hero { padding: 20px 0 0px; text-align: center; }
.hero h1 { font-size: 3.5rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 20px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 80px; }
.feature-card {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: 0.3s;
}
.feature-card:hover { transform: translateY(-10px); }
.feature-card h3 { margin-bottom: 15px; color: var(--accent); font-size: 1.5rem; }

/* --- АВТОРИЗАЦИЯ И ПРОФИЛЬ --- */
.card {
    background-color: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 60px;
    padding: 40px; /* Отступ на ПК */
}
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 30px; }
.tab-btn { flex: 1; padding: 15px; border: none; background: none; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: 0.3s; }
.tab-btn.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
input, textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--surface); /* Теперь меняется */
    color: var(--text-main);           /* Теперь меняется */
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}
input:focus, textarea:focus {
    border-color: var(--accent);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px var(--accent-light);
}

/* --- КНОПКИ ДЕЙСТВИЙ (Микро-кнопки) --- */
.btn-action {
    height: 34px;             /* Фиксированная высота для обоих типов тегов */
    padding: 0 15px;          /* Отступы только по бокам */
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;     /* Выравнивание содержимого по центру */
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;   /* Чтобы padding не увеличивал размер */
}

/* Кнопка Редактировать (спокойная) */
.btn-edit {
    background-color: var(--edit-bg); /* Переменная */
    color: var(--accent);
}

.btn-edit:hover {
    background: var(--accent);
    color: white !important;
}

/* Кнопка Удалить (предупреждающая) */
.btn-delete {
    background-color: var(--delete-bg); /* Переменная */
    color: var(--delete-text);           /* Переменная */
}

.btn-delete:hover {
    background: #b91c1c;
    color: white !important;
}

/* Группа кнопок для выравнивания */
.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Контейнер для аватара */
.avatar-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 50%;
    overflow: hidden; /* Чтобы картинка не выходила за границы круга */
    border: 4px solid var(--surface);
    box-shadow: var(--shadow);
    background-color: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Сама картинка внутри круга */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Картинка заполнит круг без искажений */
}

/* Буква если фото нет */
.avatar-letter {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
}

/* Стили для поля выбора файла */
.file-input {
    padding: 10px !important;
    background: transparent !important;
    border: 1px dashed var(--accent) !important;
    font-size: 0.8rem !important;
    cursor: pointer;
}

/* --- Сетка постов --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 80px;
}

.post-card {
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; /* Чтобы все в ряду были одной высоты */
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.post-img-wrapper, .post-no-img-placeholder {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Плавный переход от картинки/заглушки к контенту */
.post-img-wrapper::after, .post-no-img-placeholder::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Градиент от прозрачного к цвету фона карточки */
    background: linear-gradient(to top, var(--surface) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card:hover .post-card-img {
    transform: scale(1.05);
}

.post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.post-content h3 {
    margin-bottom: 12px;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--accent);
    /* Ограничение заголовка в 2 строки */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.post-content .btn {
    margin-top: auto; /* Кнопка всегда внизу */
    width: 100%;
    text-align: center;
}

.post-content .btn {
    margin-top: auto;
}

/* --- Заглушка для постов без картинки --- */
.post-no-img-placeholder {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.placeholder-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    padding: 20px;
    opacity: 0.3;
    z-index: 0;
}

/* Декоративный элемент на фоне для стиля */
.post-no-img-placeholder::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}


/* --- Стили пагинации --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
}

.page-link {
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: 0.3s;
}

.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--accent);
    color: white !important;
    border-color: var(--accent);
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.admin-badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    background: var(--surface);
    padding: 15px 25px;
    border-radius: 16px;
    display: grid;
    /* На ПК: 1-я колонка широкая (инфо), 2-я по центру (роль), 3-я справа (кнопки) */
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Выравнивание внутри колонок на ПК */
.user-item > div:nth-child(1) { justify-self: start; } /* Инфо влево */
.user-item > div:nth-child(2) { justify-self: center; } /* Роль в центр */
.user-item > div:nth-child(3) { justify-self: end; }   /* Кнопки вправо */

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    width: fit-content;
}

@media (max-width: 768px) {
    .user-item {
        display: flex;           /* На мобилках сетка не нужна, используем Flex */
        flex-direction: column;  /* Всё в столбик */
        align-items: center;     /* Центрируем всё */
        text-align: center;
        padding: 30px 15px;
        gap: 20px;
    }

    /* Сбрасываем выравнивание колонок для мобилок */
    .user-item > div {
        justify-self: center !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .user-info {
        flex-direction: column; /* На мобилках можно аватар над именем для экономии места */
        margin: 0 auto;
    }

    .user-name {
        font-size: 1.1rem;
    }
}

.user-link {
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    transition: 0.2s ease;
}

.user-link:hover {
    color: var(--accent-hover);
    text-decoration: underline; /* Легкое подчеркивание при наведении */
}

/* Для использования в тексте, где цвет должен быть нейтральным */
.user-link-muted {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: 0.2s;
}

.user-link-muted:hover {
    color: var(--accent);
}

/* Ссылка на профиль */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.user-avatar-sm {
    width: 35px;
    height: 35px;
    background: var(--accent-light);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--accent);
    border: 2px solid var(--border);
}

[data-theme="dark"] .user-avatar-sm {
    background: var(--surface);
    color: var(--accent);
}

.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 700; font-size: 0.95rem; }
.user-login { font-size: 0.8rem; color: var(--text-muted); }

/* Кнопки переключения ролей */
.user-actions { display: flex; gap: 5px; }
.role-btn {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    text-decoration: none;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: 0.2s;
}
.role-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Мобильная версия списка */
@media (max-width: 768px) {
    .user-list-header { display: none; }
    .user-item {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    .user-info { flex-direction: column; }
    .user-actions { justify-content: center; }
    .user-role { order: -1; margin-bottom: 5px; }
}

/* Теги ролей */
.role-tag.admin { color: #b91c1c; }
.role-tag.moderator { color: #0369a1; }

.post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Ровно 3 колонки */
    gap: 15px;
    padding: 0 40px 30px 40px;
}

.gallery-item {
    aspect-ratio: 1 / 1; /* Квадратные ячейки */
    overflow: hidden;
    border-radius: 15px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
    filter: brightness(0.9);
}

/* --- МОДАЛЬНОЕ ОКНО (LIGHTBOX) --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Темный фон */
    backdrop-filter: blur(8px); /* Размытие заднего плана */
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
}

.modal-img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    cursor: default;
    animation: zoomIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Адаптивность сетки: на телефонах 2 в ряд или 1 */
@media (max-width: 600px) {
    .post-gallery {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px 20px 20px;
    }
}

.badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* Золотой (Super Admin ID 1) */
.badge-super {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Красный (Admin) */
.badge-admin {
    background: #fee2e2;
    color: #b91c1c;
}

/* Синий (Moderator) */
.badge-mod {
    background: #e0f2fe;
    color: #0369a1;
}

/* Зеленый (User) */
.badge-user {
    background: var(--accent-light);
    color: var(--accent);
}

/* Темная тема для бейджей */
[data-theme="dark"] .badge-admin { background: #3d1f1f; color: #ff8080; }
[data-theme="dark"] .badge-mod { background: #1e293b; color: #7dd3fc; }
[data-theme="dark"] .badge-user { background: #1b3328; color: #52b788; }
[data-theme="dark"] .badge-super { background: #2d2412; color: #fbbf24; border-color: #78350f; }


/* --- ТРЕКЕР СТАТИСТИКИ --- */
/* Цвета стихий */
.element-pyro { color: #ef7938; }
.element-hydro { color: #4cc2f1; }
.element-anemo { color: #74c2a8; }
.element-electro { color: #af8ec1; }
.element-dendro { color: #a5c83b; }
.element-cryo { color: #9fd6e3; }
.element-geo { color: #fab632; }

.bg-pyro { background-color: rgba(239, 121, 56, 0.15); border: 1px solid #ef7938; }
.bg-hydro { background-color: rgba(76, 194, 241, 0.15); border: 1px solid #4cc2f1; }
.bg-anemo { background-color: rgba(116, 194, 168, 0.15); border: 1px solid #74c2a8; }
.bg-electro { background-color: rgba(175, 142, 193, 0.15); border: 1px solid #af8ec1; }
.bg-dendro { background-color: rgba(165, 200, 59, 0.15); border: 1px solid #a5c83b; }
.bg-cryo { background-color: rgba(159, 214, 227, 0.15); border: 1px solid #9fd6e3; }
.bg-geo { background-color: rgba(250, 182, 50, 0.15); border: 1px solid #fab632; }

/* Редкость */
.rarity-5 { background: linear-gradient(135deg, #d29043 0%, #ffc977 100%); color: #fff; }
.rarity-4 { background: linear-gradient(135deg, #8161ba 0%, #b485ff 100%); color: #fff; }

/* Сетка трекера */
.tracker-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tracker-nav .btn {
    white-space: nowrap;
}

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

.dashboard-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.dashboard-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--accent);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.char-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    border: 2px solid transparent;
}

.char-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.char-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg);
}

.char-info {
    padding: 10px;
    text-align: center;
}

.char-name {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-level {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.char-card.owned {
    opacity: 1;
}

.char-card.unowned {
    opacity: 0.5;
    filter: grayscale(80%);
}

.char-card.unowned:hover {
    opacity: 0.8;
    filter: grayscale(40%);
}

.char-element-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Прогресс-бары */
.progress-container {
    background: var(--bg);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.resin-tracker {
    text-align: center;
    margin: 20px 0;
}

.resin-count {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
}

/* --- ФУТЕР --- */
.footer { background: var(--surface); padding: 3rem 0; text-align: center; margin-top: auto; border-top: 1px solid var(--border); color: var(--text-muted); }

/* Форма импорта */
.import-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .import-form {
        flex-direction: column;
    }
    
    .import-form input {
        width: 100%;
    }
    
    #import-btn {
        width: 100% !important;
    }
}