/* Основные стили для модуля генератора филвордов */
.mod-fillword-generator * {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.mod-fillword-generator {
    margin: 0;
    padding: 1px;
    border-radius: 15px;
    color: #374151;
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

.mod-fillword-generator .container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    padding: 5px;
    width: 100%;
    overflow-x: hidden;
}

.mod-fillword-generator h1 {
    color: #7C3AED; /* Фиолетовый 700 */
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #8B5CF6; /* Фиолетовый 500 */
    padding-bottom: 15px;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Рекламный блок - центрирование и одинаковые отступы */
.mod-fillword-generator .ad-block {
    margin: 25px auto;
    padding: 0;
    background: transparent;
    text-align: center;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Адаптивные отступы для мобильных устройств */
@media (max-width: 768px) {
    .mod-fillword-generator .ad-block {
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .mod-fillword-generator .ad-block {
        margin: 15px auto;
    }
}

/* Стили для ссылки внутри рекламного блока */
.mod-fillword-generator .ad-block a {
    display: inline-block;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

/* Дополнительные стили для содержимого рекламного блока */
.mod-fillword-generator .ad-block img,
.mod-fillword-generator .ad-block iframe {
    max-width: 100%;
    display: inline-block;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Стили для ссылки с изображением */
.mod-fillword-generator .ad-block a img {
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Эффект при наведении на ссылку с изображением */
.mod-fillword-generator .ad-block a:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* Сохраняем скругление при наведении на ссылку */
.mod-fillword-generator .ad-block a:hover {
    border-radius: 8px;
}

.mod-fillword-generator .ad-block iframe {
    border: none;
}

.mod-fillword-generator .generator-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .mod-fillword-generator .generator-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .mod-fillword-generator .generator-form {
        gap: 15px;
    }
}

.mod-fillword-generator .form-section {
    background-color: #F8FAFF; /* Светло-фиолетовый фон */
    padding: 24px;
    border-radius: 10px;
    border-left: 4px solid #8B5CF6; /* Фиолетовый акцент */
    border-top: 1px solid #E5E7FF;
    border-right: 1px solid #E5E7FF;
    border-bottom: 1px solid #E5E7FF;
    width: 100%;
    transition: all 0.3s ease;
}

.mod-fillword-generator .form-section:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .mod-fillword-generator .form-section {
        padding: 18px;
    }
}

.mod-fillword-generator .form-section h2 {
    margin-top: 0;
    color: #7C3AED; /* Фиолетовый 700 */
    font-size: clamp(1.1rem, 3vw, 1.3rem);
}

.mod-fillword-generator .form-group {
    margin-bottom: 20px;
    width: 100%;
}

.mod-fillword-generator label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4F46E5; /* Индиго 600 */
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.mod-fillword-generator input, 
.mod-fillword-generator select, 
.mod-fillword-generator textarea, 
.mod-fillword-generator button {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #DDD6FE; /* Фиолетовый 200 */
    border-radius: 8px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    transition: all 0.3s ease;
    background-color: white;
}

.mod-fillword-generator input:focus, 
.mod-fillword-generator select:focus, 
.mod-fillword-generator textarea:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.mod-fillword-generator textarea {
    min-height: 150px;
    resize: vertical;
    font-family: monospace;
}

.mod-fillword-generator button {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); /* Фиолетовый градиент */
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    border-radius: 8px;
}

.mod-fillword-generator button:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.mod-fillword-generator .actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .mod-fillword-generator .actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .mod-fillword-generator .actions button {
        width: 100%;
    }
}

.mod-fillword-generator .actions button {
    flex: 1;
}

.mod-fillword-generator .btn-secondary {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%); /* Голубой градиент */
}

.mod-fillword-generator .btn-secondary:hover {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.mod-fillword-generator .btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%); /* Изумрудный градиент */
}

.mod-fillword-generator .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.mod-fillword-generator .puzzle-container {
    margin-top: 40px;
    padding: 0px 20px 0px 20px;
    background-color: #F8FAFF;
    border-radius: 12px;
    border: 1px solid #E5E7FF;
    display: none;
    width: 100%;
    overflow-x: hidden;
}

.mod-fillword-generator .puzzle-container.active {
    display: block;
}

.mod-fillword-generator .puzzle-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.mod-fillword-generator .puzzle-header h2 {
    margin: 0;
    color: #7C3AED;
    font-size: clamp(1.3rem, 3.5vw, 1.5rem);
    background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Кнопки под сеткой */
.mod-fillword-generator .puzzle-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    width: 100%;
}

@media (max-width: 768px) {
    .mod-fillword-generator .puzzle-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin: 20px 0;
    }
    
    .mod-fillword-generator .puzzle-actions button {
        width: 100%;
        max-width: 300px;
    }
}

