:root {
    --bg-dark: #030712;
    --bg-card: rgba(17, 24, 39, 0.6);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --font-main: 'Montserrat', sans-serif;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    
    /* ЗАПРЕЩАЕМ КАРЕТКУ (МИГАЮЩУЮ ПАЛОЧКУ) ВЕЗДЕ */
    user-select: none; 
    -webkit-user-select: none;
}

/* РАЗРЕШАЕМ ВЫДЕЛЕНИЕ ТОЛЬКО В ПОЛЯХ ВВОДА */
input, textarea {
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

/* --- ШАПКА С ЭФФЕКТОМ ПЛАВАНИЯ --- */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 5%; 
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(20px); 
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky; top: 0; z-index: 100;
    transition: all 0.3s ease;
}
.header.scrolled {
    padding: 10px 5%;
    background: rgba(3, 7, 18, 0.95);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.logo { font-size: 24px; font-weight: 800; color: var(--text-main); text-decoration: none; display: flex; gap: 10px; align-items: center; transition: 0.3s; }
.logo:hover { transform: scale(1.05); text-shadow: 0 0 15px var(--accent); }
.nav { display: flex; gap: 30px; align-items: center; }
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 600; transition: 0.3s; position: relative; padding: 5px 0; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--accent); transition: 0.3s; }
.nav-link:hover { color: var(--text-main); }
.nav-link:hover::after { width: 100%; }
.user-badge { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: white; padding: 10px 25px; border-radius: 30px; text-decoration: none; font-weight: 700; font-size: 0.9rem; transition: 0.3s; box-shadow: 0 0 15px var(--accent-glow); }
.user-badge:hover { transform: translateY(-2px); box-shadow: 0 0 30px var(--accent-glow); }

/* --- КОНТЕЙНЕРЫ И ТЕКСТ --- */
.page-container { padding: 60px 5%; max-width: 1400px; margin: 0 auto; width: 100%; flex: 1; }
.page-title { font-size: 3.5rem; text-align: center; margin-bottom: 15px; font-weight: 800; letter-spacing: -1px; }
.text-gradient {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-clip: text; color: transparent;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-size: 200% auto; animation: gradientMove 3s linear infinite;
}
@keyframes gradientMove { to { background-position: 200% center; } }
.page-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 60px; font-size: 1.2rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- КАРТОЧКИ С ЦВЕТНЫМ БЛИКОМ --- */
.glass-card {
    background: var(--bg-card); 
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px; padding: 40px; 
    backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; overflow: hidden;
}
.glass-card::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: 0.5s;
}
.glass-card:hover::before { left: 100%; }
.glass-card:hover { 
    transform: translateY(-10px); 
    border-color: var(--accent); 
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15); 
}

/* --- ИГРЫ --- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.game-card { display: flex; flex-direction: column; height: 100%; }
.game-icon { font-size: 3.5rem; margin-bottom: 20px; filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5)); }
.game-card h3 { font-size: 1.5rem; margin-bottom: 15px; font-weight: 700; }
.game-card p { color: var(--text-muted); margin-bottom: 25px; flex: 1; font-size: 1rem; line-height: 1.6; }
.game-meta { font-size: 0.85rem; color: var(--accent); font-weight: 700; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }

/* --- СУПЕР КНОПКИ --- */
.btn {
    padding: 15px 30px; border-radius: 12px; border: none; font-weight: 700; font-family: var(--font-main); font-size: 1rem; cursor: pointer; transition: 0.3s; text-decoration: none; text-align: center; display: inline-block; position: relative; overflow: hidden; z-index: 1;
}
.btn-primary { background: var(--accent); color: white; box-shadow: 0 0 20px var(--accent-glow); }
.btn-primary::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6); z-index: -1; transition: opacity 0.3s; opacity: 0;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 30px var(--accent-glow); }
.btn-primary:disabled { background: #374151; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

/* --- МОДАЛЬНОЕ ОКНО --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); z-index: 1000; display: none; justify-content: center; align-items: center; padding: 20px; }
.modal-content { width: 100%; max-width: 750px; position: relative; max-height: 90vh; overflow-y: auto; animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes modalPop { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: white; font-size: 2rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }
.quiz-progress { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin: 20px 0 30px; overflow: hidden; }
.quiz-progress-bar { height: 100%; background: linear-gradient(90deg, #3b82f6, #8b5cf6); width: 0; transition: width 0.4s ease; box-shadow: 0 0 15px var(--accent); }
.quiz-header { display: flex; justify-content: space-between; margin-bottom: 25px; font-weight: 700; color: var(--text-muted); font-size: 1rem; }
.quiz-question { font-size: 1.5rem; margin-bottom: 30px; line-height: 1.5; font-weight: 700; }
.quiz-options { display: flex; flex-direction: column; gap: 15px; }
.quiz-option { padding: 20px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 15px; cursor: pointer; transition: 0.2s; font-size: 1.1rem; font-weight: 500; }
.quiz-option:hover { background: rgba(59, 130, 246, 0.1); border-color: var(--accent); transform: translateX(10px); }
.quiz-option.correct { background: rgba(16, 185, 129, 0.2); border-color: var(--success); color: var(--success); }
.quiz-option.wrong { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); color: var(--danger); }

/* --- УГРОЗЫ --- */
.threats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 30px; }
.threat-card { display: flex; flex-direction: column; }
.threat-icon { font-size: 3rem; margin-bottom: 20px; }
.threat-card h3 { color: var(--accent); margin-bottom: 15px; font-size: 1.5rem; font-weight: 700; }
.threat-desc { color: var(--text-main); font-weight: 600; margin-bottom: 20px; font-size: 1.05rem; }
.threat-detail { max-height: 0; overflow: hidden; transition: max-height 0.5s ease; }
.threat-detail p { color: var(--text-muted); font-size: 1rem; line-height: 1.7; padding-bottom: 20px; }

