/* Стили из base.html - ОПТИМИЗИРОВАННАЯ ВЕРСИЯ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('/templates/img/img1.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Изменено с fixed для улучшения производительности */
    background-repeat: no-repeat;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    padding-top: 20px;
}

.game-title {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.btn-custom {
    background: linear-gradient(45deg, #4b6cb7, #182848);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: white;
}

.footer {
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

/* ===== УЛУЧШЕННЫЕ СТИЛИ МОДАЛЬНОГО ОКНА РЕЖИМА ИИ - ОПТИМИЗИРОВАННЫЕ ===== */

    /* backdrop-filter: blur(10px); Удалено для улучшения производительности */


.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.85);
}

.ai-difficulty-modal {
    background:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('/templates/img/20251002_1414_Красивая шашка доска_simple_compose_01k6j365vhfxdbetg899pfdpsj.png');
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(139, 69, 19, 0.6);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(139, 69, 19, 0.3);
    overflow: hidden;
    /* animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); Удалено для улучшения производительности */
    max-width: 90vw;
    max-height: 90vh;
}

/* Анимации модального окна закомментированы для улучшения производительности */
/*
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal.fade-out .modal-content {
    animation: modalFadeOut 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}
*/

.ai-difficulty-modal .modal-header {
    border-bottom: 2px solid rgba(139, 69, 19, 0.4);
    padding: 1.8rem 2rem;
    background: linear-gradient(90deg, rgba(139, 69, 19, 0.3), rgba(160, 82, 45, 0.4), rgba(139, 69, 19, 0.3));
    backdrop-filter: blur(5px);
}

.ai-difficulty-modal .modal-title {
    font-family: 'Georgia', serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #ffffff;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(139, 69, 19, 0.6);
    letter-spacing: 0.8px;
}

.ai-difficulty-modal .modal-body {
    padding: 2.5rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(3px);
}

.ai-difficulty-modal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: all 0.3s ease;
    background-color: rgba(139, 69, 19, 0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
}

.ai-difficulty-modal .btn-close:hover {
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
    background-color: rgba(205, 133, 63, 0.7);
}

/* Кнопки выбора сложности и цвета - ОПТИМИЗИРОВАННЫЕ */
.difficulty-button, .color-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-radius: 18px;
    padding: 32px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease; /* Упрощено для улучшения производительности */
    border: 2.5px solid rgba(139, 69, 19, 0.4);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* backdrop-filter: blur(8px); Удалено для улучшения производительности */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Удалены сложные анимации для улучшения производительности */
/*
.difficulty-button::before, .color-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.7s ease;
}

.difficulty-button:hover::before, .color-button:hover::before {
    transform: translateX(100%);
}
*/

.difficulty-button:hover, .color-button:hover {
    transform: translateY(-5px) scale(1.01); /* Упрощено для улучшения производительности */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5); /* Упрощено для улучшения производительности */
    border-color: rgba(205, 133, 63, 0.6);
}

.difficulty-button:active, .color-button:active {
    transform: translateY(-2px) scale(1.005); /* Упрощено для улучшения производительности */
    transition: all 0.1s ease;
}

/* Иконки */
.difficulty-icon {
    font-size: 4.2rem;
    margin-bottom: 18px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(139, 69, 19, 0.3);
    overflow: hidden;
}

.difficulty-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.difficulty-button:hover .difficulty-icon, .color-button:hover .checker-option {
    transform: scale(1.12);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Заголовки и описания */
.difficulty-title, .color-title {
    color: #ffffff;
    font-family: 'Georgia', serif;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 8px rgba(139, 69, 19, 0.4);
    letter-spacing: 0.6px;
}

.difficulty-description, .color-description {
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Уровни сложности - ОПТИМИЗИРОВАННЫЕ */

/* Легкий уровень - светлый */
.difficulty-button.easy {
    border-color: #90EE90;
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.3), rgba(127, 255, 0, 0.4));
    box-shadow: 0 8px 20px rgba(144, 238, 144, 0.2);
}

.difficulty-button.easy:hover {
    transform: translateY(-5px) scale(1.01); /* Упрощено для улучшения производительности */
    border-color: #7FFF00;
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.4), rgba(127, 255, 0, 0.3));
    box-shadow: 0 12px 25px rgba(144, 238, 144, 0.4); /* Упрощено для улучшения производительности */
}

