/* =========================================================
   1. ПЕРЕМЕННЫЕ И ШРИФТЫ
   ========================================================= */
/* =========================================================
   1. ПЕРЕМЕННЫЕ И ШРИФТЫ
   ========================================================= */
:root {
    /* --- ОСНОВНЫЕ ЦВЕТА --- */
    --c-primary: #E92820;           /* Красный */
    --c-primary-hover: #c91f19;     /* Темно-красный (hover) */
    
    --c-accent: #4376BE;            /* Синий */
    --c-accent-hover: #1d4ed8;      /* Темно-синий (hover) */
    
    --c-accent-soft: #E2F23B;       /* Желтый */
    --c-white: #FFFFFF;
    
    /* --- ЦВЕТА ТЕКСТА --- */
    --c-text-main: #1f2937;
    --c-text-muted: #64748b;        /* Заменили #556070 на более современный slate-500 */
    --c-text-dark: #0f172a;         /* Для акцентных заголовков */
    
    /* --- ЦВЕТА ФОНА --- */
    --c-bg-page: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
    --c-bg-modal: #f0ebf8;          /* Фон модального окна */
    --c-bg-light: #f1f5f9;          /* Светло-серый фон (шапки таблиц) */
    
    /* --- UI СОСТОЯНИЯ (Кнопки, ошибки, статусы) --- */
    --c-success: #16a34a;           /* Зеленый */
    --c-danger: #dc2626;            /* Красный для ошибок */
    --c-danger-bg: #fee2e2;         /* Светло-красный фон */
    --c-danger-hover: #fecaca;
    
    --c-info: #2563eb;              /* Синий для инфо/входа */
    --c-info-bg: #ebf3fe;           /* Светло-синий фон */
    --c-info-hover: #dbeafe;

    /* --- СКРУГЛЕНИЯ (Border-radius) --- */
    --radius-sm: 6px;               /* Плашки, инпуты, ячейки */
    --radius-md: 8px;               /* Мелкие кнопки, шапки таблиц */
    --radius-lg: 12px;              /* Основные кнопки */
    --radius-xl: 16px;              /* Карточки предметов, слайдер */
    --radius-2xl: 24px;             /* Большие модальные окна */

    /* --- ТЕНИ (Box-shadow) --- */
    --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 24px rgba(67, 118, 190, 0.12);   /* Бывший --shadow-soft */
    --shadow-lg: 0 16px 40px rgba(67, 118, 190, 0.22);   /* Бывший --shadow-hover */
    --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1); /* Тень для модалок */
    --shadow-btn: 0 6px 16px rgba(233, 40, 32, 0.35);    /* Акцентная тень кнопок */
    
    /* Размеры карточек предметов */
    --subject-card-width: 240px;
    --subject-card-gap: 24px;
}

@font-face {
    font-family: 'Bastion Kontrast Alt';
    src: url('fonts/BastionKontrastAlt-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   2. БАЗОВЫЕ НАСТРОЙКИ (GLOBAL)
   ========================================================= */
/* Защита от горизонтального скролла (отступы внутрь ширины) */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    width: 100%;
    /* Убрали overflow-x, чтобы починить sticky! */
}

body {
    color: var(--c-text-main);
    background: var(--c-bg-page); /* Используем переменную */
    width: 100%;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

a {
    color: var(--c-primary);
    text-decoration: none;
}

a:hover {
    color: var(--c-accent);
}

/* --- ВОЗВРАЩАЕМ ПРОПАВШИЙ ШРИФТ --- */
/* Типографика */
h1, h2, h3, h4, h5, h6, 
.navbar-brand, .brand-logo,
.s7-content h1, .subject-card span {
    font-family: 'Bastion Kontrast Alt', serif;
    font-weight: normal; 
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* =========================================================
   3. КНОПКИ
   ========================================================= */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-lg); /* Заменили 12px */
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
}

.btn-primary {
    background: var(--c-accent);
    color: var(--c-white);
    box-shadow: var(--shadow-btn); /* Заменили жесткую тень */
}

.btn-primary:hover {
    background: var(--c-primary-hover); /* Заменили #c91f19 */
    color: var(--c-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--c-accent-soft);
    color: var(--c-text-dark); /* Заменили #222 */
}
/* =========================================================
   АНИМИРОВАННЫЙ ЛОГОТИП
   ========================================================= */
.animated-logo {
    display: flex;
    align-items: center;
    font-family: 'Bastion Kontrast Alt', serif;
    font-size: 20px;
    white-space: pre; 
}

.animated-logo .logo-red {
    color: var(--c-primary);
}

.animated-logo .logo-blue {
    color: var(--c-accent);
    text-transform: uppercase;
    border-right: 2px solid var(--c-accent);
    padding-right: 4px;
    margin: 0 4px;
    animation: blink 0.75s step-end infinite;
    font-size: 28px;
}

/* Коробка-обертка держит общую ширину, чтобы шапка не прыгала */
@media (min-width: 992px) {
    .typewriter-box {
        display: inline-block;
        width: 92px; /* Сузили со 140px до идеального размера слова ВСЕГДА */
        text-align: left;
    }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--c-accent); }
}