/* --- АВТОРИЗАЦИЯ --- */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 75vh; padding: 20px; }
.auth-box { width: 100%; max-width: 480px; }
.auth-tabs { display: flex; margin-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.auth-tab { flex: 1; padding: 15px; text-align: center; cursor: pointer; color: var(--text-muted); font-weight: 700; transition: 0.3s; border-bottom: 3px solid transparent; font-size: 1.1rem; }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 10px; font-size: 0.95rem; color: var(--text-muted); font-weight: 600; }
.form-group input { width: 100%; padding: 18px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: white; font-family: var(--font-main); font-size: 1rem; transition: 0.3s; }
.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); }

/* Анимация переключения форм */
.auth-form { display: none; opacity: 0; transform: translateY(20px); transition: opacity 0.4s ease, transform 0.4s ease; }
.auth-form.active-form { display: block; animation: formEnter 0.4s forwards; }
@keyframes formEnter { to { opacity: 1; transform: translateY(0); } }

/* Обертка для пароля с глазиком */
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { padding-right: 50px; }
.toggle-password {
    position: absolute; right: 15px; background: none; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; padding: 5px; z-index: 10; color: var(--text-muted); transition: color 0.3s, transform 0.2s;
}
.toggle-password:hover { color: var(--accent); transform: scale(1.1); }
.toggle-password svg { width: 20px; height: 20px; }