.difficulty-button.easy .difficulty-icon {
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.5), rgba(127, 255, 0, 0.4));
    box-shadow: 0 5px 15px rgba(144, 238, 144, 0.4);
    /* animation: easyPulse 3s infinite alternate; Удалено для улучшения производительности */
}

.difficulty-button.easy:hover .difficulty-icon {
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.6), rgba(127, 255, 0, 0.5));
    box-shadow: 0 6px 18px rgba(144, 238, 144, 0.5);
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes easyPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(144, 238, 144, 0.4);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(144, 238, 144, 0.6);
    }
}
*/

/* Средний уровень */
.difficulty-button.medium {
    border-color: #87CEEB;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.3), rgba(144, 238, 144, 0.3));
    box-shadow: 0 8px 20px rgba(135, 206, 235, 0.2);
}

.difficulty-button.medium:hover {
    transform: translateY(-5px) scale(1.01); /* Упрощено для улучшения производительности */
    border-color: #4682B4;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.4), rgba(144, 238, 144, 0.4));
    box-shadow: 0 12px 25px rgba(135, 206, 235, 0.3); /* Упрощено для улучшения производительности */
    /* animation: mediumRock 0.8s ease-in-out infinite; Удалено для улучшения производительности */
}

.difficulty-button.medium .difficulty-icon {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.5), rgba(144, 238, 144, 0.5));
    box-shadow: 0 5px 15px rgba(135, 206, 235, 0.4);
    /* animation: mediumGlow 4s infinite alternate; Удалено для улучшения производительности */
}

.difficulty-button.medium:hover .difficulty-icon {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.6), rgba(144, 238, 144, 0.6));
    box-shadow: 0 6px 18px rgba(135, 206, 235, 0.5);
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes mediumGlow {
    0% {
        box-shadow: 0 5px 15px rgba(135, 206, 235, 0.4);
    }
    100% {
        box-shadow: 0 8px 25px rgba(135, 206, 235, 0.6);
    }
}

@keyframes mediumRock {
    0% {
        transform: translateY(-10px) scale(1.03) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) scale(1.03) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) scale(1.03) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) scale(1.03) rotate(-2deg);
    }
    100% {
        transform: translateY(-10px) scale(1.03) rotate(0deg);
    }
}
*/

/* Сложный уровень */
.difficulty-button.hard {
    border-color: #8B0000;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.4), rgba(220, 20, 60, 0.6));
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.4);
}

.difficulty-button.hard:hover {
    transform: translateY(-5px) scale(1.01); /* Упрощено для улучшения производительности */
    border-color: #DC143C;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.5), rgba(220, 20, 60, 0.6));
    box-shadow: 0 12px 25px rgba(139, 0, 0, 0.5); /* Упрощено для улучшения производительности */
}

.difficulty-button.hard .difficulty-icon {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.7), rgba(220, 20, 60, 0.6));
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.5);
    /* animation: hardShadow 2s infinite alternate; Удалено для улучшения производительности */
}

.difficulty-button.hard:hover .difficulty-icon {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8), rgba(220, 20, 60, 0.7));
    box-shadow: 0 6px 18px rgba(139, 0, 0, 0.6);
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes hardShadow {
    0% {
        filter: blur(0.5px);
        box-shadow: 0 5px 15px rgba(139, 0, 0, 0.5), 0 0 10px rgba(139, 0, 0, 0.3);
    }
    100% {
        filter: blur(0px);
        box-shadow: 0 8px 25px rgba(139, 0, 0, 0.7), 0 0 20px rgba(139, 0, 0, 0.5), 0 0 30px rgba(220, 20, 60, 0.2);
    }
}
*/

/* Стили для выбора цвета */
.checker-option {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.checker-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.color-button:hover .checker-img {
    transform: scale(1.12);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

/* Белый цвет - изображение белой шашки на светлом фоне */
.color-button.white {
    border-color: #F5F5DC;
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.4), rgba(255, 255, 255, 0.3));
    box-shadow: 0 8px 20px rgba(245, 245, 220, 0.3);
}

.color-button.white:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: #FAEBD7;
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.6), rgba(255, 255, 255, 0.5));
    box-shadow: 0 18px 35px rgba(245, 245, 220, 0.5);
}

.color-button.white .checker-option {
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.7), rgba(255, 255, 255, 0.6));
    box-shadow: 0 5px 15px rgba(245, 245, 220, 0.4);
    border: 2px solid rgba(245, 245, 220, 0.5);
    animation: whiteGlow 3s infinite alternate;
}