/* =========================================================
   4. ШАПКА САЙТА (HEADER)
   ========================================================= */
.header.container-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    
    transform: none !important;
    transition: none !important; 
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    margin: 0 !important;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    height: 60px;
    margin: 0 auto;
    padding: 0 20px;
}

.desktop-menu ul {
    display: flex !important;
    align-items: center !important; /* Строго выравниваем все элементы по центру вертикали */
    gap: 30px; /* Красивое одинаковое расстояние между пунктами меню */
    margin: 0;
    padding: 0;
    list-style: none;
}

.desktop-menu li {
    display: flex;
    align-items: center; /* Выравнивание внутри самого пункта */
    margin: 0 !important; /* Убираем старые отступы, теперь за них отвечает gap */
}

.desktop-menu ul li a {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    padding: 10px 5px;
    transition: color 0.3s ease;
}

.desktop-menu ul li a:hover {
    color: var(--c-primary);
}

.auth-container {
    display: flex;
    align-items: center;
}

/* =========================================================
   5. ГЛАВНЫЙ СЛАЙДЕР (HERO)
   ========================================================= */
#s7Slider {
    position: relative;
    width: calc(100% - 40px); 
    max-width: 1160px;        
    height: 680px;
    margin: 0 auto;
    background: var(--c-white);
    border-radius: var(--radius-xl); /* Заменили 16px */
    box-shadow: var(--shadow-md);    /* Заменили --shadow-soft */
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.s7-viewport {
    height: 100%;
    overflow: hidden;
}

.s7-track {
    display: flex;
    height: 100%;
    will-change: transform;
    touch-action: pan-y;
}

.s7-slide {
    width: 100%;
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

.slide-russia { background-image: url("images/slider/slider-1.jpg"); }
.slide-history { background-image: url("images/slider/slider-2.jpg"); }
.slide-social { background-image: url("images/slider/slider-3.jpg"); }

.s7-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 60%);
    z-index: 1;
}

.s7-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: flex-start;
    height: 100%; 
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 80px; 
    box-sizing: border-box;
    text-align: left;
    pointer-events: none;
}

.s7-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 0;
    color: var(--c-primary);
}

.s7-content p {
    font-size: 1.3rem;
    color: var(--c-text-muted);
    max-width: 650px;
    margin: 24px 0 32px; 
}

.s7-actions {
    display: flex;
    gap: 20px;
    margin: 0;
    pointer-events: auto;
}

#s7Slider .s7-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    font-size: 60px;
    line-height: 1;
    color: var(--c-primary);
    text-shadow:
        -1px -1px 0 #fff, 1px -1px 0 #fff,
        -1px  1px 0 #fff, 1px  1px 0 #fff,
         0   -2px 0 #fff, 0    2px 0 #fff,
        -2px  0   0 #fff, 2px  0   0 #fff;
    opacity: 0.85;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}

#s7Slider .s7-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

#s7Slider .s7-nav.prev { left: 20px; }
#s7Slider .s7-nav.next { right: 20px; }

/* =========================================================
   6. ПРЕДМЕТЫ (ДОМАШНИЕ ЗАДАНИЯ)
   ========================================================= */
.subjects {
    padding: 20px 0 20px 0; /* Опечатка исправлена */
}