/* Индикатор сложности */
.strength-meter { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-top: 10px; overflow: hidden; display: block; }
.strength-bar { height: 100%; width: 0%; background: #374151; transition: width 0.4s ease, background 0.4s ease; display: block; border-radius: 4px; }
.strength-text { font-size: 0.85rem; margin-top: 8px; font-weight: 700; transition: color 0.3s; text-transform: uppercase; letter-spacing: 1px; }

/* Список требований к паролю */
.requirements { margin-top: 15px; margin-bottom: 15px; display: flex; flex-direction: column; gap: 8px; }
.req-item { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; transition: color 0.3s; }
.req-item span { display: inline-flex; justify-content: center; align-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(239, 68, 68, 0.2); color: #ef4444; font-size: 0.7rem; font-weight: bold; transition: all 0.3s; }
.req-item.met { color: #10b981; }
.req-item.met span { background: rgba(16, 185, 129, 0.2); color: #10b981; }

/* Ошибки */
.error-msg { background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); padding: 15px; border-radius: 10px; text-align: center; margin-bottom: 20px; font-weight: 600; animation: shake 0.4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* --- ПРОФИЛЬ --- */
.profile-header { display: flex; align-items: center; gap: 40px; margin-bottom: 50px; }
.avatar { width: 140px; height: 140px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; justify-content: center; align-items: center; font-size: 4rem; font-weight: 800; box-shadow: 0 0 40px var(--accent-glow); }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; margin-bottom: 50px; }
.stat-box { background: rgba(255,255,255,0.03); padding: 40px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); text-align: center; transition: 0.3s; }
.stat-box:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.stat-value { font-size: 3rem; font-weight: 800; color: var(--accent); display: block; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 15px; font-weight: 600; }

/* --- О ПРОЕКТЕ --- */
.about-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.about-main h2 { color: var(--accent); font-size: 1.8rem; margin-bottom: 20px; }
.about-main p { color: var(--text-muted); line-height: 1.8; margin-bottom: 20px; font-size: 1.1rem; }
.tech-list { list-style: none; padding: 0; }
.tech-list li { padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-muted); font-size: 1.05rem; }
.tech-list strong { color: var(--text-main); }
.about-author { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.author-avatar { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800; margin-bottom: 25px; box-shadow: 0 0 30px var(--accent-glow); }

/* --- УВЕДОМЛЕНИЯ --- */
.toast { position: fixed; top: 30px; right: 30px; background: var(--success); color: #000; padding: 20px 40px; border-radius: 15px; font-weight: 800; font-size: 1.1rem; z-index: 2000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transform: translateX(200%); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.toast.show { transform: translateX(0); }

.modern-footer { background: rgba(0,0,0,0.5); padding: 40px; text-align: center; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.95rem; margin-top: auto; }

/* --- ГЛАВНЫЙ ЭКРАН (HERO) --- */
.hero-section { display: flex; align-items: center; justify-content: space-between; min-height: 70vh; gap: 50px; margin-top: 20px; }
.hero-content { flex: 1; max-width: 700px; }
.badge { display: inline-block; padding: 8px 16px; background: rgba(59, 130, 246, 0.1); color: var(--accent); border: 1px solid var(--accent); border-radius: 50px; font-size: 0.9rem; font-weight: 700; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 1px; }
.hero-title { font-size: 4rem; font-weight: 800; line-height: 1.1; margin-bottom: 25px; min-height: 140px; }
.cursor { color: var(--accent); font-weight: 300; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-subtitle { font-size: 1.2rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.hero-visual { flex: 1; display: flex; justify-content: center; align-items: center; perspective: 1000px; }

/* --- ИНТЕРАКТИВНЫЙ ЩИТ --- */
.interactive-shield { position: relative; width: 350px; height: 350px; display: flex; justify-content: center; align-items: center; transition: transform 0.1s ease-out; transform-style: preserve-3d; }
.shield-glow { position: absolute; width: 250px; height: 250px; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: 0.4; filter: blur(40px); animation: pulseGlow 3s infinite alternate; }
.shield-core { width: 140px; height: 170px; background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); clip-path: polygon(50% 0%, 100% 20%, 100% 70%, 50% 100%, 0% 70%, 0% 20%); position: relative; z-index: 2; filter: drop-shadow(0 0 40px var(--accent-glow)); transform: translateZ(50px); transition: transform 0.1s ease-out; }
.shield-core::before { content: ''; position: absolute; top: 6px; left: 6px; right: 6px; bottom: 6px; background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%); clip-path: polygon(50% 0%, 100% 20%, 100% 70%, 50% 100%, 0% 70%, 0% 20%); z-index: -1; }
.shield-core::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 60%); clip-path: polygon(50% 0%, 100% 20%, 100% 70%, 50% 100%, 0% 70%, 0% 20%); }
.orbit { position: absolute; border: 2px solid rgba(59, 130, 246, 0.15); border-radius: 50%; animation: spin 12s linear infinite; }
.orbit-1 { width: 280px; height: 280px; border-top-color: var(--accent); border-right-color: rgba(139, 92, 246, 0.5); }
.orbit-2 { width: 360px; height: 360px; border-bottom-color: #8b5cf6; border-left-color: rgba(59, 130, 246, 0.5); animation-direction: reverse; animation-duration: 18s; }
@keyframes pulseGlow { from { transform: scale(1); opacity: 0.3; } to { transform: scale(1.2); opacity: 0.6; } }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- АДАПТИВ --- */
@media (max-width: 992px) {
    .hero-section { flex-direction: column; text-align: center; padding-top: 20px; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero-title { font-size: 2.8rem; min-height: auto; }
    .hero-actions { justify-content: center; }
}

@media (max-width: 768px) {
    .header { flex-direction: column; gap: 20px; padding: 15px; }
    .nav { flex-wrap: wrap; justify-content: center; gap: 20px; }
    .about-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
    .game-grid, .threats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 2.5rem; }
    .glass-card { padding: 25px; }
}