:root {
    --bg-dark: #0a0f1f;
    --card-bg: rgba(18, 25, 45, 0.75);
    --primary: #3b82f6;
    --primary-glow: #3b82f6;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(59,130,246,0.2);
    --danger: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif; background: var(--bg-dark); color: var(--text); line-height: 1.5; overflow-x: hidden; position: relative; margin: 0;
}

/* Анимированные звёзды */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(2px 2px at 20% 30%, #fff, rgba(0,0,0,0)), radial-gradient(1px 1px at 60% 70%, #fff, rgba(0,0,0,0));
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: 0.3;
    z-index: -1;
    animation: starsMove 60s linear infinite;
}

@keyframes starsMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 200px 200px;
    }
}

/* Стеклянная навигация */
.glass-nav {
    background: rgba(10, 15, 31, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

    .logo i {
        color: var(--primary);
        margin-right: 8px;
    }

.nav-links a {
    color: var(--text);
    text-decoration: none;
    margin: 0 1rem;
    transition: 0.3s;
    font-weight: 500;
}

    .nav-links a:hover {
        color: var(--primary);
        text-shadow: 0 0 5px var(--primary-glow);
    }

.btn-outline-light {
    background: transparent;
    border: 1px solid var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    color: var(--primary);
    cursor: pointer;
    transition: 0.3s;
}

    .btn-outline-light:hover {
        background: var(--primary);
        color: white;
        box-shadow: 0 0 12px var(--primary);
    }

.connected {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Карточки */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 35px -12px rgba(0,0,0,0.5);
    }

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 0.75rem 1.8rem;
    border-radius: 2rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

    .btn-primary:hover {
        transform: scale(1.02);
        box-shadow: 0 0 15px var(--primary);
    }

/* Поля ввода */
input, select {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.6rem 1rem;
    color: var(--text);
    margin: 0.3rem;
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}

    input:focus, select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 8px var(--primary);
    }

    /* Слайдер */
    input[type="range"] {
        width: 200px;
        background: var(--border);
    }

/* Параметры */
.params {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 1.2rem;
    padding: 1rem;
    margin: 1rem 0;
}

/* История – сетка карточек */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.history-item {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1rem;
    border-left: 4px solid var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Адаптив */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links a {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }

    .params {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Анимация загрузки */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.task-description {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59,130,246,0.1);
    border-radius: 0.8rem;
    border-left: 4px solid var(--primary);
}
.task-description h4, .task-description h5 {
    margin-bottom: 0.5rem;
}
.task-description ul {
    margin-left: 1.5rem;
}
.task-description li {
    margin-bottom: 0.3rem;
}
/* Дополнительные стили для описаний и помощи */
.task-description {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59,130,246,0.1);
    border-radius: 0.8rem;
    border-left: 4px solid var(--primary);
}
.task-description h4, .task-description h5 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}
.task-description ul {
    margin-left: 1.5rem;
}
.task-description li {
    margin-bottom: 0.3rem;
}
.help-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}
.help-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.help-section h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.help-section code {
    background: rgba(0,0,0,0.4);
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-family: monospace;
}