.subjects__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.subjects h2 {
    display: block !important;
    color: var(--c-accent); 
    text-align: center;     
    font-size: 36px;
    margin-bottom: 32px;
    width: 100%;            
}

.subjects__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 24px; /* Увеличили воздух между карточками (было 12px) */
    padding: 0 15px;
    max-width: 1000px; /* Сузили общий контейнер, чтобы карточки были аккуратнее */
    margin: 0 auto; /* Центрируем сетку на экране */
}

.subject-card { 
    padding: 32px 20px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border-radius: 16px; 
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    
    /* Мягкое синее свечение вместо тени */
    box-shadow: 0 0 15px rgba(67, 118, 190, 0.25) !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-6px);
    /* Красное свечение при наведении */
    box-shadow: 0 0 20px rgba(233, 40, 32, 0.4) !important;
}
}

.subject-card img {
    width: 110px;  /* Заметно увеличили иконки (было 80px) */
    height: 110px;
    margin-bottom: 16px; /* Дали больше воздуха между картинкой и текстом */
    object-fit: contain;
}

.subject-card span { 
    font-size: 22px; /* Увеличили шрифт (было 13px) */
    font-weight: 700; /* Сделали пожирнее */
    line-height: 1.3;
}

/* =========================================================
   7. МОДАЛЬНОЕ ОКНО
   ========================================================= */
.class-modal {
    position: fixed;
    inset: 0;
    z-index: 1005 !important; /* Делаем модальное окно выше, чем шапка сайта */
    display: none;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
}

.class-modal.active {
    display: flex;
}

.class-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    cursor: pointer;
}

.class-modal__container {
    position: relative;
    z-index: 2;
    width: calc(100% - 30px);
    max-width: 960px;
    height: 85vh;
    margin-bottom: 20px;
    background: var(--c-bg-modal); /* Заменили #f0ebf8 */
border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; /* Делаем круглым только верх */    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(120%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
box-shadow: var(--shadow-modal); /* Заменили жесткую тень */    touch-action: pan-x pan-y;
    will-change: transform;
}

.class-modal.active .class-modal__container {
    transform: translateY(0);
}

.class-modal__accent-bar {
    height: 10px;
    background: #673ab7;
    border-radius: 20px 20px 0 0;
}

.class-modal__header {
    background: var(--c-white);
    margin: 10px 10px 5px;
    padding: 20px;
    border-radius: var(--radius-md); /* Заменили 8px */
    border: 1px solid #dadce0;
    text-align: center;
    cursor: pointer;
    touch-action: none;
}

.class-modal__handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    margin: -10px auto 10px;
    border-radius: 2px;
}

.class-modal__title {
    font-size: 28px;
    margin: 0;
    color: #202124;
    font-weight: 400;
    text-transform: uppercase;
}

.class-modal__grid {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--c-accent) #f0f4fb;
    -webkit-overflow-scrolling: touch;
}

.class-modal__grid::-webkit-scrollbar { width: 6px; }
.class-modal__grid::-webkit-scrollbar-track { background: #f0f4fb; border-radius: 10px; }
.class-modal__grid::-webkit-scrollbar-thumb { background-color: var(--c-accent); border-radius: 10px; }

.class-card, .task-card {
width: 210px;
    background: var(--c-white);
    border-radius: var(--radius-xl); /* Заменили 18px */
    padding: 16px;
    box-shadow: var(--shadow-sm); /* Облегчили начальную тень */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #333;
    box-sizing: border-box;
    cursor: pointer;
}

/* === КАРТОЧКИ БЕЗ ТЕКСТА (ВЫБОР КЛАССОВ) === */
.class-card.no-bg-card {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important; /* Убираем белые поля, картинка растягивается на 100% */
}

/* Переносим свечение и скругление на саму картинку */
.class-card.no-bg-card .class-card__image-container {
    margin-bottom: 0 !important;
    border-radius: var(--radius-xl); 
    box-shadow: 0 0 15px rgba(233, 40, 32, 0.25) !important; /* Базовое красное свечение */
    transition: all 0.3s ease;
    height: auto !important; /* Разрешаем менять высоту */
    aspect-ratio: 3 / 4 !important; /* <--- ДЕЛАЕМ ПРЯМОУГОЛЬНИК (формат книги) */
}

/* Анимация наведения только для ПК */
@media (min-width: 992px) {
    .class-card.no-bg-card:hover {
        transform: none !important; /* Внешний прозрачный контейнер не дергаем */
        box-shadow: none !important;
    }
    
    .class-card.no-bg-card:hover .class-card__image-container {
        box-shadow: 0 0 20px rgba(67, 118, 190, 0.4) !important; /* Синее свечение */
        transform: translateY(-8px) scale(1.02);
    }
}

/* Фикс для мобилок: запрет дергания картинки */
@media (max-width: 991px) {
    .class-card.no-bg-card .class-card__image-container,
    .class-card.no-bg-card:hover .class-card__image-container,
    .class-card.no-bg-card:active .class-card__image-container {
        transform: none !important;
        box-shadow: 0 0 15px rgba(233, 40, 32, 0.25) !important;
    }
}

.class-card:hover, .task-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-md); /* Сделали ховер-тень стандартной */
}

