/* --- БАЗОВЫЕ НАСТРОЙКИ --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    background: #070716; color: white; 
    overflow-x: hidden; width: 100%;
}

/* Фон со звездами */
body::before {
    content: ""; position: fixed; width: 200%; height: 200%;
    background: url("https://www.transparenttextures.com/patterns/stardust.png");
    animation: stars 150s linear infinite; opacity: 0.4; z-index: -2;
}
@keyframes stars { from { transform: translate(0, 0) } to { transform: translate(-1000px, -500px) } }

/* Мистическая темная Луна */
.moon {
    position: fixed;
    top: 60px;
    right: 80px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    z-index: -1;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.3) 0%, transparent 30%),
        #1a1a2e;
    box-shadow: 
        inset -10px -10px 30px rgba(0, 0, 0, 0.8), 
        inset 5px 5px 15px rgba(145, 71, 255, 0.3),
        0 0 20px rgba(145, 71, 255, 0.4), 
        0 0 50px rgba(145, 71, 255, 0.2);
    animation: moon-dark-float 15s ease-in-out infinite;
    will-change: transform;
    filter: blur(0.5px);
}
.moon::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    background: #9147ff;
    filter: blur(40px);
    opacity: 0.2;
    z-index: -2;
}
@keyframes moon-dark-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); box-shadow: 0 0 30px rgba(145, 71, 255, 0.3); }
    50% { transform: translate(-10px, -20px) rotate(3deg); box-shadow: 0 0 50px rgba(145, 71, 255, 0.5); }
}

/* --- НАВИГАЦИЯ --- */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(145, 71, 255, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 25px;
    flex-wrap: wrap;
}

.nav-link { 
    text-decoration: none;
    color: #ddd;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 77, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: #ff4dff;
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.1), rgba(255, 77, 255, 0.05));
    border-color: rgba(145, 71, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(145, 71, 255, 0.2);
    text-shadow: 0 0 8px rgba(255, 77, 255, 0.5);
}

.nav-link.active {
    color: #ff4dff;
    background: rgba(145, 71, 255, 0.2);
    border-color: #9147ff;
} 
    color: #aaa; 
    font-weight: bold; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-link:hover { 
    color: #ff4dff; 
    text-shadow: 0 0 10px #ff4dff;
    background: rgba(145, 71, 255, 0.15);
    border-color: rgba(255, 77, 255, 0.3);
}

/* Мобилька */
@media (max-width: 768px) {
    .main-nav {
        gap: 10px;
        padding: 10px;
    }
    
    .nav-link { 
        font-size: 0.8rem; 
        padding: 6px 12px; 
    }
}
    }
}

/* Кнопка "Назад" */
.main-nav .button {
    padding: 6px 12px; font-size: 13px; margin: 0;
    background: #9147ff; min-width: auto;
}

/* --- КОНТЕНТ --- */
.container {
    max-width: 1000px; margin: 20px auto; padding: 0 15px;
    position: relative;
    z-index: 1;
}

