л/* ========== КАСТОМНЫЕ ШРИФТЫ ========== */

/* Cyber Font — для мелких текстов (шапка, боковая панель, кнопки) */



/* ========== ПРИМЕНЕНИЕ ШРИФТОВ ========== */

/* Тело сайта — основной шрифт KogniGear */
body {
    font-family: 'KogniGear', 'Courier New', monospace;
}

/* Все заголовки — KogniGear */
h1, h2, h3, h4, .neon-title, .section-title, .modal-description h2, .modal-description h3 {
    font-family: 'KogniGear', 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Шапка навигации */
.top-nav, .top-nav a, .logo {
    font-family: 'KogniGear', 'Courier New', monospace;
}

/* Боковая панель */
.sidebar, .sidebar a {
    font-family: 'KogniGear', 'Courier New', monospace;
}

/* Кнопки */
.cyber-btn, .button, .send-btn, .filter-btn, .reset-filter-btn {
    font-family: 'KogniGear', 'Courier New', monospace;
}

/* Мелкие тексты */
.help-text, .form-hint, .stat-badge, .ability-badge, .role-faction, .game-stats, .pagination, .footer, .footer-legal {
    font-family: 'KogniGear', 'Courier New', monospace;
}

/* ========== ОСНОВНЫЕ СТИЛИ САЙТА ========== */

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

body {
    background: radial-gradient(circle at 20% 30%, #0a0f0a, #030603);
    color: #00ff88;
    min-height: 100vh;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, rgba(0,255,136,0.08) 0px, rgba(0,255,136,0.08) 2px, transparent 2px, transparent 8px),
        repeating-linear-gradient(90deg, rgba(0,255,136,0.08) 0px, rgba(0,255,136,0.08) 2px, transparent 2px, transparent 8px);
    pointer-events: none;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0,0); }
    100% { transform: translate(20px,20px); }
}

/* ========== ВЕРХНЯЯ НАВИГАЦИЯ ========== */
.top-nav {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #00ff88;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #EE82EE;
    text-decoration: none;
    transition: 0.3s;
}

.logo:hover {
    text-shadow: 0 0 10px #EE82EE;
}

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

.nav-links a {
    color: #EE82EE;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: bold;
    transition: 0.3s;
}

.nav-links a:hover {
    background: rgba(238,130,238,0.2);
    text-shadow: 0 0 5px #EE82EE;
}

.burger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: #00ff88;
    background: none;
    border: none;
}

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 250px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    align-self: flex-start;
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #00ff88;
}

.sidebar h3 {
    color: #00ff88;
    margin-bottom: 15px;
    border-bottom: 1px solid #00ff88;
    padding-bottom: 8px;
}

.sidebar a {
    display: block;
    color: #00ff88;
    text-decoration: none;
    padding: 10px;
    margin: 5px 0;
    border-radius: 12px;
    transition: 0.3s;
}

.sidebar a:hover {
    background: rgba(0,255,136,0.2);
    transform: translateX(5px);
}

.content {
    flex: 1;
}

/* ========== ФУТЕР ========== */
.footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid rgba(0,255,136,0.2);
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copyright {
    color: #666;
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #00ff88;
    text-decoration: none;
    font-size: 12px;
    transition: 0.3s;
}

.footer-links a:hover {
    text-shadow: 0 0 5px #00ff88;
    text-decoration: underline;
}

.footer-legal {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,255,136,0.1);
    font-size: 10px;
    color: #555;
    text-align: center;
}

.footer-legal p {
    margin: 5px 0;
}

.site-version {
    font-family: monospace;
    letter-spacing: 1px;
    color: #00ff88;
    opacity: 0.6;
    font-size: 9px;
}

/* ========== УВЕДОМЛЕНИЯ ========== */
.notification-icon {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    transition: 0.3s;
}

.notification-icon:hover {
    text-shadow: 0 0 10px #EE82EE;
}

#notificationBadge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 5px #ff4444;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#notificationBadge.pulse {
    animation: pulse 0.5s ease-in-out;
}

.messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

.toast-message {
    background: rgba(0,0,0,0.9);
    border-left: 4px solid #00ff88;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 10px;
    color: #00ff88;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== АДАПТИВ ========== */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: row;
        justify-content: space-between;
    }

    .burger {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: center;
        background: rgba(0,0,0,0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        padding: 20px;
        margin-top: 10px;
    }

    .nav-links.open {
        display: flex;
    }

    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 2;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        font-size: 8px;
    }

    .messages-container {
        top: 120px;
        right: 10px;
        left: 10px;
    }

    .toast-message {
        font-size: 12px;
    }
}

/* ========== ВТОРОСТЕПЕННЫЙ ТЕКСТ — KogniGear ========== */
.top-nav,
.top-nav a,
.nav-links a,
.burger,
.sidebar,
.sidebar a,
.sidebar h3,
.mobile-bottom-bar,
.mobile-bottom-bar a,
.footer,
.footer a,
.footer .footer-copyright,
.footer-links a {
    font-family: 'KogniGear', 'Courier New', monospace !important;
}
/* Стилизация скроллбара для сайдбара */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #EE82EE;
}

/* Убираем скролл если контент не превышает высоту */
.sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00ff88 rgba(0, 0, 0, 0.5);
}