/* ИСПРАВЛЕННАЯ СЕТКА ФИЛВОРДА - теперь полностью адаптивная */
.mod-fillword-generator .puzzle-grid {
    display: grid;
    gap: 1px;
    background-color: #8B5CF6; /* Фиолетовый фон сетки */
    padding: 3px;
    margin: 0 auto 30px auto;
    border: 2px solid #7C3AED;
    width: 95%;
    max-width: 600px;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}

/* Адаптивные размеры для сетки */
@media (max-width: 900px) {
    .mod-fillword-generator .puzzle-grid {
        max-width: 90vw;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .mod-fillword-generator .puzzle-grid {
        max-width: 95vw;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 600px) {
    .mod-fillword-generator .puzzle-grid {
        max-width: 98vw;
        padding: 2px;
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .mod-fillword-generator .puzzle-grid {
        max-width: 100%;
        gap: 0.5px;
    }
}

/* Адаптивные ячейки сетки */
.mod-fillword-generator .grid-cell {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    aspect-ratio: 1;
    user-select: none;
    border: 1px solid #DDD6FE;
    transition: all 0.3s ease;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    font-size: clamp(14px, 2.5vw, 24px);
    color: #4F46E5; /* Темно-фиолетовый цвет букв */
}

/* Адаптивный размер шрифта для больших сеток (14x14 и 16x16) */
@media (max-width: 1200px) {
    .mod-fillword-generator .grid-cell {
        font-size: clamp(12px, 2vw, 16px);
    }
}

@media (max-width: 900px) {
    .mod-fillword-generator .grid-cell {
        font-size: clamp(11px, 1.8vw, 18px);
    }
}

@media (max-width: 600px) {
    .mod-fillword-generator .grid-cell {
        font-size: clamp(10px, 1.6vw, 16px);
    }
}

@media (max-width: 480px) {
    .mod-fillword-generator .grid-cell {
        font-size: clamp(16px, 1.4vw, 14px);
        border-width: 0.5px;
    }
}

/* Для очень маленьких экранов и больших сеток */
@media (max-width: 400px) {
    .mod-fillword-generator .grid-cell {
        font-size: clamp(16px, 1.2vw, 12px);
    }
}

.mod-fillword-generator .grid-cell.highlight {
    background-color: #C4B5FD !important; /* Фиолетовый 300 */
    color: #5B21B6;
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.mod-fillword-generator .words-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .mod-fillword-generator .words-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .mod-fillword-generator .words-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

.mod-fillword-generator .word-item {
    padding: 12px 16px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 8px;
    border-left: 4px solid #8B5CF6;
    cursor: default;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    word-break: break-word;
    overflow-wrap: break-word;
    transition: all 0.3s ease;
    color: #4F46E5;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}

.mod-fillword-generator .word-item.placed {
    cursor: pointer;
}

.mod-fillword-generator .word-item.placed:hover {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.mod-fillword-generator .word-item.not-placed {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border-left-color: #EF4444; /* Красный для не размещенных */
    color: #7F1D1D;
    font-style: italic;
    opacity: 0.8;
}

.mod-fillword-generator .words-separator {
    grid-column: 1 / -1;
    margin-top: 15px;
    padding: 5px 0;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #6B7280;
    border-top: 2px dashed #DDD6FE;
    font-style: italic;
    text-align: center;
}

.mod-fillword-generator .stats {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .mod-fillword-generator .stats {
        gap: 10px;
        justify-content: center;
        display: flex;
        flex-direction: column-reverse;
    }
    
    .mod-fillword-generator .stat-box {
        min-width: calc(50% - 10px);
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .mod-fillword-generator .stat-box {
        min-width: 100%;
    }
}

.mod-fillword-generator .stat-box {
    padding: 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 10px;
    flex: 1;
    min-width: 140px;
    text-align: center;
    border: 1px solid #DDD6FE;
    transition: all 0.3s ease;
}

.mod-fillword-generator .stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.12);
}

.mod-fillword-generator .stat-value {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: bold;
    color: #7C3AED; /* Фиолетовый акцент */
    margin-bottom: 5px;
}

.mod-fillword-generator .print-only {
    display: none;
}

/* Стили для печати - ПЕРЕРАБОТАНЫ на основе старых проверенных стилей */
@media print {
    body {
        background-color: white;
        padding: 10px;
        font-size: 12pt;
        margin: 0;
    }
    
    .mod-fillword-generator .container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
        margin: 0;
        border: none;
    }
    
    .mod-fillword-generator .generator-form, 
    .mod-fillword-generator .actions, 
    .mod-fillword-generator .puzzle-header, 
    .mod-fillword-generator .alert,
    .mod-fillword-generator .loading,
    .mod-fillword-generator .stats,
    .mod-fillword-generator .word-item.not-placed,
    .mod-fillword-generator .word-item.not-placed::after,
    .mod-fillword-generator .words-separator,
    .mod-fillword-generator h1,
    .mod-fillword-generator .generator-form,
    .mod-fillword-generator .form-section,
    .mod-fillword-generator .puzzle-actions,
    .mod-fillword-generator .ad-block {
        display: none !important;
    }
    
    .mod-fillword-generator .puzzle-container {
        display: block !important;
        padding: 0;
        margin-top: 0;
        background-color: white;
        page-break-inside: avoid;
        border: none;
        width: 100%;
    }
    
    .mod-fillword-generator .print-only {
        display: block;
        margin-bottom: 20px;
        font-size: 12pt;
        color: #000;
        text-align: center;
    }
    
    .mod-fillword-generator .puzzle-grid {
        max-width: 100% !important;
        border: 2px solid #7C3AED !important;
        background-color: #7C3AED;
        gap: 1px;
        margin: 20px auto;
        page-break-inside: avoid;
        width: 100% !important;
        font-size: 0;
    }
    
    .mod-fillword-generator .grid-cell {
        border: 1px solid #7C3AED !important;
        font-size: clamp(8pt, 2.5vw, 16pt);
        font-weight: bold;
        background-color: white;
        aspect-ratio: 1 !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
        page-break-inside: avoid;
        color: #4F46E5;
    }
    
    .mod-fillword-generator .puzzle-header h2,
    .mod-fillword-generator .words-title,
    .mod-fillword-generator h3 {
        color: #7C3AED !important;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .mod-fillword-generator .puzzle-header h2 {
        font-size: 18pt;
        text-align: center;
        border-bottom: 1px solid #7C3AED;
    }
    
    .mod-fillword-generator .words-title {
        font-size: 16pt;
        text-align: center;
        margin-top: 30px;
    }
    
    .mod-fillword-generator .words-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
        margin-top: 15px;
        page-break-inside: avoid;
    }
    
    .mod-fillword-generator .word-item {
        padding: 0 !important;
        border: none !important;
        border-left: none !important;
        background-color: transparent !important;
        font-size: 11pt;
        break-inside: avoid;
        color: #4F46E5;
    }
    
    .mod-fillword-generator .word-item.not-placed {
        display: none !important;
    }
    
    .mod-fillword-generator button {
        display: none !important;
    }
    
    .mod-fillword-generator .puzzle-container, 
    .mod-fillword-generator .word-item, 
    .mod-fillword-generator .grid-cell {
        border-radius: 0 !important;
    }
    
    @page {
        margin: 0.5cm;
    }
    
    @media print and (max-width: 21cm) {
        .mod-fillword-generator .puzzle-grid {
            max-width: 90%;
        }
    }
    
    .mod-fillword-generator .puzzle-grid {
        border-width: 2px !important;
    }
    
    .mod-fillword-generator .grid-cell {
        border-width: 0.5px !important;
    }
    
    .mod-fillword-generator .grid-cell.highlight {
        background-color: white !important;
    }
}

.mod-fillword-generator .loading {
    display: none;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.mod-fillword-generator .loading.active {
    display: block;
}

.mod-fillword-generator .spinner {
    border: 5px solid #F5F3FF;
    border-top: 5px solid #8B5CF6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mod-fillword-generator .checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    background-color: #F5F3FF;
    border-radius: 8px;
    border: 1px solid #DDD6FE;
}

.mod-fillword-generator .checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    accent-color: #8B5CF6;
}

.mod-fillword-generator .checkbox-container label {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #4F46E5;
}

.mod-fillword-generator .words-title {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #7C3AED;
    font-size: clamp(1.2rem, 3.5vw, 1.4rem);
    background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Добавьте в style.css следующие стили */

.mod-fillword-generator .words-subtitle {
    grid-column: 1 / -1;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 10px;
    color: #7C3AED;
    font-size: clamp(1rem, 3vw, 1.1rem);
    text-align: center;
}

.mod-fillword-generator .words-subtitle.placed-title {
    margin-top: 0;
}

.mod-fillword-generator .words-separator {
    grid-column: 1 / -1;
    text-align: center;
    margin: 20px 0;
    padding: 12px;
    font-weight: bold;
    color: #EF4444; /* Красный для не размещенных слов */
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border-radius: 8px;
    border-left: 4px solid #EF4444;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* Стиль для жирного текста филворды.рф в печати */
@media print {
    .mod-fillword-generator .print-site-note strong {
        font-weight: bold !important;
    }
}

/* Инструкция для клика по словам */
.mod-fillword-generator .instruction-text {
    text-align: center;
    margin: 10px 0 15px 0;
    font-style: italic;
    color: #6B7280;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    padding: 10px;
    background-color: #F5F3FF;
    border-radius: 8px;
    border: 1px dashed #DDD6FE;
}

/* Стили для настроек печати */

.mod-fillword-generator .print-settings-toggle {
    margin: 20px 0 10px 0;
}

.mod-fillword-generator .print-settings-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    color: #7C3AED;
    border: 1px solid #DDD6FE;
    padding: 12px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: auto;
    margin: 0;
    font-weight: 600;
}

.mod-fillword-generator .print-settings-btn:hover {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.mod-fillword-generator .toggle-icon {
    margin-right: 10px;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.mod-fillword-generator .print-settings-btn.active .toggle-icon {
    transform: rotate(90deg);
}

.mod-fillword-generator .print-settings-form {
    background: linear-gradient(135deg, #F8FAFF 0%, #F5F3FF 100%);
    border: 1px solid #DDD6FE;
    border-radius: 10px;
    padding: 24px;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mod-fillword-generator .print-settings-form .form-group {
    margin-bottom: 18px;
}

.mod-fillword-generator .print-settings-form .form-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6B7280;
    font-style: italic;
}

.mod-fillword-generator .print-settings-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* Адаптивность для настроек печати */
@media (max-width: 768px) {
    .mod-fillword-generator .print-settings-form {
        padding: 18px;
    }
    
    .mod-fillword-generator .print-settings-btn {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Скрываем настройки печати при печати */
@media print {
    .mod-fillword-generator .print-settings-toggle,
    .mod-fillword-generator .print-settings-form {
        display: none !important;
    }
}

/* СОВРЕМЕННЫЕ УВЕДОМЛЕНИЯ - полностью переработаны */
.mod-fillword-generator .notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px; /* ← ЭТО ОСНОВНОЙ ОТСТУП МЕЖДУ УВЕДОМЛЕНИЯМИ */
    max-width: 350px;
    width: calc(100% - 40px);
}

@media (max-width: 768px) {
    .mod-fillword-generator .notifications-container {
        top: 20px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        z-index: 9999;
    }
}

.mod-fillword-generator .notification {
    position: absolute; /* ← ВАЖНО: используем absolute */
    right: 0;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    width: 100%;
    backdrop-filter: blur(10px);
}

.mod-fillword-generator .notification.show {
    opacity: 1;
    transform: translateX(0);
}

.mod-fillword-generator .notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 5px 0 0 5px;
}

.mod-fillword-generator .notification.error {
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.95) 0%, rgba(254, 226, 226, 0.95) 100%);
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.mod-fillword-generator .notification.error::before {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.mod-fillword-generator .notification.success {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.95) 0%, rgba(220, 252, 231, 0.95) 100%);
    color: #16A34A;
    border: 1px solid #86EFAC;
}

.mod-fillword-generator .notification.success::before {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.mod-fillword-generator .notification.warning {
    background: linear-gradient(135deg, rgba(254, 252, 232, 0.95) 0%, rgba(254, 249, 195, 0.95) 100%);
    color: #CA8A04;
    border: 1px solid #FDE047;
}

.mod-fillword-generator .notification.warning::before {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.mod-fillword-generator .notification.info {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(219, 234, 254, 0.95) 100%);
    color: #2563EB;
    border: 1px solid #93C5FD;
}

.mod-fillword-generator .notification.info::before {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
}

.mod-fillword-generator .notification-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.mod-fillword-generator .notification-icon {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
}

.mod-fillword-generator .notification-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
}

.mod-fillword-generator .notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.7;
    transition: all 0.2s;
    width: auto;
    height: auto;
    min-width: auto;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mod-fillword-generator .notification-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.5);
}

/* Таймер для уведомлений */
.mod-fillword-generator .notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, currentColor 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0.3;
    transform-origin: left;
    animation: notificationTimer 8s linear forwards;
}

@keyframes notificationTimer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .mod-fillword-generator .notification {
        padding: 16px 20px;
    }
    
    .mod-fillword-generator .notification-icon {
        font-size: 20px;
        min-width: 22px;
    }
    
    .mod-fillword-generator .notification-text {
        font-size: 14px;
    }
    
    .mod-fillword-generator .notification-close {
        font-size: 18px;
        margin-left: 10px;
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
.mod-fillword-generator .puzzle-container {
       padding: 0px;
  }
}

@media (max-width: 768px) {
.mod-fillword-generator .puzzle-container {
       padding: 0px;
  }
}

/* Стили для выделенных слов в списке */
.mod-fillword-generator .word-item.highlighted {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border-left: 4px solid #FDE047;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.mod-fillword-generator .word-item.highlighted:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* ОБНОВЛЕННЫЕ стили для пульсации с контрастными цветами */
@keyframes word-pulse {
    0% {
        background-color: #C4B5FD;
        color: #4F46E5;
        transform: scale(1);
        box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
        z-index: 5;
    }
    20% {
        background-color: #A78BFA;
        color: #1E1B4B;
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
        z-index: 15;
    }
    40% {
        background-color: #8B5CF6;
        color: #FFFFFF;
        transform: scale(1.25);
        box-shadow: 0 0 30px rgba(139, 92, 246, 1);
        z-index: 20;
    }
    60% {
        background-color: #A78BFA;
        color: #1E1B4B;
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
        z-index: 15;
    }
    80% {
        background-color: #C4B5FD;
        color: #3730A3;
        transform: scale(1.05);
        box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
        z-index: 8;
    }
    100% {
        background-color: #C4B5FD;
        color: #4F46E5;
        transform: scale(1);
        box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
        z-index: 5;
    }
}

.mod-fillword-generator .grid-cell.pulse {
    animation: word-pulse 2s ease-in-out;
    position: relative;
    transition: all 0.3s ease;
}

/* Стили для выделенных слов в числовом режиме */
.mod-fillword-generator .word-item.highlighted {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border-left: 4px solid #FDE047;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Обновляем стили для обычных слов при наведении */
.mod-fillword-generator .word-item.placed:hover {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* Стили для неразмещенных слов */
.mod-fillword-generator .word-item.not-placed {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border-left-color: #EF4444;
    color: #7F1D1D;
    font-style: italic;
    opacity: 0.8;
    cursor: not-allowed;
}

.mod-fillword-generator .word-item.not-placed:hover {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}