* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0F0F23;
    --text-heading: #9099EF;
    --text-primary: #A0AEC0;
    --accent: #BB86FC;
    --accent-hover: #9D67E3;
    --border: #2D3748;
    --bg-card: #16213E;
    --bg-secondary: #1A1A2E;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100%;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Шапка */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text-heading) !important;
    font-family: 'Nunito', sans-serif;
    text-decoration: none;
    white-space: nowrap;
}

.logo:hover {
    color: var(--text-heading) !important;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Стили для всех кнопок/ссылок в навигации */
.nav-link,
.mobile-search-btn {
    color: var(--text-primary) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
}

.nav-link:hover,
.nav-link.active,
.mobile-search-btn:hover {
    color: var(--accent) !important;
    background: rgba(187, 134, 252, 0.1);
}

/* Мобильная кнопка поиска */
.mobile-search-btn {
    display: none;
}

/* Поисковая строка */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

#searchInput {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 25px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    min-width: 200px;
    transition: all 0.3s ease;
    flex-grow: 1;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.2);
}

#searchInput::placeholder {
    color: var(--text-primary);
    opacity: 0.7;
}

/* Кнопка закрытия поиска */
.close-search-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
    transition: color 0.3s ease;
    font-weight: 300;
    margin-left: 10px;
    flex-shrink: 0;
}

.close-search-btn:hover {
    color: var(--accent);
}

/* Состояние активного поиска на мобильных */
.search-active .faq-link,
.search-active .mobile-search-btn {
    display: none !important;
}

.search-active .search-container {
    width: 100%;
    max-width: 100%;
}

.search-active .close-search-btn {
    display: block;
}

/* ФИЛЬТРЫ */
.filters-section {
    padding: 15px 0;
    background: var(--bg-primary);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-heading);
    text-align: center;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
}

.filters-wrapper {
    width: 100%;
    position: relative;
}

.filters-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.filters-scroll-container::-webkit-scrollbar {
    display: none;
}

.filters-scroll-container.grabbing {
    cursor: grabbing;
    user-select: none;
}

.filters-grid {
    display: flex;
    gap: 12px;
    width: max-content;
}

.filter-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-tag.active {
    background: var(--text-heading);
    color: var(--bg-primary);
    border-color: var(--text-heading);
}

.filter-tag.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Карточки шипкидов */
.shipkids-section {
    padding: 10px 0;
    min-height: 60vh;
}

.shipkids-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    justify-content: center;
}

.shipkid-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 140px;
}

.shipkid-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(187, 134, 252, 0.15);
}

.shipkid-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    flex-shrink: 0;
}

.shipkid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shipkid-info {
    padding: 4px 4px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 30px;
}

.shipkid-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
    margin: 0;
}

/* Стиль для раздела "Другие версии" */
.optional-section .reference-image {
    border: none !important;
    text-align: center;
}

.optional-section .reference-image img {
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 100%;
}

.optional-section .reference-image p {
    margin-top: 12px;
}

/* Футер */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-primary);
    margin-top: 40px;
    font-size: 0.9rem;
}

/* АДАПТИВНОСТЬ */