.class-card__image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--c-accent);
    border-radius: var(--radius-lg); /* Заменили 16px на 12px для внутренностей */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.task-card .class-card__image-container {
    background: var(--c-primary);
}

.class-card__image-container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.class-card__placeholder {
    font-family: 'Bastion Kontrast Alt', serif;
    font-size: 48px;
    color: rgba(255, 255, 255, 0.4);
    z-index: 1;
}

.class-card span, .task-card__title {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-tasks {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #666;
    font-family: 'Roboto', sans-serif;
}

/* =========================================================
   ВЕДОМОСТЬ ОЦЕНОК (FONBET STYLE - ИДЕАЛЬНЫЙ ФЛАГ)
   ========================================================= */
.grades-section {
    padding: 20px 0 60px 0;
    background: transparent;
}

.grades__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.grades__inner h2 {
    font-size: 36px;
    font-family: 'Bastion Kontrast Alt', serif;
    color: var(--c-accent);
    margin-bottom: 32px !important;
    text-transform: uppercase;
    text-align: center;
}

/* === 1. КОНТЕЙНЕР ПРЕДМЕТА (ФЛАГ) === */
.fonbet-subject {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: visible !important; 
    font-family: 'Roboto', sans-serif;
    
    margin: 0 !important; 
    border-radius: 0 !important; 
}

/* ОТЛИПАНИЕ: Делаем отступ ТОЛЬКО снизу открытой таблицы */
.fonbet-subject.active {
    margin-bottom: 0 !important;
}

/* === 2. ЗАГОЛОВОК ПРЕДМЕТА === */
.fonbet-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    
    font-family: 'Bastion Kontrast Alt', serif;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    
    cursor: pointer !important;
    user-select: none;
    border-radius: 0 !important; 
    border-bottom: none !important;
}

