:root {
    --bg: #0c0c0c;
    --fg: #cbcbcb;
    --fg-rgb: 203, 203, 203; /* Для rgba фильтров */
    --bg-rgb: 12, 12, 12;
    --surface-bg: #111;
    --surface-hover: #151515;
    --border-light: rgba(203, 203, 203, 0.2);
    --text-muted: #888;
    --text-sub: #aaa;
}

[data-theme="light"] {
    --bg: #cbcbcb;
    --fg: #0c0c0c;
    --fg-rgb: 12, 12, 12;
    --bg-rgb: 203, 203, 203;
    --surface-bg: #b8b8b8;
    --surface-hover: #a8a8a8;
    --border-light: rgba(12, 12, 12, 0.2);
    --text-muted: #555;
    --text-sub: #333;
}

html {
    scroll-behavior: smooth;
}

/* --- КАСТОМНЫЙ СКРОЛЛБАР --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--fg);
}

/* --- КАСТОМНОЕ ВЫДЕЛЕНИЕ ТЕКСТА --- */
::selection {
    background: var(--fg);
    color: var(--bg);
}
::-moz-selection {
    background: var(--fg);
    color: var(--bg);
}

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

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Helvetica Neue', Arial, sans-serif; /* Суровый гротеск */
    text-transform: uppercase;
    overflow-x: hidden;
}

/* Чистая "журнальная" навигация */
.editorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    opacity: 0;
    animation: fadeUp 1s ease-out 0.2s forwards;
    background: rgba(var(--bg-rgb), 0.8); /* Полупрозрачный фон под цвет темы */
    backdrop-filter: blur(10px); /* Эффект размытия контента под меню */
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -1px;
    text-transform: lowercase;
}

.logo span {
    font-size: 0.8rem;
    vertical-align: top;
}

/* Бургер-кнопка (скрыта на ПК) */
.burger-menu {
    display: none;
    background: transparent;
    border: none;
    color: var(--fg);
    cursor: pointer;
    z-index: 200;
    position: relative;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 3rem;
}

/* Переключатель темы */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block !important; }

.nav-menu {
    display: flex;
    gap: 3rem;
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: bold;
}

.nav-menu span, .nav-menu a {
    cursor: pointer;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.nav-menu span:hover, .nav-menu a:hover {
    color: var(--fg);
    text-shadow: 0 0 10px rgba(var(--fg-rgb), 0.5);
}

.nav-auth-container {
    display: flex;
    align-items: center;
}

/* Кнопка логина с WOW-эффектом */
.cyber-login-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(var(--fg-rgb), 0.05);
    color: var(--fg);
    border: 1px solid var(--border-light);
    padding: 0.7rem 1.5rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px);
}

.cyber-login-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--fg);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-login-btn:hover {
    background: rgba(var(--fg-rgb), 0.1);
    border-color: rgba(var(--fg-rgb), 0.6);
    box-shadow: 0 0 20px rgba(var(--fg-rgb), 0.15);
    transform: translateY(-2px);
}

.cyber-login-btn:hover::before {
    width: 100%;
}

.cyber-login-btn:active {
    transform: translateY(0);
}

/* Мини-профиль в навигации */
.nav-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-left: 2rem;
}

.nav-profile:hover {
    opacity: 0.7;
}

.nav-mini-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--fg);
    object-fit: cover;
}

.nav-mini-name {
    font-size: 0.8rem;
    font-weight: bold;
}

/* Выпадающее меню профиля */
.profile-wrapper {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--fg);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: 0 15px 40px rgba(0,0,0,0.9);
    animation: fadeUp 0.2s ease-out forwards;
}

.dropdown-item {
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--fg);
    color: var(--bg);
}

.dropdown-item.logout {
    border-top: 1px solid var(--border-light);
    color: #ff4a4a;
}

.dropdown-item.logout:hover {
    background: #ff4a4a;
    color: var(--bg);
}