/* Мобильные устройства */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: nowrap; /* Всегда в одной строке! */
        gap: 10px;
    }
    
    .logo {
        font-size: 1.6rem;
        flex-shrink: 0;
    }
    
    .nav {
        gap: 10px;
        justify-content: flex-end;
        flex-grow: 1;
    }

    /* На мобильных: скрываем поисковую строку, показываем кнопку */
    .mobile-search-btn {
        display: block;
    }
    
    .search-container {
        display: none;
        position: absolute;
        left: 5px;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-secondary);
        padding: 8px;
        border-radius: 25px;
        border: 1px solid var(--border);
        z-index: 1001;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .search-active .search-container {
        display: flex;
    }
    
    #searchInput {
        border: none;
        background: transparent;
        padding: 8px 12px;
        min-width: 0;
        flex-grow: 1;
    }
    
    .filter-tag {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-height: 42px;
    }
    
    .filters-grid {
        gap: 10px;
    }
    
    .shipkids-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .shipkid-card {
        height: 160px;
    }
    
    .shipkid-image {
        height: 120px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 480px) {
    .header .container {
        padding: 0 12px;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .nav-link,
    .mobile-search-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .shipkids-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .shipkid-card {
        height: 150px;
    }
    
    .shipkid-image {
        height: 120px;
    }
    
    .shipkid-name {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .filter-tag {
        padding: 8px 16px;
        font-size: 0.85rem;
        min-height: 40px;
    }
}

/* Планшеты */
@media (min-width: 769px) and (max-width: 1024px) {
    .shipkids-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Десктоп */
@media (min-width: 769px) {
    .mobile-search-btn {
        display: none !important;
    }
    
    .close-search-btn {
        display: none !important;
    }
    
    .search-container {
        display: flex !important;
        position: static;
        background: transparent;
        padding: 0;
        width: auto;
    }
    
    #searchInput {
        min-width: 200px;
    }
}

@media (min-width: 1025px) {
    .shipkids-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
    
    .shipkid-card {
        height: 200px;
    }
    
    .shipkid-image {
        height: 160px;
    }
}

/* Большие экраны */
@media (min-width: 1200px) {
    .shipkids-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Стили для футера */
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-text {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-email {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: var(--accent);
}

.support-btn {
    background: var(--text-heading);
    color: var(--bg-primary) !important;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid var(--text-heading);
}

.support-btn:hover {
    background: transparent;
    color: var(--text-heading);
}

/* Адаптивность футера */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* Стили для страницы FAQ */
.faq-section {
    padding: 15px 0;
    min-height: calc(100vh - 200px);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--accent);
}

.faq-question {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-heading);
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: rgba(187, 134, 252, 0.05);
}

.faq-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--text-heading);
    margin-left: 15px;
    flex-shrink: 0;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-primary);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    padding: 0 20px 20px 20px;
    max-height: 500px;
}

.faq-answer p {
    margin: 0;
}

/* Адаптивность для FAQ */
@media (max-width: 768px) {
    .faq-question {
        padding: 15px;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 15px;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 15px 15px 15px;
    }
    
    .faq-toggle {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .faq-question {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .faq-answer {
        padding: 0 12px;
        font-size: 0.9rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 12px 12px 12px;
    }
}

/* Убирает голубое выделение при клике */
* {
    -webkit-tap-highlight-color: transparent;
}










/* ===== СТРАНИЦА ПЕРСОНАЖА ===== */

/* Заголовок персонажа */
.character-title {
    font-size: 2rem;
    color: var(--text-heading);
    padding: 20px 0px 20px 0px;
    text-align: center;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
}

/* Основная информация с фото и прямоугольником */
.character-main-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .character-main-info {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 30px
    }
}

/* Контейнер для фото */
.character-image-container {
    width: 100%;
}

.character-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    aspect-ratio: 4/4;
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .character-main-info {
        /* 30% фото, 70% инфа */
        grid-template-columns: 3fr 7fr;
    }
}

/* Прямоугольник с ключевой информацией */
.character-key-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 0px 10px 0px;
    overflow: hidden;
}

/* Заголовок с кнопкой сворачивания */
.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(144, 153, 239, 0.1);
    border-bottom: 1px solid var(--border);
}

.info-header h2 {
    font-size: 1.4rem;
    color: var(--text-heading);
    margin: 0;
    font-weight: 600;
}

