.wp-nummaze-trainer-wrapper, .wp-nummaze-trainer-wrapper * {
    box-sizing: border-box !important; line-height: normal !important;
}
.wp-nummaze-trainer-wrapper {
    width: 100% !important; display: flex !important; justify-content: center !important; margin: 20px 0 !important;
}
.wp-nummaze-trainer-wrapper p { margin: 0 !important; padding: 0 !important; display: inline !important; }
.wp-nummaze-trainer-wrapper br { display: none !important; }

.wp-nummaze-trainer-wrapper .trainer-card {
    width: 100% !important; max-width: 600px !important; background: #ffffff !important; padding: 25px;
    border-radius: 12px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important; border: 1px solid #e2e8f0 !important; text-align: center !important;
}
.wp-nummaze-trainer-wrapper h2 { font-size: 22px !important; margin: 0 0 15px 0 !important; color: #1e293b !important; }

/* Зона настроек сложности */
.wp-nummaze-trainer-wrapper .setup-zone {
    margin: 15px 0 !important; padding: 12px !important; background: #f8fafc !important; border: 1px solid #cbd5e1 !important; border-radius: 8px !important; display: flex !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center !important; gap: 15px !important;
}
.wp-nummaze-trainer-wrapper .setup-item { display: flex !important; align-items: center !important; gap: 6px !important; font-size: 14px !important; font-weight: bold !important; color: #475569 !important; }
.wp-nummaze-trainer-wrapper .setup-item select {
    height: 36px !important; font-size: 13px !important; font-weight: bold !important; border: 1px solid #cbd5e1 !important; border-radius: 6px !important; color: #007bff !important; background: #ffffff !important; padding: 0 6px !important;
}

/* Инфо-панель */
.wp-nummaze-trainer-wrapper .game-info-bar {
    display: flex !important; justify-content: space-between !important; align-items: center !important; margin: 15px 0 !important; padding: 12px 18px !important; background: #f0fdf4 !important; border: 1px solid #bbf7d0 !important; border-radius: 8px !important; gap: 15px !important;
}
.wp-nummaze-trainer-wrapper .timer-text { font-weight: bold !important; font-size: 15px !important; color: #1c73a8 !important; }
.wp-nummaze-trainer-wrapper .combo-text { font-size: 15px !important; font-weight: bold !important; color: #b45309 !important; }

/* Графический холст */
.wp-nummaze-trainer-wrapper .maze-frame {
    width: 100% !important; max-width: 520px !important; min-height: 340px !important; margin: 25px auto !important; position: relative !important; background: #fafafa !important; border: 2px dashed #cbd5e1 !important; border-radius: 12px !important; padding: 15px !important; display: flex !important; flex-direction: column !important; align-items: center !important;
}
.wp-nummaze-trainer-wrapper .maze-feedback-zone {
    width: 100% !important; min-height: 54px !important; display: flex !important; align-items: center !important; justify-content: center !important; border-radius: 6px !important; font-size: 14px !important; font-weight: bold !important; transition: all 0.3s ease !important; color: #475569 !important; background: #ffffff !important; border: 1px solid #cbd5e1 !important; text-align: center !important; padding: 6px 15px !important; margin-bottom: 20px !important;
}

.wp-nummaze-trainer-wrapper .maze-grid {
    display: grid !important; 
    gap: 6px !important; 
    background: #cbd5e1 !important; 
    padding: 8px !important; 
    border-radius: 10px !important; 
    width: 100% !important; 
    max-width: 440px !important; 
    margin: 10px auto !important;
}

/* Стили ячеек-примеров (Размер шрифта на ПК приподнят до 18px) */
.wp-nummaze-trainer-wrapper .maze-cell {
    background: #ffffff !important; border: 2px solid #94a3b8 !important; border-radius: 6px !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; font-family: monospace !important; font-size: 18px !important; font-weight: bold !important; color: #1e293b !important; cursor: pointer !important; aspect-ratio: 1 / 1 !important; transition: all 0.15s ease !important; user-select: none !important; position: relative !important;
}

/* Цветовые маркеры состояний пути */
.wp-nummaze-trainer-wrapper .maze-cell.is-start-node { border: 3px solid #007bff !important; background: #e0f2fe !important; }
.wp-nummaze-trainer-wrapper .maze-cell.is-finish-node { border: 3px dashed #f59e0b !important; background: #fef3c7 !important; }
.wp-nummaze-trainer-wrapper .maze-cell.is-selectable { background: #fef9c3 !important; border-color: #eab308 !important; } 
.wp-nummaze-trainer-wrapper .maze-cell.is-active-path { background: #22c55e !important; border-color: #16a34a !important; color: #ffffff !important; } 
.wp-nummaze-trainer-wrapper .maze-cell.is-wrong-blink { background: #ef4444 !important; border-color: #dc2626 !important; color: #ffffff !important; animation: cellShake 0.3s ease !important; }

@keyframes cellShake {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.92); }
}

/* Кнопки */
.wp-nummaze-trainer-wrapper .action-buttons-box {
    display: flex !important; justify-content: center !important; gap: 12px !important; flex-wrap: wrap !important; margin-top: 15px !important; width: 100% !important;
}
.wp-nummaze-trainer-wrapper .btn-action {
    background-color: #007bff !important; color: #ffffff !important; border: none !important; border-radius: 6px !important; font-size: 15px !important; font-weight: bold !important; height: 44px !important; padding: 0 25px !important; cursor: pointer !important; transition: background 0.2s ease-in-out !important; display: inline-block !important; text-decoration: none !important;
}
.wp-nummaze-trainer-wrapper .btn-action:hover { background-color: #0056b3 !important; }

/* === МОБИЛЬНАЯ АДАПТАЦИЯ (Безопасный компактный размер) === */
@media (max-width: 480px) {
    .wp-nummaze-trainer-wrapper .trainer-card { padding: 15px 5px !important; }
    .wp-nummaze-trainer-wrapper .maze-frame { padding: 10px 4px !important; }
    
    /* Сохраняем мобильные габариты на уровне 280px для узких экранов */
    .wp-nummaze-trainer-wrapper .maze-grid { gap: 4px !important; padding: 4px !important; max-width: 280px !important; }
    .wp-nummaze-trainer-wrapper .maze-cell { font-size: 11px !important; border-width: 1px !important; }
    .wp-nummaze-trainer-wrapper .setup-zone { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
    .wp-nummaze-trainer-wrapper .setup-item { justify-content: space-between !important; }
}