.color-button.white:hover .checker-option {
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.9), rgba(255, 255, 255, 0.8));
    box-shadow: 0 8px 20px rgba(245, 245, 220, 0.6);
}

@keyframes whiteGlow {
    0% {
        box-shadow: 0 5px 15px rgba(245, 245, 220, 0.4);
    }
    100% {
        box-shadow: 0 8px 25px rgba(245, 245, 220, 0.6);
    }
}

/* Черный цвет - изображение черной шашки на тёмном фоне */
.color-button.black {
    border-color: #2F4F4F;
    background: linear-gradient(135deg, rgba(47, 79, 79, 0.4), rgba(0, 0, 0, 0.3));
    box-shadow: 0 8px 20px rgba(47, 79, 79, 0.4);
}

.color-button.black:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: #1C1C1C;
    background: linear-gradient(135deg, rgba(47, 79, 79, 0.6), rgba(0, 0, 0, 0.5));
    box-shadow: 0 18px 35px rgba(47, 79, 79, 0.6);
}

.color-button.black .checker-option {
    background: linear-gradient(135deg, rgba(47, 79, 79, 0.7), rgba(0, 0, 0, 0.6));
    box-shadow: 0 5px 15px rgba(47, 79, 79, 0.5);
    border: 2px solid rgba(47, 79, 79, 0.6);
    animation: blackGlow 3s infinite alternate;
}

.color-button.black:hover .checker-option {
    background: linear-gradient(135deg, rgba(47, 79, 79, 0.9), rgba(0, 0, 0, 0.8));
    box-shadow: 0 8px 20px rgba(47, 79, 79, 0.7);
}

@keyframes blackGlow {
    0% {
        box-shadow: 0 5px 15px rgba(47, 79, 79, 0.5);
    }
    100% {
        box-shadow: 0 8px 25px rgba(47, 79, 79, 0.7);
    }
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}
*/

/* Выбранные кнопки - ОПТИМИЗИРОВАННЫЕ */
.difficulty-button.selected, .color-button.selected {
    transform: translateY(-5px) scale(1.01); /* Упрощено для улучшения производительности */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5); /* Упрощено для улучшения производительности */
    border-width: 3px;
    border-color: rgba(205, 133, 63, 0.8);
    /* animation: selectedPulse 2s infinite alternate; Удалено для улучшения производительности */
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes selectedPulse {
    0% {
        box-shadow: 0 18px 35px rgba(0, 0, 0, 0.6);
    }
    100% {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    }
}
*/

.difficulty-button.selected::after, .color-button.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    /* animation: checkmarkAppear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); Удалено для улучшения производительности */
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.6);
    color: white;
    font-weight: bold;
    font-size: 20px;
    line-height: 38px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes checkmarkAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(90deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}
*/

/* Улучшенные стили для кнопок навигации модального окна - ОПТИМИЗИРОВАННЫЕ */
.btn-primary, .btn-secondary {
    font-family: 'Georgia', serif;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 25px;
    border: none;
    transition: all 0.2s ease; /* Упрощено для улучшения производительности */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(160, 82, 45, 0.7));
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.9), rgba(160, 82, 45, 0.8));
    transform: translateY(-2px); /* Упрощено для улучшения производительности */
    box-shadow: 0 6px 18px rgba(139, 69, 19, 0.3); /* Упрощено для улучшения производительности */
    color: white;
}

.btn-primary:disabled {
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.5), rgba(105, 105, 105, 0.4));
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.8), rgba(73, 80, 87, 0.7));
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.9), rgba(73, 80, 87, 0.8));
    transform: translateY(-2px); /* Упрощено для улучшения производительности */
    box-shadow: 0 6px 18px rgba(108, 117, 125, 0.3); /* Упрощено для улучшения производительности */
    color: white;
}

/* Удалены сложные анимации для улучшения производительности */
/*
.btn-primary::before, .btn-secondary::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;
}

.btn-primary:hover::before, .btn-secondary:hover::before {
    left: 100%;
}
*/

/* Улучшенные стили для заголовков шагов */
#difficulty-step h5, #color-step h5 {
    font-family: 'Georgia', serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(139, 69, 19, 0.4);
    margin-bottom: 2rem;
    letter-spacing: 0.8px;
    position: relative;
    display: inline-block;
}

