/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --primary: #3b82f6;       /* Яркий синий */
    --accent: #06b6d4;        /* Циан/Голубой */
    --bg-dark: #0f172a;       /* Основной фон (очень темный синий) */
    --card-bg: rgba(30, 41, 59, 0.7); /* Полупрозрачный фон карточек */
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

h1, h2, h3, h4, h5 {
    color: #fff !important;
}

/* --- ОСНОВНЫЕ СТИЛИ --- */
html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 80px; /* Отступ под хедер */
    margin: 0;
}

/* Фон с картинкой и затемнением */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('img/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9); /* Сильное затемнение фона для читаемости */
    backdrop-filter: blur(5px);
    z-index: -1;
}

main { flex: 1; }

a { text-decoration: none; transition: var(--transition); }
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #fff;
}

/* --- ХЕДЕР --- */
header {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#project-name {
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(to right, #60a5fa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
    margin: 0;
}

/* Кнопки навигации */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.dropdown-menu {
    background: #1e293b;
    border: 1px solid var(--card-border);
}
.dropdown-item { color: var(--text-main); }
.dropdown-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* --- СПИСОК УРОВНЕЙ (СТОЛБИК) --- */
.level-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
}

.level-card {
    display: flex;
    flex-direction: row; /* Горизонтально на ПК */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    align-items: stretch;
}

.level-card:hover {
    transform: translateX(8px); /* Сдвиг вправо при наведении */
    border-color: var(--accent);
    box-shadow: var(--shadow);
    background: rgba(30, 41, 59, 0.9);
}

.level-img {
    width: 240px;
    min-width: 240px;
    position: relative;
    overflow: hidden;
}

.level-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет блок без искажений */
    transition: transform 0.5s ease;
}

.level-card:hover .level-img img { transform: scale(1.1); }

.level-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.level-title h5 {
    font-size: 1.25rem;
    margin: 0;
    line-height: 1.2;
}

.level-details {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.6;
}

.level-details strong { color: #e2e8f0; }

/* --- ОБЩИЕ КОНТЕЙНЕРЫ (Profile, Detail, Leaderboard) --- */
.detail-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-top: 20px;
    margin-bottom: 40px;
}

/* --- ТАБЛИЦЫ --- */
.table {
    color: var(--text-main);
    border-collapse: separate;
    border-spacing: 0 8px; /* Отступы между строками */
}

.table thead th {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr td {
    border: none;
    vertical-align: middle;
    padding: 12px 15px;
}

/* Закругление строк таблицы */
.table tbody tr td:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.table tbody tr td:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.01);
}

/* --- ПРОФИЛЬ ИГРОКА --- */
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    height: 100%;
}
.stat-card h3 { margin: 5px 0 0; }
.stat-card span { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* --- ВИДЕО --- */
.video-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* --- АДАПТИВНОСТЬ (MOBILE) --- */
@media (max-width: 768px) {
    body { padding-top: 100px; }

    .level-list { padding: 0 15px; }

    .level-card {
        flex-direction: column; /* Вертикально на мобилках */
    }

    .level-img {
        width: 100%;
        height: 180px; /* Фиксированная высота картинки */
    }

    .level-info { padding: 15px; }

    .level-header {
        flex-direction: column;
        gap: 5px;
    }

    .level-card:hover { transform: translateY(-5px); }

    /* Хедер */
    #project-name { font-size: 1rem; text-align: center; width: 100%; display: block; margin-bottom: 10px; }
    header .d-flex { flex-wrap: wrap; justify-content: center; }
}