/* ===== ВСЕЛЕННАЯ: КАРТОЧКИ РОЛЕЙ ФРАКЦИИ ===== */
.faction-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.faction-role-card {
    display: block;
    text-decoration: none;
    background: color-mix(in srgb, var(--faction-color, #00ffcc) 6%, #030505);
    padding: 1rem 0.8rem;
    text-align: center;
    position: relative;
    transition: background 0.2s, box-shadow 0.2s;
    border-radius: 6px;
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--faction-color, #00ffcc) 8%, transparent);
}
.faction-role-card::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px;
    width: 14px; height: 14px;
    border-top: 2px solid var(--faction-color, #00ffcc);
    border-left: 2px solid var(--faction-color, #00ffcc);
}
.faction-role-card::after {
    content: '';
    position: absolute;
    bottom: 6px; right: 6px;
    width: 14px; height: 14px;
    border-bottom: 2px solid var(--faction-color, #00ffcc);
    border-right: 2px solid var(--faction-color, #00ffcc);
}
.faction-role-card:hover { background: color-mix(in srgb, var(--faction-color, #00ffcc) 12%, #030505); box-shadow: inset 0 0 24px color-mix(in srgb, var(--faction-color, #00ffcc) 14%, transparent); }
.faction-role-card__img {
    width: 90px; height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--faction-color, #00ffcc);
    margin: 0 auto 0.6rem;
    display: block;
    box-shadow: 0 0 10px var(--faction-color, #00ffcc);
}
.faction-role-card__name {
    font-size: 0.88rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.3rem;
    font-family: monospace;
}
.faction-role-card__quote {
    font-size: 0.72rem;
    color: #888;
    font-style: italic;
    line-height: 1.5;
}

/* ===== ВСЕЛЕННАЯ: МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .universe-page,
    .faction-page {
        padding: 1rem 0.8rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    .universe-hero__title { font-size: 1.8rem; letter-spacing: 0.15em; }
    .factions-grid { grid-template-columns: 1fr; }
    .faction-hero__name { font-size: 1.4rem; }
    .faction-roles { grid-template-columns: repeat(2, 1fr); }
    .herald-block { padding: 1rem; }
}

/* ===== FIX: мобильное переполнение ===== */
@media (max-width: 768px) {
    .faction-hero__name,
    .faction-hero__tagline,
    .universe-hero__title {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    .faction-hero {
        overflow: hidden;
        max-width: 100vw;
    }
}

/* ===== FIX: основной контейнер на мобиле ===== */
@media (max-width: 768px) {
    .main-container {
        padding: 15px 10px;
        gap: 15px;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .sidebar {
        width: 100%;
        min-width: 0;
    }
}

/* ===== FIX: глобальный overflow ===== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}



/* === ФИКС ГОРИЗОНТАЛЬНОГО СКРОЛЛА НА МОБИЛКЕ === */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
* {
    box-sizing: border-box;
}

/* ===== ЭФФЕКТЫ РАНГОВ ===== */
.rank-avatar { transition: all 0.3s ease; position: relative; }
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; transition: inherit; }

.rank-guardian { filter: drop-shadow(0 0 4px rgba(255,180,0,0.5)); transition: filter 0.3s ease; }
.rank-guardian:hover { filter: drop-shadow(0 0 12px rgba(255,180,0,0.8)); }

.rank-creator { filter: drop-shadow(0 0 4px #CD7F32); animation: subtlePulse 4s infinite; }
@keyframes subtlePulse { 0%{filter:drop-shadow(0 0 2px #CD7F32)} 50%{filter:drop-shadow(0 0 8px #CD7F32)} 100%{filter:drop-shadow(0 0 2px #CD7F32)} }

.rank-architect { filter: drop-shadow(0 0 3px #C0C0C0); border: 1px solid rgba(192,192,192,0.6); transition: all 0.2s linear; }
.rank-architect:hover { filter: drop-shadow(0 0 12px #E0E0E0); border-color: #E0E0E0; }

.rank-conductor { filter: drop-shadow(0 0 6px #FFD700); animation: gentleGlow 3s infinite alternate; }
@keyframes gentleGlow { from{filter:drop-shadow(0 0 4px #FFD700);opacity:0.95} to{filter:drop-shadow(0 0 14px #FFC107);opacity:1} }

.rank-visionary { filter: drop-shadow(0 0 8px #9B59B6); animation: mysticBreathing 4s infinite; border: 1px solid rgba(155,89,182,0.6); }
@keyframes mysticBreathing { 0%{filter:drop-shadow(0 0 4px #9B59B6);border-color:rgba(155,89,182,0.4)} 50%{filter:drop-shadow(0 0 18px #BB6BD9);border-color:rgba(155,89,182,0.9)} 100%{filter:drop-shadow(0 0 4px #9B59B6);border-color:rgba(155,89,182,0.4)} }

.rank-ghost { filter: drop-shadow(0 0 6px #2C3E50); animation: ghostFog 6s infinite; position: relative; }
@keyframes ghostFog { 0%{filter:drop-shadow(0 0 2px #2C3E50);opacity:0.95} 50%{filter:drop-shadow(0 0 14px #5D6D7E);opacity:1} 100%{filter:drop-shadow(0 0 2px #2C3E50);opacity:0.95} }
.rank-ghost::before { content:''; position:absolute; top:0; left:0; width:100%; height:100%; background:radial-gradient(circle,rgba(44,62,80,0.2),transparent); pointer-events:none; animation:fogMove 8s infinite linear; }
@keyframes fogMove { 0%{opacity:0.3} 50%{opacity:0.6} 100%{opacity:0.3} }

.ghost-name { background: linear-gradient(135deg,#2C3E50,#5D6D7E,#2C3E50); background-size:200% auto; -webkit-background-clip:text; background-clip:text; color:transparent; animation:gradientShift 4s linear infinite; font-weight:bold; }
@keyframes gradientShift { 0%{background-position:0% center} 100%{background-position:200% center} }
