/* ==================== */
/* style.css - Основные стили и переменные */
/* ==================== */

:root {

    --glass-bg: rgba(20, 20, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #ff3b3b, #ff8f00);
    --gradient-success: linear-gradient(135deg, #4caf50, #2e7d32);
    --gradient-warning: linear-gradient(135deg, #ff9800, #c66900);
    --gradient-info: linear-gradient(135deg, #2196f3, #0b5e9e);
    --gradient-dark: linear-gradient(135deg, #14141f, #0c0c14);
    
    /* Обновленные тени */
    --shadow-neon: 0 0 20px rgba(255, 59, 59, 0.3);
    --shadow-neon-hover: 0 0 30px rgba(255, 59, 59, 0.5);
    
    /* Mobile first переменные */
    --mobile-header-height: 60px;
    --mobile-bottom-nav-height: 70px;
    
    /* Основные цвета */
    --primary: #ff3b3b;
    --primary-dark: #d32f2f;
    --primary-light: #ff6b6b;
    --secondary: #ff8f00;
    --secondary-light: #ffb74d;
    --accent: #ff5252;
    
    /* Фоны */
    --background: #0a0a0f;
    --surface: #14141f;
    --surface-light: #1e1e2d;
    --surface-dark: #0c0c14;
    
    /* Текст */
    --text: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #6c6c8a;
    --text-tertiary: #4a4a60;
    
    /* Границы */
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    
    /* Статусы */
    --success: #4caf50;
    --success-dark: #2e7d32;
    --warning: #ff9800;
    --warning-dark: #c66900;
    --error: #f44336;
    --error-dark: #b71c1c;
    --info: #2196f3;
    --info-dark: #0b5e9e;
    
    /* Ранги */
    --rank-0: #9e9e9e;
    --rank-1: #4caf50;
    --rank-2: #9c27b0;
    --rank-3: #ff9800;
    --rank-4: #00bcd4;
    --rank-5: #ffc107;
    --rank-6: #ff3b3b;
    --rank-7: #e91e63;
    --rank-8: #673ab7;
    --rank-9: #3f51b5;
    --rank-10: #009688;
    --rank-11: #ff5722;
    --rank-12: #795548;
    --rank-13: #607d8b;
    --rank-14: #9e9e9e;
    --rank-15: #ffd700;
    
    /* Тени и эффекты */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(255, 59, 59, 0.3);
    --shadow-xl: 0 15px 40px rgba(255, 59, 59, 0.4);
    --glow: 0 0 15px rgba(255, 59, 59, 0.5);
    --glow-secondary: 0 0 15px rgba(255, 143, 0, 0.5);
    --glow-success: 0 0 15px rgba(76, 175, 80, 0.5);
    --glow-warning: 0 0 15px rgba(255, 152, 0, 0.5);
    
    /* Размеры */
    --header-height: 70px;
    --sidebar-width: 320px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    
    /* Анимации */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Утилиты */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

/* Скроллбары */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
    transition: var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Анимации */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes glow {
    0% { box-shadow: 0 0 5px var(--primary); }
    50% { box-shadow: 0 0 20px var(--primary); }
    100% { box-shadow: 0 0 5px var(--primary); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes progressPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Готовые классы анимаций */
.animate-glow {
    animation: glow 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Основной контейнер */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    position: relative;
}

/* ==================== */
/* Экран авторизации */
/* ==================== */

.auth-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(135deg, var(--background) 0%, #1a0a0a 100%);
    position: relative;
    overflow-y: auto;
    padding: 30px 20px;
}

.auth-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    animation: gradient 3s ease infinite;
    background-size: 200% 200%;
    z-index: 10;
}

.auth-container {
    background: var(--surface);
    border-radius: var(--border-radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 700px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease;
    margin: 0 auto;
}

/* Декоративные элементы */
.auth-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: var(--border-radius-xl);
}

.decoration-circle {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 59, 59, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.decoration-circle:nth-child(1) {
    width: 500px;
    height: 500px;
    top: -250px;
    right: -250px;
}

.decoration-circle:nth-child(2) {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -200px;
    background: radial-gradient(circle, rgba(255, 143, 0, 0.15) 0%, transparent 70%);
}

.decoration-circle:nth-child(3) {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
    position: relative;
}

/* Логотип */
.auth-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.logo-image {
    width: 160px;
    height: 160px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box,
                linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
    box-shadow: 
        0 0 20px rgba(255, 59, 59, 0.3),
        0 0 40px rgba(255, 143, 0, 0.2),
        inset 0 0 20px rgba(255, 59, 59, 0.2);
    animation: float 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.08);
    box-shadow: 
        0 0 30px rgba(255, 59, 59, 0.6),
        0 0 60px rgba(255, 143, 0, 0.4),
        inset 0 0 30px rgba(255, 59, 59, 0.3);
    border-width: 4px;
}

.auth-logo::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 1px solid rgba(255, 59, 59, 0.3);
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.auth-logo::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 143, 0, 0.2);
    animation: rotate 10s linear infinite;
    pointer-events: none;
}

.auth-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.auth-team {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 36px;
    font-weight: 800;
    display: inline-block;
    margin-left: 10px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.auth-subtitle i {
    color: var(--primary);
    font-size: 22px;
}

/* Форма авторизации */
.auth-form {
    margin-bottom: 36px;
    position: relative;
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.form-group label i {
    color: var(--primary);
    font-size: 18px;
    width: 20px;
}

.form-input {
    width: 100%;
    padding: 20px 24px;
    background: var(--surface-dark);
    border: 2px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 17px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.form-hint i {
    color: var(--info);
    font-size: 14px;
}

.auth-button {
    width: 100%;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.button-icon {
    font-size: 22px;
}

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

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-loader {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Сохраненные персонажи */
.saved-characters {
    border-top: 2px solid var(--border);
    padding-top: 28px;
    margin-bottom: 28px;
}

.saved-characters-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 18px;
}

.saved-characters-title i {
    color: var(--primary);
    font-size: 20px;
}

.saved-characters-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 8px;
}

.saved-character-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface-dark);
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.saved-character-item:hover {
    border-color: var(--primary);
    transform: translateX(6px);
    box-shadow: var(--glow);
}

.saved-character-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.saved-character-info {
    flex: 1;
    min-width: 0;
}

.saved-character-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-character-id {
    color: var(--text-muted);
    font-size: 14px;
}

.saved-character-delete {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 20px;
}

.saved-character-delete:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.1);
}

/* Футер авторизации */
.auth-footer {
    border-top: 2px solid var(--border);
    padding-top: 32px;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.info-section {
    background: var(--surface-dark);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.info-section:hover {
    border-color: var(--primary);
    box-shadow: var(--glow);
}

.info-section h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 18px;
    margin-bottom: 16px;
}

.info-section h4 i {
    color: var(--primary);
    font-size: 22px;
    width: 24px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    opacity: 0.95;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 16px;
    flex-wrap: wrap;
    padding: 6px 0;
}

.contact-item i {
    color: var(--primary);
    width: 24px;
    font-size: 18px;
}

.contact-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 6px 16px;
    background: rgba(255, 143, 0, 0.1);
    border-radius: 30px;
    border: 1px solid transparent;
    margin-left: 8px;
    font-size: 15px;
}

.contact-link:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
    border-color: var(--secondary-light);
    box-shadow: 0 5px 15px rgba(255, 143, 0, 0.3);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    font-size: 16px;
    font-weight: 500;
}

.social-link i {
    width: 24px;
    font-size: 22px;
}

.social-link.telegram {
    background: linear-gradient(135deg, #0088cc, #00aaff);
    border: none;
}

.social-link.telegram:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.4);
}

.copyright {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Адаптивность для auth-экрана */
@media (max-width: 768px) {
    .auth-container {
        max-width: 650px;
        padding: 35px 30px;
    }
    
    .auth-title {
        font-size: 42px;
    }
    
    .auth-team {
        font-size: 32px;
    }
    
    .auth-subtitle {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .auth-screen {
        padding: 20px 15px;
    }
    
    .auth-container {
        padding: 28px 22px;
        border-radius: 24px;
    }
    
    .logo-image {
        width: 130px;
        height: 130px;
    }
    
    .auth-logo::before {
        width: 140px;
        height: 140px;
    }
    
    .auth-logo::after {
        width: 150px;
        height: 150px;
    }
    
    .auth-title {
        font-size: 34px;
    }
    
    .auth-team {
        font-size: 26px;
    }
    
    .auth-subtitle {
        font-size: 17px;
    }
}

@media (max-width: 380px) {
    .logo-image {
        width: 110px;
        height: 110px;
    }
    
    .auth-logo::before {
        width: 120px;
        height: 120px;
    }
    
    .auth-logo::after {
        width: 130px;
        height: 130px;
    }
    
    .auth-title {
        font-size: 30px;
    }
    
    .auth-team {
        font-size: 22px;
    }
    
    .auth-subtitle {
        font-size: 16px;
        flex-direction: column;
        gap: 5px;
    }
}