#difficulty-step h5::after, #color-step h5::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(205, 133, 63, 0.8), transparent);
    border-radius: 2px;
    animation: titleGlow 3s infinite alternate;
}

@keyframes titleGlow {
    0% {
        opacity: 0.7;
        width: 60px;
    }
    100% {
        opacity: 1;
        width: 100px;
    }
}

/* Дополнительные эффекты для создания гармоничного вида */
.modal-content {
    border: none;
    background: transparent;
}

.modal-dialog {
    max-width: 800px;
}

/* Улучшенная адаптивность для сохранения гармонии на всех устройствах */
@media (max-width: 991.98px) {
    .modal-dialog {
        max-width: 700px;
    }
}

@media (max-width: 767.98px) {
    .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    #difficulty-step h5, #color-step h5 {
        font-size: 1.4rem;
    }
}

@media (max-width: 575.98px) {
    .btn-primary, .btn-secondary {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin: 5px;
    }
    
    #difficulty-step h5, #color-step h5 {
        font-size: 1.2rem;
    }
}

/* ===== СТИЛИ ИГРЫ (НЕ ТРОГАТЬ) ===== */
.game-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.players-info-container {
    width: 300px;
}

.game-info {
    width: 100%;
    margin-bottom: 20px;
}

.game-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-info {
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-white {
    background-color: #f8f9fa;
    border-left: 5px solid #6c757d;
}

.player-black {
    background-color: #343a40;
    color: white;
    border-left: 5px solid #6c757d;
}

.current-turn {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.player-status {
    font-weight: bold;
}

.player-you {
    color: #28a745;
}

.player-opponent {
    color: #dc3545;
}

.player-waiting {
    color: #6c757d;
}

.game-controls-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.game-status-center {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.game-controls-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.game-controls-left .btn-custom,
.game-controls-right .btn-custom {
    height: 38px;
    padding: 0 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 120px;
}

.game-controls-left .btn-custom {
    margin-left: 10px;
}

.game-controls-left .btn-custom:first-child {
    margin-left: 0;
    background: linear-gradient(45deg, #28a745, #20c997);
}

.game-controls-left .btn-custom:first-child:hover {
    background: linear-gradient(45deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.3);
}

.game-controls-right .btn-custom {
    margin-right: 10px;
}

.current-turn-info {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    width: 480px;
    height: 480px;
    background-image: url('/templates/img/img2.png');
    background-size: cover;
    background-repeat: no-repeat;
    margin-bottom: 20px;
    position: relative;
}

.board-cell {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.cell-white {
    background-color: transparent;
}

.cell-black {
    background-color: transparent;
}

.current-player-hint {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border: 3px solid #4CAF50;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
    pointer-events: none;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

.selected-hint {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border: 3px solid #FFC107;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
    pointer-events: none;
    opacity: 0.9;
}

.possible-move {
    position: absolute;
    top: 9px;
    left: 9px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(76, 175, 80, 0.5);
    pointer-events: none;
    animation: blink 1.5s infinite;
}

.possible-capture {
    position: absolute;
    top: 9px;
    left: 9px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(244, 67, 54, 0.5);
    pointer-events: none;
    animation: blink 1s infinite;
}

.checker-hover {
    transform: scale(1.1);
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
    transition: all 0.3s ease;
}

.checker {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.checker:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
}

/* Анимации шашек - ОПТИМИЗИРОВАННЫЕ */

/* Анимации удалены или упрощены для улучшения производительности */
/*
@keyframes moveChecker {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
*/

.checker-moving {
    /* animation: moveChecker 0.5s ease-in-out; Удалено для улучшения производительности */
    transform: scale(1.1); /* Простая альтернатива */
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes captureChecker {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}
*/

.checker-captured {
    /* animation: captureChecker 0.5s ease-in-out; Удалено для улучшения производительности */
    opacity: 0.5; /* Простая альтернатива */
}

/* Анимации удалены для улучшения производительности */
/*
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}
*/

@keyframes blink {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.5;
    }
}

.checker-white {
    background-image: url('/templates/img/white-checker.png');
}

.checker-black {
    background-image: url('/templates/img/black-checker.png');
}

.checker-king::after {
    content: '♔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: gold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.chat-container {
    width: 300px;
    height: 400px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 80%;
}

.chat-message-white {
    background-color: #e9ecef;
    align-self: flex-start;
}

.chat-message-black {
    background-color: #343a40;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.chat-message-ai {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2196f3 !important;
    color: #0d47a1 !important;
    align-self: flex-start;
}

.chat-message-ai strong {
    color: #1976d2 !important;
}

.ai-typing {
    font-style: italic;
    opacity: 0.8;
}

/* Анимация печатающих точек упрощена для улучшения производительности */
.typing-dots span {
    display: inline-block;
    /* animation: typing 1.4s infinite; Удалено для улучшения производительности */
}


.typing-dots span:nth-child(3) {
    /* animation-delay: 0.4s; Удалено для улучшения производительности */
    display: inline-block;
}

/* Анимация удалена для улучшения производительности */
/*
@keyframes typing {
    0% {
        opacity: 0.2;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}
*/

.chat-input-container {
    display: flex;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
}

.chat-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 10px;
}

.invite-link-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    max-width: 480px;
}

.invite-link {
    word-break: break-all;
    color: #007bff;
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.hidden {
    display: none;
}

.step-hidden {
    display: none;
}

.text-area-fixed {
    top: 0;
    left: 0;
    position: fixed;
}

.text-green {
    color: #28a745;
}

.text-gray {
    color: #6c757d;
}

.text-red {
    color: #dc3545;
}

.step-fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s ease;
}

.step-fade-in-up {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.step-fade-in-down {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.step-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.checker-animation {
    animation: moveChecker 0.5s ease-in-out;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 767.98px) {
    .ai-difficulty-modal {
        border-radius: 18px;
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .ai-difficulty-modal .modal-header {
        padding: 1.4rem 1.5rem;
    }
    
    .ai-difficulty-modal .modal-title {
        font-size: 1.5rem;
    }
    
    .ai-difficulty-modal .modal-body {
        padding: 1.8rem 1.5rem;
    }
    
    .difficulty-icon, .checker-option {
        width: 85px;
        height: 85px;
    }
    
    .checker-img {
        width: 65px;
        height: 65px;
    }
    
    .difficulty-title, .color-title {
        font-size: 1.3rem;
    }
    
    .difficulty-description, .color-description {
        font-size: 0.95rem;
    }
    
    .difficulty-button, .color-button {
        padding: 24px 18px;
        margin-bottom: 1rem;
    }
    
    .difficulty-button:hover, .color-button:hover {
        transform: translateY(-8px) scale(1.02);
    }
    
    /* Адаптивность для кнопок управления игрой */
    .game-controls-left .btn-custom {
        min-width: 100px;
        padding: 0 10px;
        font-size: 12px;
        margin-left: 5px;
    }
    
    .game-controls-left .btn-custom:first-child {
        margin-left: 0;
    }
    
    .game-controls-right .btn-custom {
        min-width: 100px;
        padding: 0 10px;
        font-size: 12px;
        margin-right: 5px;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 575.98px) {
    .ai-difficulty-modal .modal-body {
        padding: 1.2rem;
    }
    
    .difficulty-button, .color-button {
        padding: 18px 12px;
    }
    
    .difficulty-icon, .checker-option {
        width: 75px;
        height: 75px;
    }
    
    .checker-img {
        width: 55px;
        height: 55px;
    }
    
    .difficulty-title, .color-title {
        font-size: 1.2rem;
    }
    
    .difficulty-description, .color-description {
        font-size: 0.9rem;
    }
    
    /* Адаптивность для кнопок управления игрой на очень маленьких экранах */
    .game-controls-left .btn-custom {
        min-width: 80px;
        padding: 0 8px;
        font-size: 11px;
        margin-left: 3px;
    }
    
    .game-controls-left .btn-custom:first-child {
        margin-left: 0;
    }
    
    .game-controls-right .btn-custom {
        min-width: 80px;
        padding: 0 8px;
        font-size: 11px;
        margin-right: 3px;
    }
    
    /* Сокращаем текст на кнопках на очень маленьких экранах */
    .game-controls-left .btn-custom:first-child span:not(.fa) {
        display: none;
    }
    
    .game-controls-left .btn-custom:nth-child(2) span:not(.fa) {
        display: none;
    }
    
    .game-controls-right .btn-custom span:not(.fa) {
        display: none;
    }
}

/* ===== СТИЛИ ЛОГОТИПА Babilon-T ===== */
.babilon-logo {
    width: 360px;
    height: auto;
    margin: 50px 0 20px -50px;
    background: none;
    pointer-events: none;
    transition: none;
    box-shadow: none;
    cursor: default;
    opacity: 1;
}

.babilon-logo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    transition: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Адтивность логотипа для мобильных устройств */
@media (max-width: 991.98px) {
    .babilon-logo {
        width: 320px;
        margin: 45px 0 20px -35px;
    }
}

/* ===== СТИЛИ ВЕРХНЕЙ ПАНЕЛИ НАВИГАЦИИ ===== */
.top-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
}

.nav-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    text-decoration: none;
}

.checkers-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.nav-logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.nav-link.active {
    color: white;
    border-bottom-color: white;
}

.nav-profile {
    margin-left: auto;
}

/* Отступ для основного контента, чтобы он не перекрывался навигацией */
.main-content {
    margin-top: 80px;
    margin-bottom: 120px; /* Добавляем отступ снизу для фиксированного футера */
}

/* Адаптивность для навигационной панели */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .navbar-brand {
        padding-left: 0;
        flex-direction: column;
        gap: 5px;
    }
    
    .checkers-logo {
        height: 30px;
    }
    
    .logo-icon {
        height: 30px;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .main-content {
        margin-top: 100px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 10px;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 3px 0;
    }
    
    .nav-link i {
        display: none;
    }
    
    .main-content {
        margin-top: 120px;
    }
    
    .checkers-logo {
        height: 24px;
    }
    
}

@media (max-width: 767.98px) {
    .babilon-logo {
        width: 280px;
        margin: 40px 0 15px -25px;
    }
}

@media (max-width: 575.98px) {
    .babilon-logo {
        width: 240px;
        margin: 35px 0 15px -20px;
    }
}

/* ===== СТИЛИ ДЛЯ ЗАГОЛОВКА САЙТА ===== */
.site-title {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 20px;
}

.navbar-brand:hover .site-title {
    color: white;
    text-decoration: underline;
}

.navbar-brand:focus .site-title {
    outline: none;
    color: white;
}

/* Адаптивность для заголовка сайта */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.1rem;
    }
}

/* ===== СТИЛИ БЛОКА АВТОРИЗАЦИИ НА ГЛАВНОЙ СТРАНИЦЕ ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px); /* Учитываем высоту навигации */
    padding: 20px 0;
}

.auth-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.auth-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 150px;
}

.register-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.register-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.login-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: white;
}

/* Адаптивность для блока авторизации */
@media (max-width: 768px) {
    .auth-container {
        min-height: calc(100vh - 100px);
        padding: 15px 0;
    }
    
    .auth-card {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .auth-btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        min-height: calc(100vh - 120px);
        padding: 10px 0;
    }
    
    .auth-card {
        padding: 25px 15px;
    }
    
    .auth-btn {
        padding: 12px 25px;
        font-size: 1rem;
        min-width: 120px;
    }
}

/* ===== СТИЛИ НИЖНЕЙ ПАНЕЛИ (FOOTER) С ЛОГОТИПОМ Babilon-T ===== */
html {
    min-height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background-image: url('/templates/img/img1.png');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    background-repeat: no-repeat;
}

/* Создаем псевдоэлемент для логотипа и текста на фоне */
body::after {
    content: '© 2025 Babilon-T Telecommunications';
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 1);
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
    margin-left: 40px;
}

/* Добавляем логотип через псевдоэлемент */
body::before {
    content: '';
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-160px);
    width: 70px;
    height: 70px;
    background-image: url('/static/img/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

.main-content {
    flex: 1;
    margin-top: 80px;
    margin-bottom: 80px; /* Отступ для логотипа внизу */
    position: relative;
    z-index: 2;
}

.site-footer {
    display: none; /* Скрываем оригинальный футер */
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.footer-logo-link:hover {
    transform: scale(1.05);
}

.footer-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.footer-text {
    font-size: 14px;
    opacity: 0.9;
    color: rgba(255, 255, 255, 1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}

.footer-logo-link:hover + .footer-text {
    opacity: 1;
    color: rgba(255, 255, 255, 1);
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
}

/* Адаптивность для footer на мобильных устройствах */
@media (max-width: 600px) {
    .site-footer {
        padding: 15px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .footer-logo {
        height: 30px;
    }
    
    .footer-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .footer-logo {
        height: 24px;
    }
    
    .footer-text {
        font-size: 11px;
    }
}