/* Основной холст */
.editorial-canvas {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Огромная фоновая типографика */
.bg-typography {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    opacity: 0;
    animation: fadeIn 2s ease-out 1.5s forwards;
}

.bg-word-left {
    font-size: 18vh; /* Масштабируем по высоте экрана, чтобы слово DESIRE не обрезалось */
    font-weight: 900;
    color: rgba(var(--fg-rgb), 0.03);
    writing-mode: vertical-rl; /* Правильный вертикальный текст */
    transform: rotate(180deg);
    margin: 0;
}

.bg-word-right {
    font-size: 40vw; /* Немного уменьшили для баланса */
    font-weight: 900;
    color: rgba(var(--fg-rgb), 0.03);
    margin-right: -5vw;
}

/* Экспонат (3D модель) */
.center-exhibit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    width: 80vw; /* Сделали контейнер шире */
    height: 85vh; /* И выше */
    z-index: 10;
    opacity: 0;
    animation: fadeUpScale 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

model-viewer {
    width: 100%;
    height: 100%;
    outline: none;
}

/* Плавающие элементы микро-интерфейса */
.float-elem {
    position: absolute;
    z-index: 20;
    opacity: 0; /* Изначально скрыты для анимации */
}

/* Левый верхний угол */
.top-left {
    top: 25%;
    left: 4rem;
    animation: fadeUp 1s ease-out 0.8s forwards;
}

.top-left h2 {
    font-size: 1rem;
    margin: 0;
}
.top-left p {
    font-size: 0.65rem;
    margin-top: 5px;
    letter-spacing: 1px;
    color: #888;
}
.icon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
}
.svg-icon { display: flex; align-items: center; justify-content: center; }
.circle-icon { width: 20px; height: 20px; border: 1px solid var(--fg); border-radius: 50%; }
.micro-text { font-size: 0.5rem; letter-spacing: 2px; }

/* Точка слева */
.mid-left { top: 50%; left: 4rem; animation: fadeUp 1s ease-out 1s forwards; }
.dot { width: 5px; height: 5px; background: var(--fg); border-radius: 50%; }

/* Левый нижний угол (Авторизация) */
.bottom-left {
    bottom: 4rem;
    left: 4rem;
    animation: fadeUp 1s ease-out 1.2s forwards;
}
.fine-print {
    font-size: 0.55rem;
    line-height: 1.6;
    letter-spacing: 1px;
    color: #777;
}