.title {
    text-align: center;
    font-size: clamp(1.5em, 8vw, 2.5em);
    margin: 20px 0; text-transform: uppercase;
    background: linear-gradient(to right, #9147ff, #ff4dff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.card {
    background: rgba(20, 20, 40, 0.7); border-radius: 15px;
    padding: 20px; margin-bottom: 20px; border: 1px solid rgba(145, 71, 255, 0.1);
}
.card:hover {
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.button, .button_right {
    display: inline-block; padding: 10px 20px;
    background: linear-gradient(45deg, #9147ff, #ff4dff);
    color: white; text-decoration: none; border-radius: 8px;
    font-weight: bold; text-align: center; transition: 0.3s;
}
.button_right { float: right; }

/* --- ФУТЕР --- */
footer {
    text-align: center; padding: 40px; opacity: 0.6;
    font-size: 0.9em; letter-spacing: 2px;
}

/* --- МОБИЛЬНЫЕ ПРАВКИ --- */
@media (max-width: 768px) {
    .main-nav { gap: 5px; }
    .nav-link { font-size: 13px; padding: 5px 8px; }
    .button_right { float: none; display: block; width: 100%; margin-top: 10px; }
    .moon { width: 60px; height: 60px; top: 5%; }
}

@media (max-width: 480px) {
    .nav-link { font-size: 12px; padding: 4px 6px; flex: 1 1 30%; text-align: center; }
    .container { padding: 0 10px; }
    .moon { opacity: 0.3; } 
}

.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
    align-items: start;
}
.members-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-top: 30px; }
.member-avatar { width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 15px; object-fit: cover; display: block; transition: 0.5s; }
.ava-m { border: 4px solid #00ff00; box-shadow: 0 0 15px #00ff00; }
.member-card { text-align: center; }
.member-card:hover .member-avatar { transform: scale(1.1) rotate(3deg); }
.role { font-weight: bold; text-transform: uppercase; font-size: 0.85em; margin-bottom: 10px; letter-spacing: 1px; }
.ava-gold { border: 4px solid #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 2); }
.ava-vip { border: 4px solid #00f2ff; box-shadow: 0 0 15px rgba(0, 242, 255, 1); }
.ava-l { border: 3px solid #ffffff; box-shadow: 0 0 10px rgba(255,255,255,0.5); }
.ava-nn { border: 3px solid #858585; box-shadow: 0 0 10px rgba(133, 133, 133,0.5); }

/* --- ГАЛЕРЕЯ И УПРАВЛЕНИЕ --- */
.gallery-controls {
    display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap;
    background: rgba(20, 20, 40, 0.7); padding: 15px; border-radius: 10px;
}
.gallery-controls input, .gallery-controls select {
    padding: 10px; border-radius: 5px; border: 1px solid #9147ff;
    background: #0a0a1e; color: white; outline: none; flex: 1; min-width: 150px;
}
.gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px; align-items: start;
}
.gallery-item {
    background: rgba(20, 20, 40, 0.8); border-radius: 10px; overflow: hidden;
    border: 1px solid rgba(145, 71, 255, 0.3); transition: transform 0.3s;
}
.gallery-item:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(145, 71, 255, 0.4); }
.gallery-item img {
    width: 100%; height: 250px; object-fit: cover; cursor: pointer; display: block;
}
.gallery-info { padding: 15px; text-align: center; }
.gallery-info h3 { font-size: 1.1em; color: #ff4dff; margin-bottom: 5px; }
.gallery-info p { font-size: 0.85em; color: #aaa; margin-bottom: 15px; }
.gallery-actions {
    display: flex; justify-content: center; gap: 15px;
}
.icon-btn {
    background: none; border: none; color: #aaa; cursor: pointer; font-size: 1.2em;
    display: flex; align-items: center; gap: 5px; transition: 0.2s;
}
.icon-btn:hover { color: #fff; }
.icon-btn.active-like { color: #00ff00; text-shadow: 0 0 10px #00ff00; }
.icon-btn.active-dislike { color: #ff0040; text-shadow: 0 0 10px #ff0040; }

/* --- ФОРМА ЗАГРУЗКИ --- */
.upload-form { display: flex; flex-direction: column; gap: 15px; }
.upload-form input {
    padding: 10px; border-radius: 5px; border: 1px solid #9147ff;
    background: #0a0a1e; color: white;
}
.upload-form input[type="file"] { padding: 5px; }

/* --- МОДАЛЬНОЕ ОКНО --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); display: none; justify-content: center;
    align-items: center; z-index: 9999; flex-direction: column;
}
.modal-content {
    max-width: 90%; max-height: 80vh; border-radius: 10px;
    box-shadow: 0 0 30px rgba(145, 71, 255, 0.5); object-fit: contain;
}
.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-close {
    position: absolute; top: 20px; right: 30px; font-size: 30px;
    color: white; cursor: pointer; font-weight: bold;
}
.modal-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(20, 20, 40, 0.8);
    padding: 10px 25px;
    border-radius: 30px;
}
.react-btn { 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(145,71,255,0.3); 
    color: white; 
    padding: 8px 15px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.react-btn:hover { 
    background: rgba(145,71,255,0.2); 
    border-color: #ff4dff; 
    opacity: 1 !important;
}

/* --- АДАПТИВНОСТЬ ДЛЯ МОБИЛОК --- */
@media (max-width: 768px) {
    .main-nav {
        gap: 10px;
        padding: 10px 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    .title.neon-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    .container {
        width: 95%;
        padding: 10px;
    }
    .moon {
        width: 80px;
        height: 80px;
        top: 20px;
        right: 20px;
        opacity: 0.3;
    }
}

@media (max-width: 400px) {
    .main-nav { gap: 5px; }
    .nav-link { font-size: 0.75rem; padding: 6px 10px; }
}

/* --- КРАСИВЫЕ УВЕДОМЛЕНИЯ --- */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    background: rgba(10, 10, 30, 0.98);
    border: 2px solid #9147ff;
    border-radius: 12px;
    color: white;
    z-index: 99999;
    box-shadow: 0 0 30px rgba(145, 71, 255, 0.6);
    animation: slideIn 0.3s ease;
    font-weight: bold;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.notification.success {
    border-color: #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
}

.notification.error {
    border-color: #ff4d4d;
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.4);
}

.notification.info {
    border-color: #4dffff;
    box-shadow: 0 0 30px rgba(77, 255, 255, 0.4);
}

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

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

.notification.hide {
    animation: slideOut 0.3s ease forwards;
}

@media (max-width: 768px) {
    .notification {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.95rem;
    }
}

/* --- УНИВЕРСАЛЬНЫЙ РЕКЛАМНЫЙ БАННЕР --- */
.ad-floating-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 15px;
    z-index: 2000;
    box-shadow: 0 0 20px rgba(145, 71, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    overflow: hidden;
}

.ad-floating-widget:hover {
    transform: translateY(-3px);
    border-color: var(--neon);
    box-shadow: 0 0 30px rgba(255, 77, 255, 0.4);
}

.ad-floating-widget::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%; width: 100%; height: 100%;
    background: var(--accent);
    filter: blur(40px);
    opacity: 0.1;
    z-index: -1;
    transform: translate(-50%, -50%);
}

.ad-widget-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--accent));
    transition: 0.3s;
}

.ad-floating-widget:hover .ad-widget-icon {
    filter: drop-shadow(0 0 10px var(--neon));
}

.ad-widget-text-block {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ad-widget-title_1 {
    color: rgba(255, 77, 255);
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.ad-widget-title {
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.ad-widget-subtitle {
    color: #aaa;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.ad-widget-link-btn {
    font-size: 0.75rem;
    padding: 5px 12px;
    background: linear-gradient(45deg, var(--accent), var(--neon));
    color: white;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    width: fit-content;
}

.ad-widget-close {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s;
}
.ad-widget-close:hover { color: var(--neon); }

@media (max-width: 768px) {
    .ad-floating-widget {
        width: calc(100% - 20px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 10px;
    }
    .ad-widget-icon { width: 40px; height: 40px; }
    .ad-widget-title { font-size: 0.85rem; }
}

/* --- СТИЛИ ГАЛЕРЕИ И МОДАЛОК --- */
:root { --accent: #9147ff; --neon: #ff4dff; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.gallery-item {
    background: rgba(15, 15, 35, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(145, 71, 255, 0.2);
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: var(--neon);
    box-shadow: 0 10px 30px rgba(145, 71, 255, 0.2);
}

/* Общие стили для ВСЕХ модалок */
.modal, .art-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #0a0a1e;
    max-width: 500px;
    width: 100%;
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--accent);
    box-shadow: 0 0 50px rgba(145, 71, 255, 0.4);
    text-align: center;
}

.art-modal-content {
    background: #0a0a1e;
    display: flex;
    max-width: 1100px;
    width: 95%;
    height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--accent);
}

#modalImg {
    flex: 1;
    background: #000;
    object-fit: contain;
    max-width: 70%;
}

.art-info-panel {
    width: 30%;
    padding: 30px;
    background: #0d0d26;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(145, 71, 255, 0.2);
}

.input-std {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(145,71,255,0.3);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* --- СТИЛИ ПРОФИЛЯ --- */
.profile-header {
    background: rgba(15, 15, 35, 0.85);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(145, 71, 255, 0.4);
    box-shadow: 0 0 30px rgba(10, 10, 30, 0.9);
}

.post-card {
    background: rgba(20, 20, 40, 0.7);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #9147ff;
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateX(5px);
    background: rgba(25, 25, 50, 0.8);
}

/* --- СКРОЛЛБАР --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 10, 30, 0.5); 
}
::-webkit-scrollbar-thumb {
    background: #9147ff; 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff4dff; 
}

/* Мобильный чат */
@media (max-width: 768px) {
    #globalChatWidget {
        width: 100% !important;
        height: 100vh !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ФИНАЛЬНЫЙ ФИКС — модалки всегда сверху */
.modal, #authModal, #pwdModal, #editorModal, #loreViewModal, #loreCommentPwdModal, .modal-overlay {
    z-index: 999999 !important;
}
.modal-box, .modal-content, .lore-modal-inner {
    z-index: 1000000 !important;
}
.container {
    z-index: 1 !important;
}