.fonbet-header.theme-white { background: #ffffff; color: #1f2937; border-bottom: 1px solid #e5e7eb !important; }
.fonbet-header.theme-blue { background: #4376be; color: #ffffff; }
.fonbet-header.theme-red { background: #e92820; color: #ffffff; }
.fonbet-header.theme-yellow { background: #ffcc00; color: #1f2937; }


/* --- МАГИЯ СКРУГЛЕНИЙ (МОНОЛИТНЫЙ БЛОК) --- */
/* 1. Верх самого первого предмета ВСЕГДА круглый */
.fonbet-subject:first-of-type,
.fonbet-subject:first-of-type .fonbet-header {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
}

/* 2. Низ самого последнего предмета (если он закрыт) */
.fonbet-subject:last-of-type:not(.active),
.fonbet-subject:last-of-type:not(.active) .fonbet-header {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
}

/* 3. Жестко сбрасываем углы для всех блоков внутри монолита */
.fonbet-subject.active + .fonbet-subject,
.fonbet-subject.active + .fonbet-subject .fonbet-header {
    border-radius: 0 !important;
}


/* === 3. КОНТЕНТ ТАБЛИЦЫ (Плавная анимация) === */
.fonbet-subject-content {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    background: #fff;
    border-radius: 0 !important; /* Убрали скругления внутри монолита */
    box-shadow: none !important; /* Убрали тень, чтобы не было "шва" со следующей шапкой */
    transition: max-height 0.5s ease, opacity 0.3s ease, visibility 0.5s;
}

.fonbet-subject.active .fonbet-subject-content {
    max-height: 20000px; 
    opacity: 1;
    visibility: visible;
    overflow: visible !important; /* Важно для прилипания шапок с параграфами! */
    transition: max-height 0.8s ease, opacity 0.5s ease, visibility 0s;
}
/* Скругляем низ ТОЛЬКО у самой последней таблицы, если она открыта */
.fonbet-subject:last-of-type.active .fonbet-subject-content {
    border-radius: 0 0 8px 8px !important;
}

/* === 4. ВЫРАВНИВАНИЕ ТЕКСТА И ИКОНОК === */
.fonbet-header__left {
    display: flex;
    align-items: center;
}

/* ФИКСИРУЕМ ШИРИНУ ТЕКСТА, ЧТОБЫ ИКОНКИ ВСТАЛИ РОВНО */
.fonbet-header__title {
    width: 220px; 
    flex-shrink: 0;
    display: block;
}

.fonbet-header__icon {
    margin-left: 12px;
    margin-right: 0;
    width: 50px;  
    height: 0px !important; /* Нулевая высота, шапка не растягивается! */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative; 
}

.fonbet-header__icon img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    height: 60px; /* Размер картинки - можно менять! */
    width: auto;
    object-fit: contain;
    pointer-events: none; 
}

/* === 5. СТРЕЛКА === */
.fonbet-header__arrow {
    font-size: 16px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.fonbet-subject.active .fonbet-header__arrow {
    transform: rotate(180deg);
}

/* === 6. ЛИПКАЯ ШАПКА КЛАССОВ === */
.fonbet-class-header {
    position: sticky;
    top: 60px; 
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.03); 
    background: #f1f5f9;
    
    /* ВОЗВРАЩАЕМ AUTO, ЧТОБЫ ШАПКУ ТОЖЕ МОЖНО БЫЛО СКРОЛЛИТЬ ПАЛЬЦЕМ */
    overflow-x: auto !important; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.fonbet-class-header::-webkit-scrollbar { display: none; }

/* === ИСПРАВЛЕНИЯ ВЫДЕЛЕНИЯ И КУРСОРОВ === */
.fonbet-class-group, .fonbet-class-group * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    cursor: grab !important; /* Везде открытая ладонь */
}

/* СУПЕР-ПРИОРИТЕТ ДЛЯ КУЛАКА ПРИ ЗАХВАТЕ */
body.is-dragging .fonbet-class-group, 
body.is-dragging .fonbet-class-group * {
    cursor: grabbing !important;
}

.fonbet-class-group { border-bottom: 1px solid #cbd5e1; }
.fonbet-class-group:last-child { border-bottom: none; }

/* === 7. АРХИТЕКТУРА СКРОЛЛА === */
.fonbet-class-content {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden; 
    transition: max-height 0.4s ease, opacity 0.3s ease, visibility 0.4s;
}

.fonbet-class-group.active .fonbet-class-content { 
    max-height: 2500px; 
    opacity: 1;
    visibility: visible;
    overflow-x: auto !important; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    -webkit-overflow-scrolling: touch;
    transition: max-height 0.6s ease, opacity 0.4s ease, visibility 0s;
}
.fonbet-class-group.active .fonbet-class-content::-webkit-scrollbar { display: none; }

.fonbet-row {
    display: flex;
    flex-wrap: nowrap;
    border-bottom: 1px solid #e5e7eb;
    background: var(--c-white);
    transition: background-color 0.15s ease; /* Плавная смена цвета */
}

.fonbet-class-content .fonbet-row {
    width: max-content; 
    min-width: 100%;
}

/* 1. Зебра: Чередование цветов строк (каждая четная строка) */
/* Важно: мы красим и саму строку, и закрепленную ячейку с именем, иначе она останется белой */
.fonbet-class-content .fonbet-row:nth-child(even),
.fonbet-class-content .fonbet-row:nth-child(even) .fonbet-cell--name {
    background-color: #f8fafc; /* Очень светлый, почти прозрачный серо-голубой */
}

/* 2. Hover: Выделение строки при наведении мыши */
.fonbet-class-content .fonbet-row:hover,
.fonbet-class-content .fonbet-row:hover .fonbet-cell--name {
    background-color: #e2e8f0; /* Плотный светло-серый цвет для фокуса */
}

/* Исключение: Шапка класса не должна реагировать на зебру и ховер */
.fonbet-class-header,
.fonbet-class-header:hover,
.fonbet-class-header .fonbet-cell--name,
.fonbet-class-header:hover .fonbet-cell--name {
    background-color: var(--c-bg-light) !important; 
}
.fonbet-class-header .fonbet-cell--name,
.fonbet-class-header .fonbet-cell--name * {
    cursor: pointer !important;
}

/* === АНИМАЦИЯ ПЕСОЧНЫХ ЧАСОВ === */
@keyframes flipHourglass {
    0%, 20% { transform: rotate(0deg); }
    80%, 100% { transform: rotate(180deg); }
}
.hourglass-spin {
    display: inline-block;
    animation: flipHourglass 1.5s ease-in-out infinite;
}

/* === 8. ЯЧЕЙКИ === */
.fonbet-cell--name {
    flex: 0 0 115px !important; /* Сузили со 140px до 115px */
    min-width: 115px !important;
    max-width: 115px !important; /* Жестко запрещаем расти шире! */
    display: flex;
    align-items: center;
    padding: 8px 12px; /* Чуть уменьшили боковые отступы */
    font-weight: 500;
    font-size: 14px;
    color: #334155;
    position: sticky;
    left: 0;
    z-index: 5;
    background: #fff;
    border-right: 2px solid #cbd5e1;
    
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    overflow: hidden; /* Скрываем все, что пытается вылезти */
}

.fonbet-class-header .fonbet-cell--name { background: #f1f5f9; z-index: 15 !important; }

.fonbet-row:not(.fonbet-class-header),
.fonbet-row:not(.fonbet-class-header) * {
    cursor: grab !important; /* Показывает, что строку можно схватить и тащить */
}
.fonbet-match-info { display: flex; flex-direction: column; }
.fonbet-class-name { 
    font-weight: 700; 
    color: #0f172a; 
    white-space: nowrap; /* Не даем переноситься */
}

.fonbet-arrow {
    color: #94a3b8;
    font-size: 22px;
    margin-right: 14px;
    transition: transform 0.3s ease;
}
.fonbet-class-group.active .fonbet-arrow {
    transform: rotate(90deg);
    color: var(--c-accent);
}

.fonbet-cell, .fonbet-cell-stacked {
    flex: 0 0 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    border-right: 1px solid #e5e7eb;
}
.fonbet-cell:last-child, .fonbet-cell-stacked:last-child { border-right: none; }

.fonbet-stacked-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55px;
}

.fonbet-odd {
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    cursor: default;
    user-select: none;
}

.fonbet-odd.good { color: #16a34a; }
.fonbet-odd.total { background: #f8fafc; border-color: #cbd5e1; }
.fonbet-odd.total-main { background: #e2e8f0; border-color: #94a3b8; color: #0f172a; }

/* Красные пустые ячейки */
.fonbet-odd.empty-cell {
    background: #f8fafc !important;     /* Светло-серый фон */
    color: #94a3b8 !important;         /* Приглушенный цвет тире */
    border-color: #e2e8f0 !important;  /* Мягкая рамка */
}

.fonbet-empty-state {
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    background: #f8fafc;
}

/* =========================================================
   8. АДАПТИВНОСТЬ (MOBILE & TABLET)
   ========================================================= */

/* Правильное выравнивание иконок входа/выхода в меню */
.nav-login-btn, 
.nav-logout-btn {
    display: inline-flex; /* Убрали !important, чтобы кнопки могли скрываться */
    align-items: center;
    gap: 6px; /* Расстояние между иконкой и текстом */
}

/* Точная подгонка иконки по высоте текста */
.nav-login-btn svg, 
.nav-logout-btn svg {
    margin-top: -2px; /* Сдвигаем иконку чуть вверх, чтобы она стала по центру букв */
}

/* === КНОПКИ АВТОРИЗАЦИИ В МЕНЮ === */
.nav-login-btn, .nav-logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md); /* Заменили 8px */
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-login-btn {
    background-color: var(--c-info-bg);
    color: var(--c-info) !important;
}

.nav-login-btn:hover {
    background-color: var(--c-info-hover);
    transform: translateY(-2px);
}

.nav-logout-btn {
    background-color: var(--c-danger-bg);
    color: var(--c-danger) !important;
}

.nav-logout-btn:hover {
    background-color: var(--c-danger-hover);
}

/* === МОДАЛЬНОЕ ОКНО === */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); /* Красивое размытие */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
	align-items: flex-start !important;
    padding-top: 10vh; /* Сдвигаем форму в верхнюю часть экрана */
    overflow-y: auto;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-box {
background: var(--c-white);
    padding: 32px;
    border-radius: var(--radius-xl); /* Заменили 16px */
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-modal); /* Заменили длинную тень */
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.auth-overlay.active .auth-box {
    transform: translateY(0);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.auth-close:hover {
    color: #0f172a;
}

.auth-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1e293b;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.auth-input-group {
border-radius: var(--radius-md); /* Заменили 8px */}

.auth-input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.auth-input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-error {
    color: #dc2626;
    font-size: 14px;
    /* Центрируем текст по вертикали и горизонтали */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px; /* Фиксированная высота удерживает баланс */
    margin: 5px 0 15px 0; /* Равномерные отступы */
    text-align: center;
}

.auth-submit {
    width: 100%;
    background-color: var(--c-info);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md); /* Заменили 8px */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-submit:hover {
    background-color: var(--c-accent-hover); /* Заменили #1d4ed8 */
}

.auth-submit:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

/* === ЕДИНОЕ СВЕЧЕНИЕ ДЛЯ ВСЕХ КАРТОЧЕК === */
.subject-card, .class-card, .task-card {
    background: #fff !important; /* Обязательно белый фон */
    box-shadow: 0 0 15px rgba(233, 40, 32, 0.25) !important; /* Базовое КРАСНОЕ свечение */
    transition: box-shadow 0.3s ease, transform 0.3s ease !important;
}

.subject-card:hover, .class-card:hover, .task-card:hover {
    box-shadow: 0 0 20px rgba(67, 118, 190, 0.4) !important; /* СИНЕЕ свечение при наведении */
}

@media (max-width: 991px) {
    
    /* === УБИРАЕМ ЛИШНИЕ ОТСТУПЫ ПО БОКАМ === */
    .grades__inner, .subjects__inner, .header-inner {
        padding: 0 8px !important;
    }

    /* === ШАПКА И МЕНЮ (НОВЫЙ ДИЗАЙН ИЗ ПРЕДЫДУЩЕГО ШАГА) === */
    header.header.container-header {
        display: block !important;
        position: sticky !important;
        padding: 5px 0 !important;
    }

    .desktop-menu {
        display: none !important;
    }

    .header-inner {
        padding: 0 15px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .mobile-search-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--c-text-main);
        padding: 8px 0;
        cursor: pointer;
        width: 40px;
    }

    .navbar-brand {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    /* === МОБИЛЬНЫЙ ЛОГОТИП === */
    .animated-logo {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .logo-part-1 {
        font-size: 11px;
        letter-spacing: 2px;
        color: var(--c-text-main);
        margin-bottom: 2px;
    }

    .logo-part-2 {
        display: block;
        min-height: 30px;
        width: auto !important; /* Убиваем ширину коробки от ПК-версии */
        text-align: center;
    }

    /* Обращаемся именно к тексту внутри коробки */
    .logo-part-2 #typewriter {
        font-size: 26px !important;
        border-right: none !important; /* Скрываем курсор, чтобы ВЕЗДЕ встало ровно по центру */
        margin: 0 !important;
        padding: 0 !important;
    }

    .logo-part-3 {
        display: none !important; /* Скрываем хвост фразы */
    }

    .auth-text {
        display: none !important;
    }

    .nav-login-btn, .nav-logout-btn {
        padding: 8px;
        width: 40px;
        height: 40px;
        justify-content: center;
        background: transparent !important;
    }

    .nav-login-btn { color: var(--c-text-main) !important; }
    .nav-logout-btn { color: var(--c-primary) !important; }

    /* === СЛАЙДЕР === */
    #s7Slider {
        width: 100% !important;
        max-width: 100% !important;
        height: 400px;
        border-radius: 0;
        margin: 0 !important;
    }
    
    .s7-content { padding: 0 40px; }
    .s7-content h1 { font-size: 2rem; }
    .s7-actions { width: 100%; }
    .slide-russia { background-position: right center !important; }
    #s7Slider .s7-nav { display: none !important; }

    /* === МОДАЛЬНОЕ ОКНО === */
    .class-modal { padding: 0 !important; box-sizing: border-box; }
    
    .class-modal__container {
        width: 100%;
        max-width: 520px;
        /* Шапка 60px, значит высота модалки: 100% динамического экрана минус 60px */
        height: calc(100dvh - 60px); 
        max-height: calc(100dvh - 60px);
        margin-bottom: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0; 
        padding-bottom: 0;
    }

    .class-modal__grid {
        gap: 15px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .class-card, .task-card {
        width: calc(50% - 7.5px); 
        max-width: none; 
        padding: 12px;
        border-radius: var(--radius-xl); 
        box-sizing: border-box;
    }

    .class-card span, .task-card__title { font-size: 13px; }
    .class-card:hover, .task-card:hover { transform: none; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
    .class-modal__header, .class-modal__title {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    /* === СЕТКА ПРЕДМЕТОВ НА ГЛАВНОЙ СТРАНИЦЕ === */
    .subjects h2 {
        font-size: 28px;
        margin-bottom: 24px;
        padding: 0 15px; 
    }

    .subjects__grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 12px; 
        padding: 0 10px;
    }
    
    .subject-card {
        padding: 20px 10px; 
        border-radius: var(--radius-lg); 
    }

    .subject-card img {
        width: 75px;  
        height: 75px;
        margin-bottom: 12px;
    }
    
    .subject-card span { font-size: 13px; }
    
    /* === МОБИЛЬНЫЕ КАРТОЧКИ: ЗАПРЕТ ХОВЕРОВ И МЕНЮ === */
    .subject-card, .class-card, .task-card {
        -webkit-touch-callout: none !important; /* Запрещаем всплывающее меню (iOS) */
        user-select: none !important;           /* Запрещаем выделение текста */
    }

    .subject-card:hover, .subject-card:active, .subject-card:focus,
    .class-card:hover,   .class-card:active,   .class-card:focus,
    .task-card:hover,    .task-card:active,    .task-card:focus,
    .hover-effect:hover, .hover-effect:active, .hover-effect:focus {
        transform: none !important; /* Запрещаем подпрыгивание */
        box-shadow: 0 0 15px rgba(233, 40, 32, 0.25) !important; /* Жестко держим базовое красное свечение */
    }

    /* =========================================
       МОБИЛЬНАЯ АДАПТАЦИЯ ТАБЛИЦЫ ОЦЕНОК
       ========================================= */
       
    /* 1. Плавный инерционный скролл для сенсорных экранов */
    .fonbet-row {
        -webkit-overflow-scrolling: touch;
    }

    /* 2. Шапка класса липнет к самому верху */
    .fonbet-class-header {
        top: 50px !important; 
    }

    /* 3. Сужаем закрепленную колонку с именами (чтобы оставить место для оценок) */
    .fonbet-cell--name {
        flex: 0 0 95px !important; /* Ужали со 100px до 95px */
        min-width: 95px !important;
        max-width: 95px !important;
        padding: 8px 6px;
        font-size: 12px; 
    }

    /* 4. Уменьшаем ширину колонок с параграфами */
    .fonbet-cell, .fonbet-cell-stacked {
        flex: 0 0 46px; 
    }

    /* 5. Уменьшаем сами квадратики с оценками */
    .fonbet-odd {
        width: 34px;
        height: 34px;
        font-size: 12px;
        border-radius: 4px;
    }

    /* 6. Уменьшаем подписи параграфов в шапке */
    .fonbet-stacked-label {
        font-size: 9px;
        max-width: 40px;
        margin-bottom: 4px;
    }

    /* 7. Адаптируем заголовок предмета и иконку */
    .fonbet-header {
        padding: 12px 10px !important; 
    }

    .fonbet-header__title {
        width: 190px !important; 
        flex: none !important;   
        font-size: 16px !important; 
        line-height: 1.2;
    }
    
    .fonbet-header__icon {
        width: 40px !important;
    }
    
    .fonbet-header__icon img {
        height: 40px !important;
    }
}