/* Правый центр */
.mid-right {
    top: 45%;
    right: 15%;
    animation: fadeUp 1s ease-out 1.4s forwards;
}
.status-title { font-size: 0.6rem; letter-spacing: 1px; margin-bottom: 2rem; }
.green-dot { display: inline-block; width: 6px; height: 6px; background: #4caf50; border-radius: 50%; margin-right: 5px; }
.line-indicator { display: flex; align-items: center; gap: 10px; }
.circle-outline { width: 15px; height: 15px; border: 1px solid var(--fg); border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.circle-outline::after { content: ""; width: 5px; height: 5px; background: var(--fg); border-radius: 50%; }
.line { width: 50px; height: 1px; background: var(--fg); }
.line.short { width: 20px; }
.number { font-weight: bold; font-size: 0.8rem; }

/* Правый низ */
.bottom-right {
    bottom: 4rem;
    right: 4rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2rem;
    animation: fadeUp 1s ease-out 1.6s forwards;
}
.right-align { text-align: right; }
.vertical-date { writing-mode: vertical-rl; font-size: 0.7rem; font-weight: bold; letter-spacing: 3px; display: flex; align-items: center; gap: 10px; }
.v-line { width: 1px; height: 30px; background: var(--fg); }
.scroll-arrow { 
    border: 1px solid var(--fg); 
    width: 40px; 
    height: 40px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 1.2rem; 
    cursor: pointer;
    transition: all 0.3s ease;
}
.scroll-arrow:hover { background: var(--fg); color: var(--bg); }

/* Ключевые кадры для анимаций (Красивый заход) */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUpScale {
    from { opacity: 0; transform: translate(-50%, -35%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -45%) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Утилиты */
.text-muted {
    color: var(--text-muted);
}

/* --- СЕКЦИЯ ВЕРИФИКАЦИИ --- */
.verification-section {
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
    padding: 8rem 5% 4rem 5%;
    border-top: 2px solid var(--border-light);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.verif-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    max-width: 1400px;
    width: 100%;
    align-items: center;
}

.verif-left {
    display: flex;
    flex-direction: column;
}

.verif-title {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 6rem;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 0.85;
    margin-bottom: 2.5rem;
    color: var(--fg);
    text-transform: uppercase;
}

.verif-box {
    background: rgba(var(--fg-rgb), 0.03);
    border: 1px solid rgba(var(--fg-rgb), 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.verif-box-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--fg);
    text-transform: none;
}

.verif-box p {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-sub);
    text-transform: none; /* Текст читаемый, без CapsLock */
    position: relative;
    z-index: 2;
}

.highlight-role {
    background: rgba(var(--fg-rgb), 0.1);
    color: var(--fg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
}

.highlight-role.warning {
    background: rgba(255, 74, 74, 0.15);
    color: #ff4a4a;
}

.verif-bg-icon {
    position: absolute;
    right: -10px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    color: rgba(var(--fg-rgb), 0.04);
    transform: rotate(-15deg);
    z-index: 1;
    pointer-events: none;
}

.verif-footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: none;
    margin-top: 1.5rem;
}

/* Супер-кнопка для входа на сервер */
.cyber-join-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem; /* Делаем отступ снизу, чтобы текст под ней не прилипал */
    padding: 1.2rem 2.5rem;
    color: var(--bg);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    overflow: hidden;
    transition: color 0.4s ease;
    z-index: 1;
    width: fit-content;
}

.cyber-join-btn .btn-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    background: var(--fg);
    z-index: -1;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-join-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 2px solid var(--fg);
    z-index: -2;
}

.cyber-join-btn:hover {
    color: var(--fg);
}

.cyber-join-btn:hover .btn-bg {
    width: 0%;
}

.cyber-join-btn .btn-icon {
    display: flex;
    transition: transform 0.3s ease;
}

.cyber-join-btn:hover .btn-icon {
    transform: translateX(12px);
}

.btn-deco {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-size: 0.45rem;
    font-family: monospace;
    letter-spacing: 1px;
    color: var(--bg);
    transition: color 0.4s ease;
}

.cyber-join-btn:hover .btn-deco {
    color: var(--fg);
}

.verif-right {
    display: flex;
    justify-content: center;
}

.vc-panel {
    background: var(--surface-bg);
    border: 1px solid rgba(var(--fg-rgb), 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.vc-header {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--fg);
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.vc-line {
    width: 50px;
    height: 2px;
    background: var(--text-muted);
    margin-right: 10px;
}

.vc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vc-item {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: bold;
    transition: all 0.3s ease;
}

.vc-item.active {
    background: rgba(var(--fg-rgb), 0.05);
    color: var(--fg);
}

.vc-icon {
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
}

.vc-name {
    font-size: 1.2rem;
    flex-grow: 1;
}

.vc-slots-pill {
    background: transparent;
    font-family: monospace;
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    letter-spacing: 2px;
}

.vc-item.active .vc-slots-pill {
    background: var(--bg);
}

.vc-current {
    color: var(--fg);
}

/* Скрываем старые стили */
.hidden {
    display: none !important;
}

/* --- ТЕРМИНАЛЬНЫЙ ПРЕЛОАДЕР --- */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); /* Подстраивается под тему */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.terminal {
    font-family: monospace; color: var(--fg);
    font-size: 1.2rem; letter-spacing: 1px;
}
.terminal p { margin: 0.5rem 0; text-shadow: 0 0 5px rgba(var(--fg-rgb), 0.5); }
.terminal-cursor::after {
    content: '█';
    animation: blink 1s step-start infinite;
    margin-left: 8px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Пауза всех анимаций сайта, пока идет загрузка */
body.booting * { animation-play-state: paused !important; }

/* --- СЕКЦИЯ МАФИИ --- */
.mafia-section {
    width: 100%;
    min-height: 80vh;
    background: var(--bg);
    padding: 8rem 5% 4rem 5%;
    border-top: 2px solid var(--border-light);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.mafia-container {
    max-width: 1200px;
    width: 100%;
    z-index: 10;
}

.mafia-header { text-align: center; margin-bottom: 4rem; }
.mafia-title { font-family: Impact, 'Arial Black', sans-serif; font-size: 9rem; font-weight: 900; letter-spacing: 2px; color: var(--fg); margin-bottom: 0.5rem; text-transform: uppercase; }
.text-red { color: #ff3333; text-shadow: 0 0 15px rgba(255, 51, 51, 0.4); }

.mafia-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.mafia-card {
    background: rgba(var(--fg-rgb), 0.02);
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Кровавая анимация обводки */
.mafia-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: #ff3333; transform: scaleY(0); transition: transform 0.3s ease; transform-origin: bottom;
    box-shadow: 0 0 15px #ff3333;
}

.mafia-card:hover { border-color: rgba(255, 51, 51, 0.3); background: rgba(255, 51, 51, 0.02); transform: translateY(-5px); }
.mafia-card:hover::before { transform: scaleY(1); }

.mafia-icon { margin-bottom: 1.5rem; }
.mafia-icon svg { width: 45px; height: 45px; filter: drop-shadow(0 0 8px rgba(255, 51, 51, 0.6)); }

.mafia-card h3 { font-size: 1.2rem; margin-bottom: 1rem; letter-spacing: 1px; color: var(--fg); font-weight: 900; }
.mafia-card p { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 0.95rem; line-height: 1.6; color: var(--text-sub); text-transform: none; }

/* --- ПОДВАЛ САЙТА (ФУТЕР) --- */
.cyber-footer {
    width: 100%;
    padding: 2rem 5%;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
    position: relative;
}

.cyber-footer p {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.cyber-footer .footer-link { color: var(--fg); font-weight: bold; text-decoration: none; transition: text-shadow 0.3s ease; }
.cyber-footer .footer-link:hover { text-shadow: 0 0 10px rgba(var(--fg-rgb), 0.8); }