/* Кнопка сворачивания */
.collapse-toggle {
    background: transparent;
    border: none;
    color: var(--text-heading);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.collapse-toggle:hover {
    background: rgba(187, 134, 252, 0.1);
    color: var(--accent);
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Контент (по умолчанию открыт) */
.info-content {
    padding: 20px;
}

/* Сетка для информации в строчку */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.info-item {
    display: flex;
    justify-content: space-between; /* ← Метка слева, значение справа */
    align-items: center;
    gap: 15px;
    width: 100%;
}

.info-label {
    flex-shrink: 0; /* ← Не сжимается */
    text-align: left;
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
}

.info-value {
    flex-grow: 1; /* ← Занимает всё доступное пространство */
    text-align: right; /* ← Текст по правому краю */
    color: var(--text-primary);
    word-break: break-word;
    min-width: 0; /* ← Разрешает перенос */
}

/* Разделы персонажа */
.character-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.character-section-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.character-section-item:hover {
    border-color: var(--accent);
}

/* Заголовок раздела */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.section-header:hover {
    background: rgba(187, 134, 252, 0.05);
}

.section-header h2 {
    font-size: 1.3rem;
    color: var(--text-heading);
    margin: 0;
    font-weight: 600;
}

/* Содержимое раздела */
.section-content {
    padding: 5px 20px 20px 20px;
    max-height: none; /* По умолчанию открыты */
    overflow: hidden;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Контент внутри разделов */
.section-content p {
    margin: 0 0 10px 0;
}

.section-content p:last-child {
    margin-bottom: 0;
}

.section-content ul {
    padding-left: 20px;
    margin: 0 0 10px 0;
}

.section-content li {
    margin-bottom: 8px;
}

.section-content li:last-child {
    margin-bottom: 0;
}

/* Стили для изображения референса */
.reference-section .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reference-image {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 0 auto;
}

.reference-image img {
    width: 100%;
    height: auto;
    display: block;
}

.reference-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    opacity: 0.8;
    font-style: italic;
}

/* Список ссылок */
.links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-list li {
    margin-bottom: 10px;
}

.links-list a {
    color: var(--text-heading);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
}

.links-list a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.links-list a::before {
    content: "↗";
    font-size: 0.9rem;
}

/* Опциональные разделы (скрываем, если пустые) */
.optional-section:empty {
    display: none;
}

/* Адаптивность */
@media (max-width: 767px) {
    .character-title {
        font-size: 2rem;
        padding: 10px;
    }

    .character-main-info {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .character-image-container {
        border-radius: 12px 12px 0 0;
        overflow: hidden;
        border-bottom: none;
    }
    
    .character-key-info {
        border-radius: 12px 12px 12px 12px;
        margin-top: -1px; /* Убираем двойную границу */
    }

    .character-image {
        border-radius: 12px 12px 0 0;
        border-bottom: none;
    }
    
    .character-key-info {
        padding-top: 0; /* Убираем верхний padding прямоугольника */
    }
    
    .info-header,
    .section-header {
        padding: 15px;
    }
    
    .info-header h2,
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .info-content,
    .section-content {
        padding: 0 15px;
    }
    
    .character-section-item.collapsed .section-content {
        padding: 0 15px;
    }
    
    .section-content {
        padding: 0 15px 15px 15px;
    }
    
    .reference-image {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .character-title {
        font-size: 1.8rem;
    }

    .character-main-info {
        gap: 0;
    }
    
    .info-header,
    .section-header {
        padding: 12px;
    }
    
    .info-header h2,
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .info-content,
    .section-content {
        padding: 0 12px;
        font-size: 0.95rem;
    }
    
    .character-section-item.collapsed .section-content {
        padding: 0 12px;
    }
    
    .section-content {
        padding: 0 12px 12px 12px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .character-main-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .character-image-container {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 20px;
        padding-top: 30px;
    }
    
    .character-image {
        width: 250px;
        height: 250px;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
    
    .character-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .character-key-info {
        width: 100%;
        margin-top: 10px;
    }
}

@media (min-width: 768px) {
    .character-main-info {
        width: 100%;
        display: block; /* или flex, но не grid */
    }
    
    .character-key-info {
        display: flex !important; /* ← FLEX ВМЕСТО GRID */
        gap: 10px !important;
        align-items: flex-start !important;
        width: 100%;
    }
    
    .character-image-container {
        flex-shrink: 0; /* ← НЕ ДАЁТ СЖИМАТЬСЯ */
        width: 300px;
        padding: 10px 10px 10px 20px;
    }
    
    .info-content {
        flex-grow: 1; /* ← ЗАНИМАЕТ ВСЮ ОСТАВШУЮСЯ ШИРИНУ */
        min-width: 0; 
        width: auto;
    }
    
    .character-image {
        width: 100% !important;
        max-width: 300px !important;
        aspect-ratio: 1/1 !important;
        position: sticky !important;
        top: 100px !important;
    }

    .info-item {
        margin-bottom: 12px !important;
    }

    .info-label {
        font-size: 1.2rem !important;
        min-width: 180px !important;
        padding-right: 30px !important;
    }
    
    .info-value {
        font-size: 1.2rem !important;
    }
}

/* Основной стиль ссылки */
a {
    color: #9099EF; /* Основной цвет (как у text-heading) */
    text-decoration: none; /* Убирает подчеркивание */
    transition: color 0.3s ease; /* Плавное изменение цвета */
}

/* При наведении курсора */
a:hover {
    color: #BB86FC; /* Цвет при наведении (как у accent) */
}

/* Посещенная ссылка */
a:visited {
    color: #9D67E3; /* Цвет посещенной ссылки (немного темнее) */
}








